跳到主要内容

Class: SummaryIndex

A SummaryIndex keeps nodes in a sequential order for use with summarization.

Hierarchy

Constructors

constructor

new SummaryIndex(init)

Parameters

NameType
initBaseIndexInit<IndexList>

Overrides

BaseIndex.constructor

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:48

Properties

docStore

docStore: BaseDocumentStore

Inherited from

BaseIndex.docStore

Defined in

packages/core/src/indices/BaseIndex.ts:156


indexStore

Optional indexStore: BaseIndexStore

Inherited from

BaseIndex.indexStore

Defined in

packages/core/src/indices/BaseIndex.ts:158


indexStruct

indexStruct: IndexList

Inherited from

BaseIndex.indexStruct

Defined in

packages/core/src/indices/BaseIndex.ts:159


serviceContext

serviceContext: ServiceContext

Inherited from

BaseIndex.serviceContext

Defined in

packages/core/src/indices/BaseIndex.ts:154


storageContext

storageContext: StorageContext

Inherited from

BaseIndex.storageContext

Defined in

packages/core/src/indices/BaseIndex.ts:155


vectorStore

Optional vectorStore: VectorStore

Inherited from

BaseIndex.vectorStore

Defined in

packages/core/src/indices/BaseIndex.ts:157

Methods

asQueryEngine

asQueryEngine(options?): BaseQueryEngine

Create a new query engine from the index. It will also create a retriever and response synthezier if they are not provided.

Parameters

NameTypeDescription
options?Objectyou can supply your own custom Retriever and ResponseSynthesizer
options.nodePostprocessors?BaseNodePostprocessor[]-
options.preFilters?unknown-
options.responseSynthesizer?ResponseSynthesizer-
options.retriever?BaseRetriever-

Returns

BaseQueryEngine

Overrides

BaseIndex.asQueryEngine

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:156


asRetriever

asRetriever(options?): BaseRetriever

Create a new retriever from the index.

Parameters

NameType
options?Object
options.modeSummaryRetrieverMode

Returns

BaseRetriever

Overrides

BaseIndex.asRetriever

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:143


deleteNodes

deleteNodes(nodeIds, deleteFromDocStore): Promise<void>

Parameters

NameType
nodeIdsstring[]
deleteFromDocStoreboolean

Returns

Promise<void>

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:224


deleteRefDoc

deleteRefDoc(refDocId, deleteFromDocStore?): Promise<void>

Parameters

NameType
refDocIdstring
deleteFromDocStore?boolean

Returns

Promise<void>

Overrides

BaseIndex.deleteRefDoc

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:205


getRefDocInfo

getRefDocInfo(): Promise<Record<string, RefDocInfo>>

Returns

Promise<Record<string, RefDocInfo>>

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:238


insert

insert(document): Promise<void>

Insert a document into the index.

Parameters

NameType
documentDocument<Metadata>

Returns

Promise<void>

Inherited from

BaseIndex.insert

Defined in

packages/core/src/indices/BaseIndex.ts:190


insertNodes

insertNodes(nodes): Promise<void>

Parameters

NameType
nodesBaseNode<Metadata>[]

Returns

Promise<void>

Overrides

BaseIndex.insertNodes

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:199


buildIndexFromNodes

Static buildIndexFromNodes(nodes, docStore, indexStruct?): Promise<IndexList>

Parameters

NameType
nodesBaseNode<Metadata>[]
docStoreBaseDocumentStore
indexStruct?IndexList

Returns

Promise<IndexList>

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:184


fromDocuments

Static fromDocuments(documents, args?): Promise<SummaryIndex>

Parameters

NameType
documentsDocument<Metadata>[]
argsObject
args.serviceContext?ServiceContext
args.storageContext?StorageContext

Returns

Promise<SummaryIndex>

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:117


init

Static init(options): Promise<SummaryIndex>

Parameters

NameType
optionsSummaryIndexOptions

Returns

Promise<SummaryIndex>

Defined in

packages/core/src/indices/summary/SummaryIndex.ts:52