Class: SubQuestionQueryEngine
SubQuestionQueryEngine decomposes a question into subquestions and then
Hierarchy
-
↳
SubQuestionQueryEngine
Implements
BaseQueryEngine
Constructors
constructor
• new SubQuestionQueryEngine(init
): SubQuestionQueryEngine
Parameters
Name | Type |
---|---|
init | Object |
init.queryEngineTools | BaseTool [] |
init.questionGen | BaseQuestionGenerator |
init.responseSynthesizer | BaseSynthesizer |
Returns
Overrides
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:39
Properties
metadatas
• metadatas: ToolMetadata
[]
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:37
queryEngines
• queryEngines: BaseTool
[]
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:36
questionGen
• questionGen: BaseQuestionGenerator
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:35
responseSynthesizer
• responseSynthesizer: BaseSynthesizer
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:34
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Overrides
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:53
_getPrompts
▸ _getPrompts(): PromptsDict
Returns
PromptsDict
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:78
_updatePrompts
▸ _updatePrompts(promptsDict
): void
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:86
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
query
▸ query(params
): Promise
<AsyncIterable
<Response
>>
Parameters
Name | Type |
---|---|
params | QueryEngineParamsStreaming |
Returns
Promise
<AsyncIterable
<Response
>>
Implementation of
BaseQueryEngine.query
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:84
▸ query(params
): Promise
<Response
>
Parameters
Name | Type |
---|---|
params | QueryEngineParamsNonStreaming |
Returns
Promise
<Response
>
Implementation of
BaseQueryEngine.query
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:85
querySubQ
▸ querySubQ(subQ
, parentEvent?
): Promise
<null
| NodeWithScore
<Metadata
>>
Parameters
Name | Type |
---|---|
subQ | SubQuestion |
parentEvent? | Event |
Returns
Promise
<null
| NodeWithScore
<Metadata
>>
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:129
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
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:10
fromDefaults
▸ fromDefaults(init
): SubQuestionQueryEngine
Parameters
Name | Type |
---|---|
init | Object |
init.queryEngineTools | BaseTool [] |
init.questionGen? | BaseQuestionGenerator |
init.responseSynthesizer? | BaseSynthesizer |
init.serviceContext? | ServiceContext |
Returns
Defined in
packages/core/src/engines/query/SubQuestionQueryEngine.ts:60