본문으로 건너뛰기

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

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

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

BaseQueryEngine & RetrieverQueryEngine

Overrides

BaseIndex.asQueryEngine

Defined in

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


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


deleteNodes

deleteNodes(nodeIds, deleteFromDocStore): Promise<void>

Parameters

NameType
nodeIdsstring[]
deleteFromDocStoreboolean

Returns

Promise<void>

Defined in

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


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


getRefDocInfo

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

Returns

Promise<Record<string, RefDocInfo>>

Defined in

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


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


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


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


init

init(options): Promise<SummaryIndex>

Parameters

NameType
optionsSummaryIndexOptions

Returns

Promise<SummaryIndex>

Defined in

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