Saltar al contenido principal

Class: RetrieverQueryEngine

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

Implements

Constructors

constructor

new RetrieverQueryEngine(retriever, responseSynthesizer?, preFilters?, nodePostprocessors?)

Parameters

NameType
retrieverBaseRetriever
responseSynthesizer?BaseSynthesizer
preFilters?unknown
nodePostprocessors?BaseNodePostprocessor[]

Defined in

packages/core/src/QueryEngine.ts:57

Properties

nodePostprocessors

nodePostprocessors: BaseNodePostprocessor[]

Defined in

packages/core/src/QueryEngine.ts:54


preFilters

Optional preFilters: unknown

Defined in

packages/core/src/QueryEngine.ts:55


responseSynthesizer

responseSynthesizer: BaseSynthesizer

Defined in

packages/core/src/QueryEngine.ts:53


retriever

retriever: BaseRetriever

Defined in

packages/core/src/QueryEngine.ts:52

Methods

applyNodePostprocessors

Private applyNodePostprocessors(nodes): NodeWithScore<Metadata>[]

Parameters

NameType
nodesNodeWithScore<Metadata>[]

Returns

NodeWithScore<Metadata>[]

Defined in

packages/core/src/QueryEngine.ts:72


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/QueryEngine.ts:89

query(params): Promise<Response>

Parameters

NameType
paramsQueryEngineParamsNonStreaming

Returns

Promise<Response>

Implementation of

BaseQueryEngine.query

Defined in

packages/core/src/QueryEngine.ts:90


retrieve

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

Parameters

NameType
querystring
parentEventEvent

Returns

Promise<NodeWithScore<Metadata>[]>

Defined in

packages/core/src/QueryEngine.ts:79