diff --git a/README.md b/README.md index 1bf2bcbd..81ef2a9b 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ console.log(result.finalOutput); ## Functions example ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ @@ -110,7 +110,7 @@ main().catch(console.error); ## Handoffs example ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ @@ -147,7 +147,7 @@ main().catch(console.error); ## Voice Agent ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { RealtimeAgent, RealtimeSession, tool } from '@openai/agents-realtime'; const getWeatherTool = tool({ diff --git a/docs/src/content/docs/ja/guides/running-agents.md b/docs/src/content/docs/ja/guides/running-agents.md index ae54713c..fd301f7f 100644 --- a/docs/src/content/docs/ja/guides/running-agents.md +++ b/docs/src/content/docs/ja/guides/running-agents.md @@ -165,7 +165,7 @@ SDK はキャッチ可能な少数のエラーをスローします。 以下は `GuardrailExecutionError` を処理するコード例です。 ```typescript -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, diff --git a/examples/docs/agents/agentForcingToolUse.ts b/examples/docs/agents/agentForcingToolUse.ts index 63086f4d..4b366a7a 100644 --- a/examples/docs/agents/agentForcingToolUse.ts +++ b/examples/docs/agents/agentForcingToolUse.ts @@ -1,5 +1,5 @@ import { Agent, tool } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const calculatorTool = tool({ name: 'Calculator', diff --git a/examples/docs/agents/agentWithAodOutputType.ts b/examples/docs/agents/agentWithAodOutputType.ts index 6aadd70e..5c2ee278 100644 --- a/examples/docs/agents/agentWithAodOutputType.ts +++ b/examples/docs/agents/agentWithAodOutputType.ts @@ -1,5 +1,5 @@ import { Agent } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const CalendarEvent = z.object({ name: z.string(), diff --git a/examples/docs/agents/agentWithTools.ts b/examples/docs/agents/agentWithTools.ts index 5d44c60d..6f93869e 100644 --- a/examples/docs/agents/agentWithTools.ts +++ b/examples/docs/agents/agentWithTools.ts @@ -1,5 +1,5 @@ import { Agent, tool } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const getWeather = tool({ name: 'get_weather', diff --git a/examples/docs/context/localContext.ts b/examples/docs/context/localContext.ts index 40160ab0..4e6a68c2 100644 --- a/examples/docs/context/localContext.ts +++ b/examples/docs/context/localContext.ts @@ -1,5 +1,5 @@ import { Agent, run, RunContext, tool } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; interface UserInfo { name: string; diff --git a/examples/docs/guardrails/guardrails-input.ts b/examples/docs/guardrails/guardrails-input.ts index f3f9077d..15b722bd 100644 --- a/examples/docs/guardrails/guardrails-input.ts +++ b/examples/docs/guardrails/guardrails-input.ts @@ -4,7 +4,7 @@ import { InputGuardrailTripwireTriggered, InputGuardrail, } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const guardrailAgent = new Agent({ name: 'Guardrail check', diff --git a/examples/docs/guardrails/guardrails-output.ts b/examples/docs/guardrails/guardrails-output.ts index 647b25aa..0eeb7075 100644 --- a/examples/docs/guardrails/guardrails-output.ts +++ b/examples/docs/guardrails/guardrails-output.ts @@ -4,7 +4,7 @@ import { OutputGuardrailTripwireTriggered, OutputGuardrail, } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; // The output by the main agent const MessageOutput = z.object({ response: z.string() }); diff --git a/examples/docs/handoffs/handoffInput.ts b/examples/docs/handoffs/handoffInput.ts index f9603d04..e84c89ef 100644 --- a/examples/docs/handoffs/handoffInput.ts +++ b/examples/docs/handoffs/handoffInput.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, handoff, RunContext } from '@openai/agents'; const EscalationData = z.object({ reason: z.string() }); diff --git a/examples/docs/human-in-the-loop/index.ts b/examples/docs/human-in-the-loop/index.ts index d5440cc3..65821ea5 100644 --- a/examples/docs/human-in-the-loop/index.ts +++ b/examples/docs/human-in-the-loop/index.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import readline from 'node:readline/promises'; import fs from 'node:fs/promises'; import { Agent, run, tool, RunState, RunResult } from '@openai/agents'; diff --git a/examples/docs/human-in-the-loop/toolApprovalDefinition.ts b/examples/docs/human-in-the-loop/toolApprovalDefinition.ts index 05642141..2ca6de77 100644 --- a/examples/docs/human-in-the-loop/toolApprovalDefinition.ts +++ b/examples/docs/human-in-the-loop/toolApprovalDefinition.ts @@ -1,5 +1,5 @@ import { tool } from '@openai/agents'; -import z from 'zod'; +import z from '@openai/zod'; const sensitiveTool = tool({ name: 'cancelOrder', diff --git a/examples/docs/readme/readme-functions.ts b/examples/docs/readme/readme-functions.ts index 03c037e4..7eaf2464 100644 --- a/examples/docs/readme/readme-functions.ts +++ b/examples/docs/readme/readme-functions.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ diff --git a/examples/docs/readme/readme-handoffs.ts b/examples/docs/readme/readme-handoffs.ts index ef9696ed..dac2043b 100644 --- a/examples/docs/readme/readme-handoffs.ts +++ b/examples/docs/readme/readme-handoffs.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ diff --git a/examples/docs/readme/readme-voice-agent.ts b/examples/docs/readme/readme-voice-agent.ts index da8d6e7e..20f4eeee 100644 --- a/examples/docs/readme/readme-voice-agent.ts +++ b/examples/docs/readme/readme-voice-agent.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import { RealtimeAgent, RealtimeSession, tool } from '@openai/agents-realtime'; const getWeatherTool = tool({ diff --git a/examples/docs/results/handoffFinalOutputTypes.ts b/examples/docs/results/handoffFinalOutputTypes.ts index 4390dcf5..ffe0983f 100644 --- a/examples/docs/results/handoffFinalOutputTypes.ts +++ b/examples/docs/results/handoffFinalOutputTypes.ts @@ -1,5 +1,5 @@ import { Agent, run } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const refundAgent = new Agent({ name: 'Refund Agent', diff --git a/examples/docs/running-agents/exceptions1.ts b/examples/docs/running-agents/exceptions1.ts index 775fe418..4f2c9da1 100644 --- a/examples/docs/running-agents/exceptions1.ts +++ b/examples/docs/running-agents/exceptions1.ts @@ -5,7 +5,7 @@ import { InputGuardrail, InputGuardrailTripwireTriggered, } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const guardrailAgent = new Agent({ name: 'Guardrail check', diff --git a/examples/docs/running-agents/exceptions2.ts b/examples/docs/running-agents/exceptions2.ts index 9c770350..e102bf93 100644 --- a/examples/docs/running-agents/exceptions2.ts +++ b/examples/docs/running-agents/exceptions2.ts @@ -1,4 +1,4 @@ -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool, ToolCallError } from '@openai/agents'; const unstableTool = tool({ diff --git a/examples/docs/tools/functionTools.ts b/examples/docs/tools/functionTools.ts index 87585635..5f4246ee 100644 --- a/examples/docs/tools/functionTools.ts +++ b/examples/docs/tools/functionTools.ts @@ -1,5 +1,5 @@ import { tool } from '@openai/agents'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const getWeatherTool = tool({ name: 'get_weather', diff --git a/examples/docs/voice-agents/defineTool.ts b/examples/docs/voice-agents/defineTool.ts index a735ff2e..61d102e4 100644 --- a/examples/docs/voice-agents/defineTool.ts +++ b/examples/docs/voice-agents/defineTool.ts @@ -1,5 +1,5 @@ import { tool, RealtimeAgent } from '@openai/agents/realtime'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const getWeather = tool({ name: 'get_weather', diff --git a/examples/docs/voice-agents/delegationAgent.ts b/examples/docs/voice-agents/delegationAgent.ts index accfa254..c242aeee 100644 --- a/examples/docs/voice-agents/delegationAgent.ts +++ b/examples/docs/voice-agents/delegationAgent.ts @@ -4,7 +4,7 @@ import { tool, } from '@openai/agents/realtime'; import { handleRefundRequest } from './serverAgent'; -import z from 'zod'; +import z from '@openai/zod'; const refundSupervisorParameters = z.object({ request: z.string(), diff --git a/examples/docs/voice-agents/serverAgent.ts b/examples/docs/voice-agents/serverAgent.ts index 1425d8c5..f5f0b5b0 100644 --- a/examples/docs/voice-agents/serverAgent.ts +++ b/examples/docs/voice-agents/serverAgent.ts @@ -3,7 +3,7 @@ import 'server-only'; import { Agent, run } from '@openai/agents'; import type { RealtimeItem } from '@openai/agents/realtime'; -import z from 'zod'; +import z from '@openai/zod'; const agent = new Agent({ name: 'Refund Expert', diff --git a/examples/docs/voice-agents/toolHistory.ts b/examples/docs/voice-agents/toolHistory.ts index bfec0855..13f4f48c 100644 --- a/examples/docs/voice-agents/toolHistory.ts +++ b/examples/docs/voice-agents/toolHistory.ts @@ -3,7 +3,7 @@ import { RealtimeContextData, RealtimeItem, } from '@openai/agents/realtime'; -import { z } from 'zod'; +import { z } from '@openai/zod'; const parameters = z.object({ request: z.string(), diff --git a/packages/agents/README.md b/packages/agents/README.md index 731e4581..4160fcd7 100644 --- a/packages/agents/README.md +++ b/packages/agents/README.md @@ -78,7 +78,7 @@ console.log(result.finalOutput); ## Functions example ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ @@ -107,7 +107,7 @@ main().catch(console.error); ## Handoffs example ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { Agent, run, tool } from '@openai/agents'; const getWeatherTool = tool({ @@ -144,7 +144,7 @@ main().catch(console.error); ## Voice Agent ```js -import { z } from 'zod'; +import { z } from '@openai/zod'; import { RealtimeAgent, RealtimeSession, tool } from '@openai/agents-realtime'; const getWeatherTool = tool({