BaseIndex
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:51
Indexes are the data structure that we store our nodes and embeddings in so they can be retrieved for our queries.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”T
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BaseIndex<
T
>(init
):BaseIndex
<T
>
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:57
Parameters
Section titled “Parameters”Returns
Section titled “Returns”BaseIndex
<T
>
Properties
Section titled “Properties”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
indexStore?
Section titled “indexStore?”
optional
indexStore:BaseIndexStore
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:54
indexStruct
Section titled “indexStruct”indexStruct:
T
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:55
Methods
Section titled “Methods”asRetriever()
Section titled “asRetriever()”
abstract
asRetriever(options?
):BaseRetriever
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:69
Create a new retriever from the index.
Parameters
Section titled “Parameters”options?
Section titled “options?”any
Returns
Section titled “Returns”BaseRetriever
asQueryEngine()
Section titled “asQueryEngine()”
abstract
asQueryEngine(options?
):BaseQueryEngine
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:76
Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.
Parameters
Section titled “Parameters”options?
Section titled “options?”you can supply your own custom Retriever and ResponseSynthesizer
retriever?
Section titled “retriever?”BaseRetriever
responseSynthesizer?
Section titled “responseSynthesizer?”BaseSynthesizer
Returns
Section titled “Returns”BaseQueryEngine
asChatEngine()
Section titled “asChatEngine()”
abstract
asChatEngine(options?
):BaseChatEngine
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:85
Create a new chat engine from the index.
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit
<ContextChatEngineOptions
, "retriever"
>
Returns
Section titled “Returns”BaseChatEngine
asQueryTool()
Section titled “asQueryTool()”asQueryTool(
params
):QueryEngineTool
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:94
Returns a query tool by calling asQueryEngine. Either options or retriever can be passed, but not both. If options are provided, they are passed to generate a retriever.
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”insert()
Section titled “insert()”insert(
document
):Promise
<void
>
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:110
Insert a document into the index.
Parameters
Section titled “Parameters”document
Section titled “document”Document
Returns
Section titled “Returns”Promise
<void
>
insertNodes()
Section titled “insertNodes()”
abstract
insertNodes(nodes
):Promise
<void
>
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:116
Parameters
Section titled “Parameters”BaseNode
<Metadata
>[]
Returns
Section titled “Returns”Promise
<void
>
deleteRefDoc()
Section titled “deleteRefDoc()”
abstract
deleteRefDoc(refDocId
,deleteFromDocStore?
):Promise
<void
>
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:117
Parameters
Section titled “Parameters”refDocId
Section titled “refDocId”string
deleteFromDocStore?
Section titled “deleteFromDocStore?”boolean
Returns
Section titled “Returns”Promise
<void
>
retriever()
Section titled “retriever()”retriever(
options?
):BaseRetriever
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:127
Alias for asRetriever
Parameters
Section titled “Parameters”options?
Section titled “options?”any
Returns
Section titled “Returns”BaseRetriever
queryEngine()
Section titled “queryEngine()”queryEngine(
options?
):BaseQueryEngine
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:135
Alias for asQueryEngine
Parameters
Section titled “Parameters”options?
Section titled “options?”you can supply your own custom Retriever and ResponseSynthesizer
retriever?
Section titled “retriever?”BaseRetriever
responseSynthesizer?
Section titled “responseSynthesizer?”BaseSynthesizer
Returns
Section titled “Returns”BaseQueryEngine
queryTool()
Section titled “queryTool()”queryTool(
params
):QueryEngineTool
Defined in: .build/typescript/packages/llamaindex/src/indices/BaseIndex.ts:147
Alias for asQueryTool Either options or retriever can be passed, but not both. If options are provided, they are passed to generate a retriever.