Class: LLMQuestionGenerator
LLMQuestionGenerator uses the LLM to generate new questions for the LLM using tools and a user query.
Hierarchy
-
↳
LLMQuestionGenerator
Implements
BaseQuestionGenerator
Constructors
constructor
• new LLMQuestionGenerator(init?
): LLMQuestionGenerator
Parameters
Name | Type |
---|---|
init? | Partial <LLMQuestionGenerator > |
Returns
Overrides
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
Name | Type | Default value |
---|---|---|
«destructured» | Object | undefined |
› queryStr | undefined | string | "" |
› toolsStr | undefined | string | "" |
Returns
string
Defined in
packages/core/src/QuestionGenerator.ts:25
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:82
_getPrompts
▸ _getPrompts(): Object
Returns
Object
Overrides
Defined in
packages/core/src/QuestionGenerator.ts:36
_updatePrompts
▸ _updatePrompts(promptsDict
): void
Parameters
Name | Type |
---|---|
promptsDict | Object |
promptsDict.subQuestion | (__namedParameters : { queryStr : undefined | string = ""; toolsStr : undefined | string = "" }) => string |
Returns
void
Overrides
Defined in
packages/core/src/QuestionGenerator.ts:42
generate
▸ generate(tools
, query
): Promise
<SubQuestion
[]>
Parameters
Name | Type |
---|---|
tools | ToolMetadata [] |
query | string |
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
Defined in
packages/core/src/prompts/Mixin.ts:27
updatePrompts
▸ updatePrompts(promptsDict
): void
Updates the prompts in the mixin and its modules
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:48
validatePrompts
▸ validatePrompts(promptsDict
, moduleDict
): void
Validates the prompt keys and module keys
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
moduleDict | ModuleDict |
Returns
void