VectorStoreIndex
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:75
VectorStoreIndex,一种仅根据节点向量嵌入进行存储的索引。
BaseIndex<IndexDict>
storageContext
Section titled “storageContext”storageContext:
StorageContext
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:52
docStore
Section titled “docStore”docStore:
BaseDocumentStore
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:53
indexStruct
Section titled “indexStruct”indexStruct:
IndexDict
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:55
indexStore
Section titled “indexStore”索引存储:
BaseIndexStore
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:76
optional嵌入模型:BaseEmbedding
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:77
vectorStores
Section titled “vectorStores”向量存储:
VectorStoreByType
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:78
asQueryTool()
Section titled “asQueryTool()”asQueryTool(
params):QueryEngineTool
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:94
通过调用 asQueryEngine 返回一个查询工具。 可以传递 options 或 retriever 其中之一,但不能同时传递两者。 如果提供了 options,它们将被传递用于生成检索器。
insert()
Section titled “insert()”insert(
document):Promise<void>
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:110
将文档插入索引中。
Document
Promise<void>
retriever()
Section titled “retriever()”retriever(
options?):BaseRetriever
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:127
asRetriever 的别名
any
BaseRetriever
queryEngine()
Section titled “queryEngine()”queryEngine(
options?):BaseQueryEngine
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:135
asQueryEngine 的别名
您可以提供自定义的检索器和响应合成器
BaseRetriever
BaseSynthesizer
BaseQueryEngine
queryTool()
Section titled “queryTool()”queryTool(
params):QueryEngineTool
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:147
asQueryTool 的别名 可以传入 options 或 retriever 中的任意一个,但不能同时传入。 如果提供了 options,它们将被传递给生成检索器。
init()
Section titled “init()”
staticinit(options):Promise<VectorStoreIndex>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:92
异步初始化函数创建一个新的向量存储索引。
Promise<VectorStoreIndex>
getNodeEmbeddingResults()
Section titled “getNodeEmbeddingResults()”getNodeEmbeddingResults(
nodes,options?):Promise<BaseNode<Metadata>[]>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:173
计算给定节点的嵌入向量。
BaseNode<Metadata>[]
一个BaseNode对象数组,表示需要计算嵌入向量的节点。
一个包含额外参数的可选对象。
boolean
一个布尔值,指示是否将进度记录到控制台(对调试很有用)。
(progress, total) => void
Promise<BaseNode<Metadata>[]>
buildIndexFromNodes()
Section titled “buildIndexFromNodes()”buildIndexFromNodes(
nodes,options?):Promise<void>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:202
获取节点的嵌入向量并将其放入索引中。
BaseNode<Metadata>[]
boolean
(progress, total) => void
Promise<void>
fromDocuments()
Section titled “fromDocuments()”
staticfromDocuments(documents,args):Promise<VectorStoreIndex>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:220
高级API:分割文档、获取嵌入向量并构建索引。
Document<Metadata>[]
VectorIndexOptions & object = {}
Promise<VectorStoreIndex>
fromVectorStores()
Section titled “fromVectorStores()”
staticfromVectorStores(vectorStores):Promise<VectorStoreIndex>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:265
vectorStores
Section titled “vectorStores”VectorStoreByType
Promise<VectorStoreIndex>
fromVectorStore()
Section titled “fromVectorStore()”
staticfromVectorStore(vectorStore):Promise<VectorStoreIndex>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:284
vectorStore
Section titled “vectorStore”BaseVectorStore
Promise<VectorStoreIndex>
asRetriever()
Section titled “asRetriever()”asRetriever(
options?):VectorIndexRetriever
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:288
从索引创建一个新的检索器。
Omit<object & object, "index"> | Omit<object & object, "index">
asQueryEngine()
Section titled “asQueryEngine()”asQueryEngine(
options?):RetrieverQueryEngine
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:298
创建一个检索查询引擎。 仅当未提供现有检索器时,才使用similarityTopK参数。
BaseRetriever
BaseSynthesizer
MetadataFilters
unknown
BaseNodePostprocessor[]
相似度TopK?
Section titled “similarityTopK?”number
RetrieverQueryEngine
asChatEngine()
Section titled “asChatEngine()”asChatEngine(
options):ContextChatEngine
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:331
将索引转换为聊天引擎。
VectorIndexChatEngineOptions = {}
创建聊天引擎的选项
ContextChatEngine
一个使用索引检索器为每个查询获取上下文的ContextChatEngine
insertNodesToStore()
Section titled “insertNodesToStore()”
protectedinsertNodesToStore(newIds,nodes,vectorStore):Promise<void>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:351
newIds
Section titled “newIds”string[]
BaseNode<Metadata>[]
vectorStore
Section titled “vectorStore”BaseVectorStore
Promise<void>
insertNodes()
Section titled “insertNodes()”insertNodes(
nodes,options?):Promise<void>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:375
BaseNode<Metadata>[]
boolean
(progress, total) => void
Promise<void>
deleteRefDoc()
Section titled “deleteRefDoc()”deleteRefDoc(
refDocId,deleteFromDocStore):Promise<void>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:396
refDocId
Section titled “refDocId”string
deleteFromDocStore
Section titled “deleteFromDocStore”boolean = true
Promise<void>
deleteRefDocFromStore()
Section titled “deleteRefDocFromStore()”
protecteddeleteRefDocFromStore(vectorStore,refDocId):Promise<void>
定义于:.build/typescript/packages/llamaindex/src/indices/vectorStore/index.ts:408
vectorStore
Section titled “vectorStore”BaseVectorStore
refDocId
Section titled “refDocId”string
Promise<void>