Class: QuestionsAnsweredExtractor
Extract questions from a list of nodes.
Hierarchy
-
↳
QuestionsAnsweredExtractor
Constructors
constructor
• new QuestionsAnsweredExtractor(options?
): QuestionsAnsweredExtractor
Constructor for the QuestionsAnsweredExtractor class.
Parameters
Name | Type |
---|---|
options? | QuestionAnswerExtractArgs |
Returns
Overrides
Defined in
packages/core/src/extractors/MetadataExtractors.ts:295
Properties
disableTemplateRewrite
• disableTemplateRewrite: boolean
= false
Inherited from
BaseExtractor.disableTemplateRewrite
Defined in
packages/core/src/extractors/types.ts:13
embeddingOnly
• embeddingOnly: boolean
= false
Wheter to use metadata for embeddings only
Default
false
Defined in
packages/core/src/extractors/MetadataExtractors.ts:286
inPlace
• inPlace: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:14
isTextNodeOnly
• isTextNodeOnly: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:10
llm
• llm: LLM
<object
, object
>
LLM instance.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:266
metadataMode
• metadataMode: MetadataMode
= MetadataMode.ALL
Inherited from
Defined in
packages/core/src/extractors/types.ts:12
numWorkers
• numWorkers: number
= 4
Inherited from
Defined in
packages/core/src/extractors/types.ts:15
promptTemplate
• promptTemplate: string
The prompt template to use for the question extractor.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:279
questions
• questions: number
= 5
Number of questions to generate.
Default
5
Defined in
packages/core/src/extractors/MetadataExtractors.ts:273
showProgress
• showProgress: boolean
= true
Inherited from
Defined in
packages/core/src/extractors/types.ts:11
Methods
extract
▸ extract(nodes
): Promise
<{}[] | ExtractQuestion
[]>
Extract answered questions from a list of nodes.
Parameters
Name | Type | Description |
---|---|---|
nodes | BaseNode <Metadata >[] | Nodes to extract questions from. |
Returns
Promise
<{}[] | ExtractQuestion
[]>
Questions extracted from the nodes.
Overrides
Defined in
packages/core/src/extractors/MetadataExtractors.ts:345
extractQuestionsFromNode
▸ extractQuestionsFromNode(node
): Promise
<{} | ExtractQuestion
>
Extract answered questions from a node.
Parameters
Name | Type | Description |
---|---|---|
node | BaseNode <Metadata > | Node to extract questions from. |
Returns
Promise
<{} | ExtractQuestion
>
Questions extracted from the node.
Defined in
packages/core/src/extractors/MetadataExtractors.ts:317
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:34
transform
▸ transform(nodes
, options?
): Promise
<BaseNode
<Metadata
>[]>
Parameters
Name | Type |
---|---|
nodes | BaseNode <Metadata >[] |
options? | any |