Skip to main content

Class: SubQuestionQueryEngine

SubQuestionQueryEngine decomposes a question into subquestions and then

Implements

Constructors

constructor

new SubQuestionQueryEngine(init)

Parameters

NameType
initObject
init.queryEngineToolsQueryEngineTool[]
init.questionGenBaseQuestionGenerator
init.responseSynthesizerResponseSynthesizer

Defined in

packages/core/src/QueryEngine.ts:89

Properties

metadatas

metadatas: ToolMetadata[]

Defined in

packages/core/src/QueryEngine.ts:87


queryEngines

queryEngines: Record<string, BaseQueryEngine>

Defined in

packages/core/src/QueryEngine.ts:86


questionGen

questionGen: BaseQuestionGenerator

Defined in

packages/core/src/QueryEngine.ts:85


responseSynthesizer

responseSynthesizer: ResponseSynthesizer

Defined in

packages/core/src/QueryEngine.ts:84

Methods

query

query(query): Promise<Response>

Query the query engine and get a response.

Parameters

NameType
querystring

Returns

Promise<Response>

Implementation of

BaseQueryEngine.query

Defined in

packages/core/src/QueryEngine.ts:130


querySubQ

Private querySubQ(subQ, parentEvent?): Promise<null | NodeWithScore<Metadata>>

Parameters

NameType
subQSubQuestion
parentEvent?Event

Returns

Promise<null | NodeWithScore<Metadata>>

Defined in

packages/core/src/QueryEngine.ts:158


fromDefaults

Static fromDefaults(init): SubQuestionQueryEngine

Parameters

NameType
initObject
init.queryEngineToolsQueryEngineTool[]
init.questionGen?BaseQuestionGenerator
init.responseSynthesizer?ResponseSynthesizer
init.serviceContext?ServiceContext

Returns

SubQuestionQueryEngine

Defined in

packages/core/src/QueryEngine.ts:106