import { tool, RealtimeContextData, RealtimeItem, } from '@openai/agents/realtime'; import { z } from 'zod'; const parameters = z.object({ request: z.string(), }); const refundTool = tool({ name: 'Refund Expert', description: 'Evaluate a refund', parameters, execute: async ({ request }, details) => { // The history might not be available const history: RealtimeItem[] = details?.context?.history ?? []; // making your call to process the refund request }, });