diff --git a/examples/docs/handoffs/customizeHandoff.ts b/examples/docs/handoffs/customizeHandoff.ts index 10d5eee4..fe1642e2 100644 --- a/examples/docs/handoffs/customizeHandoff.ts +++ b/examples/docs/handoffs/customizeHandoff.ts @@ -1,13 +1,17 @@ +import { z } from 'zod'; import { Agent, handoff, RunContext } from '@openai/agents'; -function onHandoff(ctx: RunContext) { - console.log('Handoff called'); +const FooSchema = z.object({ foo: z.string() }); + +function onHandoff(ctx: RunContext, input?: { foo: string }) { + console.log('Handoff called with:', input?.foo); } const agent = new Agent({ name: 'My agent' }); const handoffObj = handoff(agent, { onHandoff, + inputType: FooSchema, toolNameOverride: 'custom_handoff_tool', toolDescriptionOverride: 'Custom description', });