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

Properties

llm

llm: LLM<object, object>

Defined in

packages/llamaindex/src/QuestionGenerator.ts:22


outputParser

outputParser: BaseOutputParser<StructuredOutput<SubQuestion[]>>

Defined in

packages/llamaindex/src/QuestionGenerator.ts:24


prompt()

prompt: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.queryStr: undefined | string = ""

__namedParameters.toolsStr: undefined | string = ""

Returns

string

Defined in

packages/llamaindex/src/QuestionGenerator.ts:23

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin._getPromptModules

Defined in

packages/llamaindex/src/prompts/Mixin.ts:83


_getPrompts()

protected _getPrompts(): object

Returns

object

Overrides

PromptMixin._getPrompts

Defined in

packages/llamaindex/src/QuestionGenerator.ts:34


_updatePrompts()

protected _updatePrompts(promptsDict): void

Parameters

promptsDict

promptsDict.subQuestion

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

packages/llamaindex/src/QuestionGenerator.ts:40


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


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin.getPrompts

Defined in

packages/llamaindex/src/prompts/Mixin.ts:27


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

packages/llamaindex/src/prompts/Mixin.ts:48


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

promptsDict: PromptsDict

moduleDict: ModuleDict

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

packages/llamaindex/src/prompts/Mixin.ts:10