UNPKG

adk-typescript

Version:

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

61 lines (60 loc) 1.46 kB
import { BaseRetrievalTool, RetrievalToolOptions } from './BaseRetrievalTool'; import { ToolContext } from '../ToolContext'; /** * Options for creating a web search tool */ export interface WebSearchToolOptions extends RetrievalToolOptions { /** * API key for the search engine */ apiKey?: string; /** * Search engine ID */ searchEngineId?: string; } /** * Search result interface */ export interface SearchResult { /** * Title of the result */ title: string; /** * URL of the result */ url: string; /** * Snippet/description of the result */ snippet: string; } /** * Web search tool for retrieving information from the web */ export declare class WebSearchTool extends BaseRetrievalTool { /** * API key for the search engine */ private apiKey?; /** * Search engine ID */ private searchEngineId?; /** * Create a new web search tool * * @param options Options for the web search tool */ constructor(options?: Partial<WebSearchToolOptions>); /** * Retrieve information from the web * * @param query The query to search for * @param maxResults Maximum number of results to return * @param context The context for the retrieval * @returns The search results */ protected retrieve(query: string, maxResults: number, context: ToolContext): Promise<SearchResult[]>; }