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
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:64
Methods
_getPromptModules()
_getPromptModules():
Record
<string
,any
>
Returns
Record
<string
, any
>
Overrides
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:82
_getPrompts()
protected
_getPrompts():PromptsDict
Returns
PromptsDict
Inherited from
Defined in
packages/llamaindex/src/prompts/Mixin.ts:79
_updatePrompts()
protected
_updatePrompts(promptsDict
):void
Parameters
• promptsDict: PromptsDict
Returns
void
Inherited from
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
Defined in
packages/llamaindex/src/prompts/Mixin.ts:27
query()
query(params)
query(
params
):Promise
<AsyncIterable
<EngineResponse
>>
Query the query engine and get a response.
Parameters
• params: QueryEngineParamsStreaming
Returns
Promise
<AsyncIterable
<EngineResponse
>>
Implementation of
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:111
query(params)
query(
params
):Promise
<EngineResponse
>
Query the query engine and get a response.
Parameters
• params: QueryEngineParamsNonStreaming
Returns
Promise
<EngineResponse
>
Implementation of
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:114
updatePrompts()
updatePrompts(
promptsDict
):void
Updates the prompts in the mixin and its modules
Parameters
• promptsDict: PromptsDict
Returns
void
Inherited from
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
Defined in
packages/llamaindex/src/prompts/Mixin.ts:10
fromDefaults()
static
fromDefaults(init
):RouterQueryEngine
Parameters
• init
• init.queryEngineTools: RouterQueryEngineTool
[]
• init.selector?: BaseSelector
• init.serviceContext?: ServiceContext
• init.summarizer?: TreeSummarize
• init.verbose?: boolean
Returns
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:89