adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
54 lines (53 loc) • 1.67 kB
TypeScript
import { FunctionDeclaration } from './BaseTool';
/**
* Extended FunctionDeclaration interface that includes response schema
* for VERTEX_AI variant
*/
export interface ExtendedFunctionDeclaration extends FunctionDeclaration {
response?: {
type: string;
properties?: Record<string, any>;
items?: any;
};
}
/**
* API variants supported for function declaration generation
*/
export type ApiVariant = 'GOOGLE_AI' | 'VERTEX_AI' | 'DEFAULT';
/**
* Type of function variants supported for function declaration generation
*/
export type FunctionVariant = 'FUNCTION' | 'CLASS';
/**
* Interface for function parameters
*/
export interface FunctionParameter {
name: string;
type: string;
description?: string;
isRequired?: boolean;
defaultValue?: any;
isNullable?: boolean;
items?: any;
properties?: Record<string, any>;
}
/**
* Generic function type that can be used instead of Function
*/
export type GenericFunction = (...args: any[]) => any;
/**
* Builds a function declaration from a JavaScript/TypeScript function or class
*
* @param func - The function or class to generate a declaration for
* @param options - Options for generating the function declaration
* @param options.variant - API variant to use (default: 'GOOGLE_AI')
* @param options.ignoreParams - Parameters to ignore in the declaration
* @returns A function declaration object
*/
export declare function buildFunctionDeclaration(func: GenericFunction | {
new (...args: any[]): any;
}, options?: {
variant?: ApiVariant;
ignoreParams?: string[];
functionVariant?: FunctionVariant;
}): ExtendedFunctionDeclaration;