Class: SummaryIndex
A SummaryIndex keeps nodes in a sequential order for use with summarization.
Hierarchy
Constructors
constructor
• new SummaryIndex(init
): SummaryIndex
Parameters
Name | Type |
---|---|
init | BaseIndexInit <IndexList > |
Returns
Overrides
Defined in
packages/core/src/indices/summary/index.ts:59
Properties
docStore
• docStore: BaseDocumentStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:62
indexStore
• Optional
indexStore: BaseIndexStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:64
indexStruct
• indexStruct: IndexList
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:65
serviceContext
• Optional
serviceContext: ServiceContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:60
storageContext
• storageContext: StorageContext
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:61
vectorStore
• Optional
vectorStore: VectorStore
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:63
Methods
asQueryEngine
▸ asQueryEngine(options?
): BaseQueryEngine
& RetrieverQueryEngine
<unknown
>
Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.
Parameters
Name | Type | Description |
---|---|---|
options? | Object | you can supply your own custom Retriever and ResponseSynthesizer |
options.nodePostprocessors? | BaseNodePostprocessor [] | - |
options.preFilters? | unknown | - |
options.responseSynthesizer? | BaseSynthesizer | - |
options.retriever? | BaseRetriever <unknown > | - |
Returns
BaseQueryEngine
& RetrieverQueryEngine
<unknown
>
Overrides
Defined in
packages/core/src/indices/summary/index.ts:171
asRetriever
▸ asRetriever(options?
): BaseRetriever
<unknown
>
Create a new retriever from the index.
Parameters
Name | Type |
---|---|
options? | Object |
options.mode | SummaryRetrieverMode |
Returns
BaseRetriever
<unknown
>
Overrides
Defined in
packages/core/src/indices/summary/index.ts:158
deleteNodes
▸ deleteNodes(nodeIds
, deleteFromDocStore
): Promise
<void
>
Parameters
Name | Type |
---|---|
nodeIds | string [] |
deleteFromDocStore | boolean |
Returns
Promise
<void
>
Defined in
packages/core/src/indices/summary/index.ts:239
deleteRefDoc
▸ deleteRefDoc(refDocId
, deleteFromDocStore?
): Promise
<void
>
Parameters
Name | Type |
---|---|
refDocId | string |
deleteFromDocStore? | boolean |
Returns
Promise
<void
>
Overrides
Defined in
packages/core/src/indices/summary/index.ts:220
getRefDocInfo
▸ getRefDocInfo(): Promise
<Record
<string
, RefDocInfo
>>
Returns
Promise
<Record
<string
, RefDocInfo
>>
Defined in
packages/core/src/indices/summary/index.ts:253
insert
▸ insert(document
): Promise
<void
>
Insert a document into the index.
Parameters
Name | Type |
---|---|
document | Document <Metadata > |
Returns
Promise
<void
>
Inherited from
Defined in
packages/core/src/indices/BaseIndex.ts:96
insertNodes
▸ insertNodes(nodes
): Promise
<void
>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
Returns
Promise
<void
>
Overrides
Defined in
packages/core/src/indices/summary/index.ts:214
buildIndexFromNodes
▸ buildIndexFromNodes(nodes
, docStore
, indexStruct?
): Promise
<IndexList
>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
docStore | BaseDocumentStore |
indexStruct? | IndexList |
Returns
Promise
<IndexList
>
Defined in
packages/core/src/indices/summary/index.ts:199
fromDocuments
▸ fromDocuments(documents
, args?
): Promise
<SummaryIndex
>
Parameters
Name | Type |
---|---|
documents | Document <Metadata >[] |
args | Object |
args.serviceContext? | ServiceContext |
args.storageContext? | StorageContext |
Returns
Promise
<SummaryIndex
>
Defined in
packages/core/src/indices/summary/index.ts:128
init
▸ init(options
): Promise
<SummaryIndex
>
Parameters
Name | Type |
---|---|
options | SummaryIndexOptions |
Returns
Promise
<SummaryIndex
>