Skip to main content

Class: SubQuestionQueryEngine

SubQuestionQueryEngine decomposes a question into subquestions and then

Extends

Implements

  • BaseQueryEngine

Constructors

new SubQuestionQueryEngine()

new SubQuestionQueryEngine(init): SubQuestionQueryEngine

Parameters

init

init.queryEngineTools: BaseTool<any>[]

init.questionGen: BaseQuestionGenerator

init.responseSynthesizer: BaseSynthesizer

Returns

SubQuestionQueryEngine

Overrides

PromptMixin.constructor

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:32

Properties

metadatas

metadatas: ToolMetadata[]

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:30


queryEngines

queryEngines: BaseTool<any>[]

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:29


questionGen

questionGen: BaseQuestionGenerator

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:28


responseSynthesizer

responseSynthesizer: BaseSynthesizer

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:27

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Overrides

PromptMixin._getPromptModules

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:46


_getPrompts()

protected _getPrompts(): PromptsDict

Returns

PromptsDict

Inherited from

PromptMixin._getPrompts

Defined in

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


_updatePrompts()

protected _updatePrompts(promptsDict): void

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

PromptMixin._updatePrompts

Defined in

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


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


query()

query(query, stream)

query(query, stream): Promise<AsyncIterable<EngineResponse>>

Parameters

query: QueryType

stream: true

Returns

Promise<AsyncIterable<EngineResponse>>

Implementation of

BaseQueryEngine.query

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:76

query(query, stream)

query(query, stream?): Promise<EngineResponse>

Parameters

query: QueryType

stream?: false

Returns

Promise<EngineResponse>

Implementation of

BaseQueryEngine.query

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:77


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


fromDefaults()

static fromDefaults(init): SubQuestionQueryEngine

Parameters

init

init.queryEngineTools: BaseTool<any>[]

init.questionGen?: BaseQuestionGenerator

init.responseSynthesizer?: BaseSynthesizer

init.serviceContext?: ServiceContext

Returns

SubQuestionQueryEngine

Defined in

packages/llamaindex/src/engines/query/SubQuestionQueryEngine.ts:53