UNPKG

@llamaindex/core

Version:
32 lines (29 loc) 1.17 kB
import { MessageContent } from '../../llms/dist/index.js'; import { PromptMixin } from '../../prompts/dist/index.js'; import { QueryBundle, QueryType } from '../../query-engine/dist/index.js'; import { NodeWithScore } from '../../schema/dist/index.js'; type RetrieveParams = { query: MessageContent; preFilters?: unknown; }; type RetrieveStartEvent = { id: string; query: QueryBundle; }; type RetrieveEndEvent = { id: string; query: QueryBundle; nodes: NodeWithScore[]; }; declare abstract class BaseRetriever extends PromptMixin { objectMap: Map<string, unknown>; protected _updatePrompts(): void; protected _getPrompts(): {}; protected _getPromptModules(): {}; protected constructor(); retrieve(params: QueryType): Promise<NodeWithScore[]>; abstract _retrieve(params: QueryBundle): Promise<NodeWithScore[]>; _handleRecursiveRetrieval(params: QueryBundle, nodes: NodeWithScore[]): Promise<NodeWithScore[]>; _retrieveFromObject(object: unknown, queryBundle: QueryBundle, score: number): NodeWithScore[]; } export { BaseRetriever, type RetrieveEndEvent, type RetrieveParams, type RetrieveStartEvent };