Ana içeriğe geç

Class: RetrieverQueryEngine<Filters>

A query engine that uses a retriever to query an index and then synthesizes the response.

Type parameters

NameType
Filtersunknown

Hierarchy

Implements

Constructors

constructor

new RetrieverQueryEngine<Filters>(retriever, responseSynthesizer?, preFilters?, nodePostprocessors?): RetrieverQueryEngine<Filters>

Type parameters

NameType
Filtersunknown

Parameters

NameTypeDefault value
retrieverBaseRetriever<Filters>undefined
responseSynthesizerBaseSynthesizerundefined
preFilters?Filtersundefined
nodePostprocessorsBaseNodePostprocessor[][]

Returns

RetrieverQueryEngine<Filters>

Overrides

PromptMixin.constructor

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:25

Properties

nodePostprocessors

nodePostprocessors: BaseNodePostprocessor[] = []

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:31


preFilters

Optional preFilters: Filters

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:30


responseSynthesizer

responseSynthesizer: BaseSynthesizer

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:27


retriever

retriever: BaseRetriever<Filters>

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:26

Methods

_getPromptModules

_getPromptModules(): Object

Returns

Object

NameType
responseSynthesizerBaseSynthesizer

Overrides

PromptMixin._getPromptModules

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:36


_getPrompts

_getPrompts(): PromptsDict

Returns

PromptsDict

Inherited from

PromptMixin._getPrompts

Defined in

packages/core/src/prompts/Mixin.ts:79


_updatePrompts

_updatePrompts(promptsDict): void

Parameters

NameType
promptsDictPromptsDict

Returns

void

Inherited from

PromptMixin._updatePrompts

Defined in

packages/core/src/prompts/Mixin.ts:87


applyNodePostprocessors

applyNodePostprocessors(nodes, query): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
nodesNodeWithScore<Metadata>[]
queryMessageContent | QueryBundle

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:42


getPrompts

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin.getPrompts

Defined in

packages/core/src/prompts/Mixin.ts:27


query

query(params): Promise<AsyncIterable<Response>>

Query the query engine and get a response.

Parameters

NameType
paramsQueryEngineParamsStreaming

Returns

Promise<AsyncIterable<Response>>

Implementation of

BaseQueryEngine.query

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:67

query(params): Promise<Response>

Parameters

NameType
paramsQueryEngineParamsNonStreaming

Returns

Promise<Response>

Implementation of

BaseQueryEngine.query

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:68


retrieve

retrieve(query): Promise<NodeWithScore<Metadata>[]>

Parameters

NameType
queryQueryBundle

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/engines/query/RetrieverQueryEngine.ts:58


updatePrompts

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

NameType
promptsDictPromptsDict

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

packages/core/src/prompts/Mixin.ts:48


validatePrompts

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

NameType
promptsDictPromptsDict
moduleDictModuleDict

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

packages/core/src/prompts/Mixin.ts:10