Class: RouterQueryEngine
A query engine that uses multiple query engines and selects the best one.
Extends
Implements
Constructors
new RouterQueryEngine()
new RouterQueryEngine(
init
):RouterQueryEngine
Parameters
• init
• init.queryEngineTools: RouterQueryEngineTool
[]
• init.selector: BaseSelector
• init.serviceContext?: ServiceContext
• init.summarizer?: TreeSummarize
• init.verbose?: boolean
Returns
Overrides
Source
packages/core/src/engines/query/RouterQueryEngine.ts:64
Properties
metadatas
private
metadatas:RouterQueryEngineMetadata
[]
Source
packages/core/src/engines/query/RouterQueryEngine.ts:60
queryEngines
private
queryEngines:QueryEngine
[]
Source
packages/core/src/engines/query/RouterQueryEngine.ts:59
selector
private
selector:BaseSelector
Source
packages/core/src/engines/query/RouterQueryEngine.ts:58
summarizer
private
summarizer:TreeSummarize
Source
packages/core/src/engines/query/RouterQueryEngine.ts:61
verbose
private
verbose:boolean
Source
packages/core/src/engines/query/RouterQueryEngine.ts:62
Methods
_getPromptModules()
_getPromptModules():
Record
<string
,any
>
Returns
Record
<string
, any
>
Overrides
PromptMixin
. _getPromptModules
Source
packages/core/src/engines/query/RouterQueryEngine.ts:82
_getPrompts()
protected
_getPrompts():PromptsDict
Returns
PromptsDict
Inherited from
Source
packages/core/src/prompts/Mixin.ts:78
_updatePrompts()
protected
_updatePrompts(promptsDict
):void
Parameters
• promptsDict: PromptsDict
Returns
void
Inherited from
Source
packages/core/src/prompts/Mixin.ts:86
getPrompts()
getPrompts():
PromptsDict
Returns all prompts from the mixin and its modules
Returns
PromptsDict
Inherited from
Source
packages/core/src/prompts/Mixin.ts:27
query()
query(params)
query(
params
):Promise
<AsyncIterable
<Response
>>
Query the query engine and get a response.
Parameters
• params: QueryEngineParamsStreaming
Returns
Promise
<AsyncIterable
<Response
>>
Implementation of
Source
packages/core/src/engines/query/RouterQueryEngine.ts:111
query(params)
query(
params
):Promise
<Response
>
Parameters
• params: QueryEngineParamsNonStreaming
Returns
Promise
<Response
>
Implementation of
Source
packages/core/src/engines/query/RouterQueryEngine.ts:112