Skip to main content

Class: LLMQuestionGenerator

LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.

Extends

Implements

  • BaseQuestionGenerator

Constructors

new LLMQuestionGenerator()

new LLMQuestionGenerator(init?): LLMQuestionGenerator

Parameters

init?: Partial<LLMQuestionGenerator>

Returns

LLMQuestionGenerator

Overrides

PromptMixin.constructor

Defined in

packages/llamaindex/src/QuestionGenerator.ts:30

Properties

llm

llm: LLM<object, object>

Defined in

packages/llamaindex/src/QuestionGenerator.ts:26


outputParser

outputParser: BaseOutputParser<StructuredOutput<SubQuestion[]>>

Defined in

packages/llamaindex/src/QuestionGenerator.ts:28


prompt

prompt: SubQuestionPrompt

Defined in

packages/llamaindex/src/QuestionGenerator.ts:27

Methods

_getPromptModules()

protected _getPromptModules(): ModuleRecord

Return a dictionary of sub-modules within the current module that also implement PromptMixin (so that their prompts can also be get/set).

Can be blank if no sub-modules.

Returns

ModuleRecord

Overrides

PromptMixin._getPromptModules

Defined in

packages/llamaindex/src/QuestionGenerator.ts:72


_getPrompts()

protected _getPrompts(): object

Returns

object

Overrides

PromptMixin._getPrompts

Defined in

packages/llamaindex/src/QuestionGenerator.ts:38


_updatePrompts()

protected _updatePrompts(promptsDict): void

Parameters

promptsDict

promptsDict.subQuestion: SubQuestionPrompt

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

packages/llamaindex/src/QuestionGenerator.ts:44


generate()

generate(tools, query): Promise<SubQuestion[]>

Parameters

tools: ToolMetadata[]

query: QueryType

Returns

Promise<SubQuestion[]>

Implementation of

BaseQuestionGenerator.generate

Defined in

packages/llamaindex/src/QuestionGenerator.ts:52


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Inherited from

PromptMixin.getPrompts

Defined in

packages/core/prompts/dist/index.d.ts:58


updatePrompts()

updatePrompts(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

packages/core/prompts/dist/index.d.ts:59


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

packages/core/prompts/dist/index.d.ts:57