Nhảy tới nội dung

Class: SummaryIndex

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

Hierarchy

Constructors

constructor

new SummaryIndex(init): SummaryIndex

Parameters

NameType
initBaseIndexInit<IndexList>

Returns

SummaryIndex

Overrides

BaseIndex.constructor

Defined in

packages/core/src/indices/summary/index.ts:57

Properties

docStore

docStore: BaseDocumentStore

Inherited from

BaseIndex.docStore

Defined in

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


indexStore

Optional indexStore: BaseIndexStore

Inherited from

BaseIndex.indexStore

Defined in

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


indexStruct

indexStruct: IndexList

Inherited from

BaseIndex.indexStruct

Defined in

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


serviceContext

Optional serviceContext: ServiceContext

Inherited from

BaseIndex.serviceContext

Defined in

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


storageContext

storageContext: StorageContext

Inherited from

BaseIndex.storageContext

Defined in

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


vectorStore

Optional vectorStore: VectorStore

Inherited from

BaseIndex.vectorStore

Defined in

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

Methods

asQueryEngine

asQueryEngine(options?): QueryEngine & RetrieverQueryEngine

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?BaseSynthesizer-
options.retriever?BaseRetriever-

Returns

QueryEngine & RetrieverQueryEngine

Overrides

BaseIndex.asQueryEngine

Defined in

packages/core/src/indices/summary/index.ts:169


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/index.ts:156


deleteNodes

deleteNodes(nodeIds, deleteFromDocStore): Promise<void>

Parameters

NameType
nodeIdsstring[]
deleteFromDocStoreboolean

Returns

Promise<void>

Defined in

packages/core/src/indices/summary/index.ts:237


deleteRefDoc

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

Parameters

NameType
refDocIdstring
deleteFromDocStore?boolean

Returns

Promise<void>

Overrides

BaseIndex.deleteRefDoc

Defined in

packages/core/src/indices/summary/index.ts:218


getRefDocInfo

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

Returns

Promise<Record<string, RefDocInfo>>

Defined in

packages/core/src/indices/summary/index.ts:251


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:96


insertNodes

insertNodes(nodes): Promise<void>

Parameters

NameType
nodesBaseNode<Metadata>[]

Returns

Promise<void>

Overrides

BaseIndex.insertNodes

Defined in

packages/core/src/indices/summary/index.ts:212


buildIndexFromNodes

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

Parameters

NameType
nodesBaseNode<Metadata>[]
docStoreBaseDocumentStore
indexStruct?IndexList

Returns

Promise<IndexList>

Defined in

packages/core/src/indices/summary/index.ts:197


fromDocuments

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/index.ts:126


init

init(options): Promise<SummaryIndex>

Parameters

NameType
optionsSummaryIndexOptions

Returns

Promise<SummaryIndex>

Defined in

packages/core/src/indices/summary/index.ts:61