Class: SummaryExtractor
Extract summary from a list of nodes.
Hierarchy
-
↳
SummaryExtractor
Constructors
constructor
• new SummaryExtractor(options?
): SummaryExtractor
Parameters
Name | Type |
---|---|
options? | SummaryExtractArgs |
Returns
Overrides
Defined in
packages/core/src/extractors/MetadataExtractors.ts:357
Properties
_nextSummary
• Private
_nextSummary: boolean
Defined in
packages/core/src/extractors/MetadataExtractors.ts:355
_prevSummary
• Private
_prevSummary: boolean
Defined in
packages/core/src/extractors/MetadataExtractors.ts:354
_selfSummary
• Private
_selfSummary: boolean
Defined in
packages/core/src/extractors/MetadataExtractors.ts:353
disableTemplateRewrite
• disableTemplateRewrite: boolean
= false
Inherited from
BaseExtractor.disableTemplateRewrite
Defined in
packages/core/src/extractors/types.ts:12
inPlace
• inPlace: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:13
isTextNodeOnly
• isTextNodeOnly: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:9
llm
• llm: LLM
LLM instance.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:339
metadataMode
• metadataMode: MetadataMode
= MetadataMode.ALL
Inherited from
Defined in
packages/core/src/extractors/types.ts:11
numWorkers
• numWorkers: number
= 4
Inherited from
Defined in
packages/core/src/extractors/types.ts:14
promptTemplate
• promptTemplate: string
The prompt template to use for the summary extractor.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:351
showProgress
• showProgress: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:10
summaries
• summaries: string
[]
List of summaries to extract: 'self', 'prev', 'next'
Defined in
packages/core/src/extractors/MetadataExtractors.ts:345
Methods
extract
▸ extract(nodes
): Promise
<{}[] | ExtractSummary
[]>
Extract summaries from a list of nodes.
Parameters
Name | Type | Description |
---|---|---|
nodes | BaseNode <Metadata >[] | Nodes to extract summaries from. |
Returns
Promise
<{}[] | ExtractSummary
[]>
Summaries extracted from the nodes.
Overrides
Defined in
packages/core/src/extractors/MetadataExtractors.ts:406
generateNodeSummary
▸ generateNodeSummary(node
): Promise
<string
>
Extract summary from a node.
Parameters
Name | Type | Description |
---|---|---|
node | BaseNode <Metadata > | Node to extract summary from. |
Returns
Promise
<string
>
Summary extracted from the node.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:383
processNodes
▸ processNodes(nodes
, excludedEmbedMetadataKeys?
, excludedLlmMetadataKeys?
): Promise
<BaseNode
<Metadata
>[]>
Parameters
Name | Type | Default value | Description |
---|---|---|---|
nodes | BaseNode <Metadata >[] | undefined | 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
Metadata extracted from the nodes.
Inherited from
Defined in
packages/core/src/extractors/types.ts:33
transform
▸ transform(nodes
, options?
): Promise
<BaseNode
<Metadata
>[]>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
options? | any |