Class: RouterQueryEngine
A query engine that uses multiple query engines and selects the best one.
Hierarchy
-
↳
RouterQueryEngine
Implements
BaseQueryEngine
Constructors
constructor
• new RouterQueryEngine(init
): RouterQueryEngine
Parameters
Name | Type |
---|---|
init | Object |
init.queryEngineTools | RouterQueryEngineTool [] |
init.selector | BaseSelector |
init.serviceContext? | ServiceContext |
init.summarizer? | TreeSummarize |
init.verbose? | boolean |
Returns
Overrides
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:67
Properties
metadatas
• Private
metadatas: RouterQueryEngineMetadata
[]
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:63
queryEngines
• Private
queryEngines: BaseQueryEngine
[]
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:62
selector
• Private
selector: BaseSelector
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:61
serviceContext
• serviceContext: ServiceContext
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:59
summarizer
• Private
summarizer: TreeSummarize
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:64
verbose
• Private
verbose: boolean
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:65
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Overrides
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:86
_getPrompts
▸ _getPrompts(): PromptsDict
Returns
PromptsDict
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:78
_updatePrompts
▸ _updatePrompts(promptsDict
): void
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:86
getPrompts
▸ getPrompts(): PromptsDict
Returns all prompts from the mixin and its modules
Returns
PromptsDict
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:27
query
▸ query(params
): Promise
<AsyncIterable
<Response
>>
Parameters
Name | Type |
---|---|
params | QueryEngineParamsStreaming |
Returns
Promise
<AsyncIterable
<Response
>>
Implementation of
BaseQueryEngine.query
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:113
▸ query(params
): Promise
<Response
>
Parameters
Name | Type |
---|---|
params | QueryEngineParamsNonStreaming |
Returns
Promise
<Response
>
Implementation of
BaseQueryEngine.query
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:114
queryRoute
▸ queryRoute(queryBundle
): Promise
<Response
>
Parameters
Name | Type |
---|---|
queryBundle | QueryBundle |
Returns
Promise
<Response
>
Defined in
packages/core/src/engines/query/RouterQueryEngine.ts:129
updatePrompts
▸ updatePrompts(promptsDict
): void
Updates the prompts in the mixin and its modules
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:48
validatePrompts
▸ validatePrompts(promptsDict
, moduleDict
): void
Validates the prompt keys and module keys
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
moduleDict | ModuleDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:10
fromDefaults
▸ fromDefaults(init
): RouterQueryEngine
Parameters
Name | Type |
---|---|
init | Object |
init.queryEngineTools | RouterQueryEngineTool [] |
init.selector? | BaseSelector |
init.serviceContext? | ServiceContext |
init.summarizer? | TreeSummarize |
init.verbose? | boolean |