Class: SubQuestionQueryEngine
SubQuestionQueryEngine decomposes a question into subquestions and then
Extends
Constructors
new SubQuestionQueryEngine()
new SubQuestionQueryEngine(
init
):SubQuestionQueryEngine
Parameters
• init
• init.queryEngineTools: BaseTool
<any
>[]
• init.questionGen: BaseQuestionGenerator
• init.responseSynthesizer: BaseSynthesizer
Returns
Overrides
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:25
Properties
metadatas
metadatas:
ToolMetadata
[]
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:23
queryEngines
queryEngines:
BaseTool
<any
>[]
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:22
questionGen
questionGen:
BaseQuestionGenerator
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:21
responseSynthesizer
responseSynthesizer:
BaseSynthesizer
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:20
Methods
_getPromptModules()
protected
_getPromptModules():Record
<string
,any
>
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
Record
<string
, any
>
Overrides
BaseQueryEngine
._getPromptModules
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:85
_getPrompts()
protected
_getPrompts():PromptsRecord
Returns
Overrides
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:78
_query()
_query(
strOrQueryBundle
,stream
?):Promise
<EngineResponse
|AsyncIterable
<EngineResponse
,any
,any
>>
Parameters
• strOrQueryBundle: QueryType
• stream?: boolean
Returns
Promise
<EngineResponse
| AsyncIterable
<EngineResponse
, any
, any
>>
Overrides
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:39
_updatePrompts()
protected
_updatePrompts():void
Returns
void
Overrides
BaseQueryEngine
._updatePrompts
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:82
getPrompts()
getPrompts():
PromptsRecord
Returns
Inherited from
Defined in
packages/core/prompts/dist/index.d.ts:66
query()
query(params)
query(
params
):Promise
<AsyncIterable
<EngineResponse
,any
,any
>>
Parameters
• params: StreamingQueryParams
Returns
Promise
<AsyncIterable
<EngineResponse
, any
, any
>>
Inherited from
Defined in
packages/core/query-engine/dist/index.d.ts:32
query(params)
query(
params
):Promise
<EngineResponse
>
Parameters
• params: NonStreamingQueryParams
Returns
Promise
<EngineResponse
>
Inherited from
Defined in
packages/core/query-engine/dist/index.d.ts:33
retrieve()
retrieve(
params
):Promise
<NodeWithScore
<Metadata
>[]>
Parameters
• params: QueryType
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Inherited from
Defined in
packages/core/query-engine/dist/index.d.ts:31
updatePrompts()
updatePrompts(
prompts
):void
Parameters
• prompts: PromptsRecord
Returns
void
Inherited from
Defined in
packages/core/prompts/dist/index.d.ts:67
validatePrompts()
validatePrompts(
promptsDict
,moduleDict
):void
Parameters
• promptsDict: PromptsRecord
• moduleDict: ModuleRecord
Returns
void
Inherited from
BaseQueryEngine
.validatePrompts
Defined in
packages/core/prompts/dist/index.d.ts:65
fromDefaults()
static
fromDefaults(init
):SubQuestionQueryEngine
Parameters
• init
• init.queryEngineTools: BaseTool
<any
>[]
• init.questionGen?: BaseQuestionGenerator
• init.responseSynthesizer?: BaseSynthesizer
• init.serviceContext?: ServiceContext
Returns
Defined in
packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:92