Nhảy tới nội dung

Class: SimpleVectorStore

Implements

Constructors

constructor

new SimpleVectorStore(data?, fs?): SimpleVectorStore

Parameters

NameType
data?SimpleVectorStoreData
fs?GenericFileSystem

Returns

SimpleVectorStore

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:37

Properties

data

Private data: SimpleVectorStoreData

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:33


fs

Private fs: GenericFileSystem = defaultFS

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:34


persistPath

Private persistPath: undefined | string

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:35


storesText

storesText: boolean = false

Implementation of

VectorStore.storesText

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:32

Accessors

client

get client(): any

Returns

any

Implementation of

VectorStore.client

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:50

Methods

add

add(embeddingResults): Promise<string[]>

Parameters

NameType
embeddingResultsBaseNode<Metadata>[]

Returns

Promise<string[]>

Implementation of

VectorStore.add

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:58


delete

delete(refDocId): Promise<void>

Parameters

NameType
refDocIdstring

Returns

Promise<void>

Implementation of

VectorStore.delete

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:77


get

get(textId): Promise<number[]>

Parameters

NameType
textIdstring

Returns

Promise<number[]>

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:54


persist

persist(persistPath?, fs?): Promise<void>

Parameters

NameType
persistPathstring
fs?GenericFileSystem

Returns

Promise<void>

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:146


query

query(query): Promise<VectorStoreQueryResult>

Parameters

NameType
queryVectorStoreQuery

Returns

Promise<VectorStoreQueryResult>

Implementation of

VectorStore.query

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:88


toDict

toDict(): SimpleVectorStoreData

Returns

SimpleVectorStoreData

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:196


fromDict

fromDict(saveDict): SimpleVectorStore

Parameters

NameType
saveDictSimpleVectorStoreData

Returns

SimpleVectorStore

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:189


fromPersistDir

fromPersistDir(persistDir?, fs?): Promise<SimpleVectorStore>

Parameters

NameTypeDefault value
persistDirstringDEFAULT_PERSIST_DIR
fsGenericFileSystemdefaultFS

Returns

Promise<SimpleVectorStore>

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:42


fromPersistPath

fromPersistPath(persistPath, fs?): Promise<SimpleVectorStore>

Parameters

NameType
persistPathstring
fs?GenericFileSystem

Returns

Promise<SimpleVectorStore>

Defined in

packages/core/src/storage/vectorStore/SimpleVectorStore.ts:159