UNPKG

adk-typescript

Version:

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

53 lines (52 loc) 1.61 kB
import { AuthCredential, AuthScheme } from '../auth/AuthTypes'; import { RestApiTool } from './RestApiTool'; /** * Class for parsing OpenAPI spec into a list of RestApiTool instances */ export declare class OpenAPIToolset { /** * The tools in this toolset */ private tools; /** * Create a new OpenAPIToolset * @param options The options for the toolset */ constructor(options: { specDict?: Record<string, any>; specStr?: string; specStrType?: 'json' | 'yaml'; authScheme?: AuthScheme; authCredential?: AuthCredential; }); /** * Configure authentication for all tools * @param authScheme The authentication scheme * @param authCredential The authentication credential */ private _configureAuthAll; /** * Get all tools in the toolset * @returns All RestApiTool instances in this toolset */ getTools(): RestApiTool[]; /** * Get a tool by name * @param toolName The name of the tool to find * @returns The matching RestApiTool or undefined if not found */ getTool(toolName: string): RestApiTool | undefined; /** * Load an OpenAPI spec from a string * @param specStr The OpenAPI spec string * @param specType The type of the spec string (json or yaml) * @returns The parsed spec object */ private _loadSpec; /** * Parse an OpenAPI spec into a list of RestApiTool instances * @param openApiSpecDict The OpenAPI spec dictionary * @returns A list of RestApiTool instances */ private _parse; }