UNPKG

weaviate-agents

Version:
35 lines (34 loc) 1.64 kB
import { WeaviateClient } from "weaviate-client"; import { SearchExecutionOptions, SearchModeResponse } from "./response/response.js"; import { QueryAgentQuery } from "./agent.js"; import { QueryAgentCollection } from "./collection.js"; /** * A configured searcher for the QueryAgent. * * This is used internally by the QueryAgent class to run search-mode queries. * After the first request is made, the underlying searches are cached and can * be reused for paginating through the a consistent set of results. */ export declare class QueryAgentSearcher { private client; private query; private collections; private systemPrompt; private agentsHost; private cachedSearches?; constructor(client: WeaviateClient, query: QueryAgentQuery, collections: QueryAgentCollection[], systemPrompt: string | undefined, agentsHost: string); private buildRequestBody; /** * Run the search-only agent with the given limit and offset values. * * Calling this method multiple times on the same QueryAgentSearcher instance will result * in the same underlying searches being performed each time, allowing you to paginate * over a consistent results set. * * @param [options] - Options for executing the search * @param [options.limit] - The maximum number of results to return. Defaults to 20 if not specified. * @param [options.offset] - The offset to start from. * @returns A SearchModeResponse object containing the results, usage, and underlying searches performed. */ run({ limit, offset, }: SearchExecutionOptions): Promise<SearchModeResponse>; }