UNPKG

adk-typescript

Version:

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

82 lines (81 loc) 2.1 kB
import { BaseTool } from '../BaseTool'; import { McpBaseTool } from './MCPSessionManager'; export interface JSONSchema { type?: string | string[]; title?: string; description?: string; default?: any; enum?: any[]; format?: string; example?: any; pattern?: string; minLength?: number; maxLength?: number; minimum?: number; maximum?: number; items?: JSONSchema; minItems?: number; maxItems?: number; properties?: Record<string, JSONSchema>; required?: string[]; minProperties?: number; maxProperties?: number; anyOf?: JSONSchema[]; allOf?: JSONSchema[]; oneOf?: JSONSchema[]; [key: string]: any; } /** * Convert a Tool in ADK into MCP tool type. * * This function transforms an ADK tool definition into its equivalent * representation in the MCP (Model Control Plane) system. * * @param tool The ADK tool to convert * @returns An object of MCP Tool type */ export declare function adkToMcpToolType(tool: BaseTool): McpBaseTool; /** * Schema type enum mapping between Gemini and JSON Schema */ export declare enum SchemaType { TYPE_UNSPECIFIED = "null", STRING = "string", NUMBER = "number", INTEGER = "integer", BOOLEAN = "boolean", ARRAY = "array", OBJECT = "object" } /** * Gemini schema interface */ export interface GeminiSchema { type?: SchemaType; nullable?: boolean; title?: string; description?: string; default?: any; enum?: any[]; format?: string; example?: any; pattern?: string; minLength?: number; maxLength?: number; minimum?: number; maximum?: number; items?: GeminiSchema; minItems?: number; maxItems?: number; properties?: Record<string, GeminiSchema>; required?: string[]; minProperties?: number; maxProperties?: number; anyOf?: GeminiSchema[]; } /** * Convert a Gemini schema to JSON schema * @param geminiSchema The Gemini schema to convert * @returns The equivalent JSON schema */ export declare function geminiToJsonSchema(geminiSchema: GeminiSchema): any;