/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ /** * OpenAI function parameter schema format * Includes index signature to satisfy OpenAI SDK's FunctionParameters type */ export interface OpenAIFunctionParameters { type: 'object'; properties: Record; required: string[]; additionalProperties?: boolean; [key: string]: unknown; } /** * OpenAI property schema (recursive for nested objects/arrays) */ export interface OpenAIPropertySchema { type: string; description?: string; enum?: string[]; items?: OpenAIPropertySchema; properties?: Record; required?: string[]; minimum?: number; maximum?: number; minLength?: number; maxLength?: number; default?: unknown; } /** * OpenAI tool format for function calling */ export interface OpenAITool { type: 'function'; function: { name: string; description: string; parameters: OpenAIFunctionParameters; }; } /** * Input format from Gemini-style tool declarations */ interface GeminiToolDeclaration { name: string; description?: string; parametersJsonSchema?: unknown; } /** * Convert a Gemini-style schema to OpenAI JSON Schema format. * Handles: * - Uppercase type enums → lowercase strings * - Missing required fields → adds empty array * - String numeric values → proper numbers * - Recursive property/items conversion */ export declare function convertSchemaToOpenAI(schema: unknown): OpenAIFunctionParameters; /** * Convert an array of Gemini-style tool declarations to OpenAI format */ export declare function convertToolsToOpenAI(geminiTools?: Array<{ functionDeclarations?: GeminiToolDeclaration[]; }>): OpenAITool[] | undefined; export {};