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()
protected
_getPromptModules():object
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
object
selector
selector:
BaseSelector
summarizer
summarizer:
TreeSummarize
Overrides
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:88
_getPrompts()
protected
_getPrompts():object
Returns
object
Overrides
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:82
_updatePrompts()
protected
_updatePrompts():void
Returns
void
Overrides
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:86
getPrompts()
getPrompts():
PromptsRecord
Returns
Inherited from
Defined in
packages/core/dist/prompts/index.d.ts:58
query()
query(params)
query(
params
):Promise
<AsyncIterable
<EngineResponse
,any
,any
>>
Query the query engine and get a response.
Parameters
• params: QueryEngineParamsStreaming
Returns
Promise
<AsyncIterable
<EngineResponse
, any
, any
>>
Implementation of
Defined in
packages/llamaindex/src/engines/query/RouterQueryEngine.ts:117
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:120
updatePrompts()
updatePrompts(
prompts
):void
Parameters
• prompts: PromptsRecord
Returns
void
Inherited from
Defined in
packages/core/dist/prompts/index.d.ts:59
validatePrompts()
validatePrompts(
promptsDict
,moduleDict
):void
Parameters
• promptsDict: PromptsRecord
• moduleDict: ModuleRecord
Returns
void
Inherited from
Defined in
packages/core/dist/prompts/index.d.ts:57
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:95