Class: RetrieverQueryEngine
A query engine that uses a retriever to query an index and then synthesizes the response.
Hierarchy
-
↳
RetrieverQueryEngine
Implements
Constructors
constructor
• new RetrieverQueryEngine(retriever
, responseSynthesizer?
, preFilters?
, nodePostprocessors?
): RetrieverQueryEngine
Parameters
Name | Type |
---|---|
retriever | BaseRetriever |
responseSynthesizer? | BaseSynthesizer |
preFilters? | unknown |
nodePostprocessors? | BaseNodePostprocessor [] |
Returns
Overrides
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:27
Properties
nodePostprocessors
• nodePostprocessors: BaseNodePostprocessor
[]
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:24
preFilters
• Optional
preFilters: unknown
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:25
responseSynthesizer
• responseSynthesizer: BaseSynthesizer
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:23
retriever
• retriever: BaseRetriever
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:22
Methods
_getPromptModules
▸ _getPromptModules(): Object
Returns
Object
Name | Type |
---|---|
responseSynthesizer | BaseSynthesizer |
Overrides
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:45
_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
applyNodePostprocessors
▸ applyNodePostprocessors(nodes
, query
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
nodes | NodeWithScore <Metadata >[] |
query | string |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:51
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
>>
Query the query engine and get a response.
Parameters
Name | Type |
---|---|
params | QueryEngineParamsStreaming |
Returns
Promise
<AsyncIterable
<Response
>>
Implementation of
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:73
▸ query(params
): Promise
<Response
>
Parameters
Name | Type |
---|---|
params | QueryEngineParamsNonStreaming |
Returns
Promise
<Response
>
Implementation of
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:74
retrieve
▸ retrieve(query
): Promise
<NodeWithScore
<Metadata
>[]>
Parameters
Name | Type |
---|---|
query | string |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Defined in
packages/core/src/engines/query/RetrieverQueryEngine.ts:64
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