import { a as GQP } from '../../engine-Bg3M08x9.mjs'; import { z as ToolCallResult } from '../../types-CqJN-Ev5.mjs'; /** * OpenAI Function Definition */ interface OpenAIFunction { name: string; description: string; parameters: { type: "object"; properties: Record; required?: string[]; }; } /** * OpenAI Function Call (from API response) */ interface OpenAIFunctionCall { name: string; arguments: string; } /** * OpenAI Tool Definition (newer format) */ interface OpenAITool { type: "function"; function: OpenAIFunction; } /** * Bridge options */ interface OpenAIBridgeOptions { /** Naming convention for function name */ naming?: "camelCase" | "snake_case"; /** Include example queries in description */ includeExamples?: boolean; /** Custom function name */ functionName?: string; /** Custom description */ description?: string; } /** * Convert GQP to OpenAI function definitions * * @example * ```typescript * import { toOpenAIFunctions } from '@mzhub/gqp/openai'; * * const functions = toOpenAIFunctions(graph); * * const response = await openai.chat.completions.create({ * model: 'gpt-4-turbo', * messages: [...], * functions, * function_call: 'auto' * }); * ``` */ declare function toOpenAIFunctions(graph: GQP, options?: OpenAIBridgeOptions): OpenAIFunction[]; /** * Convert GQP to OpenAI tools format (newer API) */ declare function toOpenAITools(graph: GQP, options?: OpenAIBridgeOptions): OpenAITool[]; /** * Create an executor for OpenAI function calls * * @example * ```typescript * import { toOpenAIFunctions, createExecutor } from '@mzhub/gqp/openai'; * * const executor = createExecutor(graph); * * if (response.choices[0].message.function_call) { * const result = await executor(response.choices[0].message.function_call); * } * ``` */ declare function createExecutor(graph: GQP): (functionCall: OpenAIFunctionCall) => Promise; /** * Create a tool executor for OpenAI tool calls (newer API) */ declare function createToolExecutor(graph: GQP): (toolCall: { function: OpenAIFunctionCall; }) => Promise; /** * Helper to format result for OpenAI tool response */ declare function formatToolResult(result: ToolCallResult): string; export { type OpenAIBridgeOptions, type OpenAIFunction, type OpenAIFunctionCall, type OpenAITool, createExecutor, createToolExecutor, formatToolResult, toOpenAIFunctions, toOpenAITools };