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>

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

PromptMixin._getPromptModules

Defined in

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


_getPrompts()

protected _getPrompts(): PromptsRecord

Returns

PromptsRecord

Overrides

PromptMixin._getPrompts

Defined in

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


_updatePrompts()

protected _updatePrompts(): void

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

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


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Inherited from

PromptMixin.getPrompts

Defined in

packages/core/dist/prompts/index.d.ts:58


query()

query(query, stream)

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

Parameters

query: QueryType

stream: true

Returns

Promise<AsyncIterable<EngineResponse, any, any>>

Implementation of

BaseQueryEngine.query

Defined in

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

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:83


updatePrompts()

updatePrompts(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:59


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

packages/core/dist/prompts/index.d.ts:57


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:59