Nhảy tới nội dung

Class: RetrieverQueryEngine

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

Extends

Implements

Constructors

new RetrieverQueryEngine()

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

Parameters

retriever: BaseRetriever

responseSynthesizer?: BaseSynthesizer

preFilters?: unknown

nodePostprocessors?: BaseNodePostprocessor[]

Returns

RetrieverQueryEngine

Overrides

PromptMixin . constructor

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:24

Properties

nodePostprocessors

nodePostprocessors: BaseNodePostprocessor[]

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:21


preFilters?

optional preFilters: unknown

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:22


responseSynthesizer

responseSynthesizer: BaseSynthesizer

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:20


retriever

retriever: BaseRetriever

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:19

Methods

_getPromptModules()

_getPromptModules(): object

Returns

object

responseSynthesizer

responseSynthesizer: BaseSynthesizer

Overrides

PromptMixin . _getPromptModules

Source

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


_getPrompts()

protected _getPrompts(): PromptsDict

Returns

PromptsDict

Inherited from

PromptMixin . _getPrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:78


_updatePrompts()

protected _updatePrompts(promptsDict): void

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

PromptMixin . _updatePrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:86


applyNodePostprocessors()

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

Parameters

nodes: NodeWithScore <Metadata>[]

query: string

Returns

Promise <NodeWithScore <Metadata>[]>

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:48


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin . getPrompts

Source

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


query()

query(params)

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

Query the query engine and get a response.

Parameters

params: QueryEngineParamsStreaming

Returns

Promise<AsyncIterable <EngineResponse>>

Implementation of

QueryEngine . query

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:70

query(params)

query(params): Promise <EngineResponse>

Parameters

params: QueryEngineParamsNonStreaming

Returns

Promise <EngineResponse>

Implementation of

QueryEngine . query

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:73


retrieve()

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

Parameters

query: string

Returns

Promise <NodeWithScore <Metadata>[]>

Source

packages/llamaindex/src/engines/query/RetrieverQueryEngine.ts:61


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

PromptMixin . updatePrompts

Source

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


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

promptsDict: PromptsDict

moduleDict: ModuleDict

Returns

void

Inherited from

PromptMixin . validatePrompts

Source

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