Pular para o conteúdo principal

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

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?): 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

NameTypeDescription
options?Objectyou 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

BaseIndex.asQueryEngine

Defined in

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


asRetriever

asRetriever(options?): BaseRetriever<unknown>

Create a new retriever from the index.

Parameters

NameType
options?Object
options.modeSummaryRetrieverMode

Returns

BaseRetriever<unknown>

Overrides

BaseIndex.asRetriever

Defined in

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


deleteNodes

deleteNodes(nodeIds, deleteFromDocStore): Promise<void>

Parameters

NameType
nodeIdsstring[]
deleteFromDocStoreboolean

Returns

Promise<void>

Defined in

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


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

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


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


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


init

init(options): Promise<SummaryIndex>

Parameters

NameType
optionsSummaryIndexOptions

Returns

Promise<SummaryIndex>

Defined in

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