import { Agent } from '@openai/agents'; interface Purchase { id: string; uid: string; deliveryStatus: string; } interface UserContext { uid: string; isProUser: boolean; // this function can be used within tools fetchPurchases(): Promise; } const agent = new Agent({ name: 'Personal shopper', instructions: 'Recommend products the user will love.', }); // Later import { run } from '@openai/agents'; const result = await run(agent, 'Find me a new pair of running shoes', { context: { uid: 'abc', isProUser: true, fetchPurchases: async () => [] }, });