Skip to main content

Class: SummaryExtractor()

Extract summary from a list of nodes.

Extends

SummaryExtractor<Options>(nodes, options?): Promise<BaseNode<Metadata>[]>

Extract summary from a list of nodes.

Type Parameters

Options extends Record<string, unknown>

Parameters

nodes: BaseNode<Metadata>[]

options?: Options

Returns

Promise<BaseNode<Metadata>[]>

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:371

Constructors

new SummaryExtractor()

new SummaryExtractor(options?): SummaryExtractor

Parameters

options?: SummaryExtractArgs

Returns

SummaryExtractor

Overrides

BaseExtractor.constructor

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:394

Properties

disableTemplateRewrite

disableTemplateRewrite: boolean = false

Inherited from

BaseExtractor.disableTemplateRewrite

Defined in

packages/llamaindex/src/extractors/types.ts:16


id

id: string

Inherited from

BaseExtractor.id

Defined in

packages/core/dist/schema/index.d.ts:171


inPlace

inPlace: boolean = true

Inherited from

BaseExtractor.inPlace

Defined in

packages/llamaindex/src/extractors/types.ts:17


isTextNodeOnly

isTextNodeOnly: boolean = true

Inherited from

BaseExtractor.isTextNodeOnly

Defined in

packages/llamaindex/src/extractors/types.ts:13


llm

llm: LLM<object, object>

LLM instance.

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:376


metadataMode

metadataMode: MetadataMode = MetadataMode.ALL

Inherited from

BaseExtractor.metadataMode

Defined in

packages/llamaindex/src/extractors/types.ts:15


numWorkers

numWorkers: number = 4

Inherited from

BaseExtractor.numWorkers

Defined in

packages/llamaindex/src/extractors/types.ts:18


promptTemplate

promptTemplate: string

The prompt template to use for the summary extractor.

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:388


showProgress

showProgress: boolean = true

Inherited from

BaseExtractor.showProgress

Defined in

packages/llamaindex/src/extractors/types.ts:14


summaries

summaries: string[]

List of summaries to extract: 'self', 'prev', 'next'

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:382

Methods

extract()

extract(nodes): Promise<object[] | ExtractSummary[]>

Extract summaries from a list of nodes.

Parameters

nodes: BaseNode<Metadata>[]

Nodes to extract summaries from.

Returns

Promise<object[] | ExtractSummary[]>

Summaries extracted from the nodes.

Overrides

BaseExtractor.extract

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:443


generateNodeSummary()

generateNodeSummary(node): Promise<string>

Extract summary from a node.

Parameters

node: BaseNode<Metadata>

Node to extract summary from.

Returns

Promise<string>

Summary extracted from the node.

Defined in

packages/llamaindex/src/extractors/MetadataExtractors.ts:420


processNodes()

processNodes(nodes, excludedEmbedMetadataKeys, excludedLlmMetadataKeys): Promise<BaseNode<Metadata>[]>

Parameters

nodes: BaseNode<Metadata>[]

Nodes to extract metadata from.

excludedEmbedMetadataKeys: undefined | string[] = undefined

Metadata keys to exclude from the embedding.

excludedLlmMetadataKeys: undefined | string[] = undefined

Metadata keys to exclude from the LLM.

Returns

Promise<BaseNode<Metadata>[]>

Metadata extracted from the nodes.

Inherited from

BaseExtractor.processNodes

Defined in

packages/llamaindex/src/extractors/types.ts:39