import { OpenAssistantTool } from './tool'; import { z } from 'zod'; /** * Converts an OpenAssistantTool to an AI SDK v5 compatible tool configuration. * * @param tool - The OpenAssistantTool object to convert * @returns A tool configuration object that can be used with the `tool()` function from AI SDK v5 * * @example * ```typescript * import { tool } from 'ai'; * import { convertToVercelAiTool } from '@openassistant/utils'; * * const myTool: OpenAssistantTool = { * name: 'my-tool', * description: 'My tool description', * parameters: z.object({ input: z.string() }), * context: {}, * execute: async (params) => ({ llmResult: 'result' }) * }; * const aiSDKTool = tool(convertToVercelAiTool(myTool)); * * // Use with AI SDK v5 * const result = await streamText({ * model: openai('gpt-4'), * messages, * tools: { myTool: aiSDKTool } * }); * ``` */ export declare function convertToVercelAiToolV5(tool: OpenAssistantTool): { name: string; description: string; inputSchema: z.ZodTypeAny; outputSchema: z.ZodObject<{ success: z.ZodBoolean; result: z.ZodString; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { success: boolean; result: string; error?: string | undefined; }, { success: boolean; result: string; error?: string | undefined; }>; execute: (args: unknown, options: { toolCallId: string; abortSignal?: AbortSignal; }) => Promise; }; export declare function convertToVercelAiTool(tool: OpenAssistantTool): { name: string; description: string; parameters: z.ZodTypeAny; execute: (args: unknown, options: { toolCallId: string; abortSignal?: AbortSignal; }) => Promise; };