UNPKG

adk-typescript

Version:

TypeScript port of Google's Agent Development Kit (ADK)

81 lines (80 loc) 2.23 kB
import { BaseRetrievalTool, RetrievalToolOptions } from './BaseRetrievalTool'; import { ToolContext } from '../ToolContext'; /** * RAG resource interface (placeholder) * In a real implementation, this would match the Vertex AI RAG SDK types */ export interface RagResource { name: string; [key: string]: any; } /** * Options for creating a Vertex AI RAG retrieval tool */ export interface VertexAiRagRetrievalOptions extends RetrievalToolOptions { /** * RAG corpora to retrieve from */ ragCorpora?: string[]; /** * RAG resources to retrieve from */ ragResources?: RagResource[]; /** * Maximum number of top results to return */ similarityTopK?: number; /** * Threshold for vector distance to filter results */ vectorDistanceThreshold?: number; } /** * LLM request interface (simplified) */ interface LlmRequest { model?: string; config?: any; } /** * Retrieval tool that uses Vertex AI RAG to retrieve information */ export declare class VertexAiRagRetrieval extends BaseRetrievalTool { /** * Configuration for Vertex AI RAG */ private vertexRagStore; /** * Create a new Vertex AI RAG retrieval tool * * @param options Options for the Vertex AI RAG retrieval tool */ constructor(options: VertexAiRagRetrievalOptions); /** * Process an LLM request to add RAG capabilities * * @param options The options for processing * @returns Nothing */ processLlmRequest(options: { toolContext: ToolContext; llmRequest: LlmRequest; }): Promise<void>; /** * Retrieve information from Vertex AI RAG * * @param query The query to retrieve information for * @param maxResults Maximum number of results to return * @param context The context for the retrieval * @returns The retrieved information */ protected retrieve(query: string, maxResults: number, context: ToolContext): Promise<string | string[]>; /** * Placeholder implementation of the Vertex AI RAG API * * @param options Options for the retrieval query * @returns A mock response */ private retrievalQuery; } export {};