Ga naar hoofdinhoud

Class: LLMQuestionGenerator

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

Hierarchy

Implements

  • BaseQuestionGenerator

Constructors

constructor

new LLMQuestionGenerator(init?): LLMQuestionGenerator

Parameters

NameType
init?Partial<LLMQuestionGenerator>

Returns

LLMQuestionGenerator

Overrides

PromptMixin.constructor

Defined in

packages/core/src/QuestionGenerator.ts:28

Properties

llm

llm: LLM

Defined in

packages/core/src/QuestionGenerator.ts:24


outputParser

outputParser: BaseOutputParser<StructuredOutput<SubQuestion[]>>

Defined in

packages/core/src/QuestionGenerator.ts:26


prompt

prompt: (__namedParameters: { queryStr: undefined | string = ""; toolsStr: undefined | string = "" }) => string

Type declaration

▸ («destructured»): string

Parameters
NameTypeDefault value
«destructured»Objectundefined
› queryStrundefined | string""
› toolsStrundefined | string""
Returns

string

Defined in

packages/core/src/QuestionGenerator.ts:25

Methods

_getPromptModules

_getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin._getPromptModules

Defined in

packages/core/src/prompts/Mixin.ts:82


_getPrompts

_getPrompts(): Object

Returns

Object

Overrides

PromptMixin._getPrompts

Defined in

packages/core/src/QuestionGenerator.ts:36


_updatePrompts

_updatePrompts(promptsDict): void

Parameters

NameType
promptsDictObject
promptsDict.subQuestion(__namedParameters: { queryStr: undefined | string = ""; toolsStr: undefined | string = "" }) => string

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

packages/core/src/QuestionGenerator.ts:42


generate

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

Parameters

NameType
toolsToolMetadata[]
querystring

Returns

Promise<SubQuestion[]>

Implementation of

BaseQuestionGenerator.generate

Defined in

packages/core/src/QuestionGenerator.ts:50


getPrompts

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin.getPrompts

Defined in

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


updatePrompts

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

NameType
promptsDictPromptsDict

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

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


validatePrompts

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

NameType
promptsDictPromptsDict
moduleDictModuleDict

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

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