Skip to content

Commit a42b329

Browse files
committed
Update docs and README to encourage using @openai/zod - ref #187
1 parent d9b94b3 commit a42b329

File tree

23 files changed

+27
-27
lines changed

23 files changed

+27
-27
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ console.log(result.finalOutput);
8181
## Functions example
8282

8383
```js
84-
import { z } from 'zod';
84+
import { z } from '@openai/zod';
8585
import { Agent, run, tool } from '@openai/agents';
8686

8787
const getWeatherTool = tool({
@@ -110,7 +110,7 @@ main().catch(console.error);
110110
## Handoffs example
111111

112112
```js
113-
import { z } from 'zod';
113+
import { z } from '@openai/zod';
114114
import { Agent, run, tool } from '@openai/agents';
115115

116116
const getWeatherTool = tool({
@@ -147,7 +147,7 @@ main().catch(console.error);
147147
## Voice Agent
148148

149149
```js
150-
import { z } from 'zod';
150+
import { z } from '@openai/zod';
151151
import { RealtimeAgent, RealtimeSession, tool } from '@openai/agents-realtime';
152152

153153
const getWeatherTool = tool({

docs/src/content/docs/ja/guides/running-agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ SDK はキャッチ可能な少数のエラーをスローします。
165165
以下は `GuardrailExecutionError` を処理するコード例です。
166166
167167
```typescript
168-
import { z } from 'zod';
168+
import { z } from '@openai/zod';
169169
import {
170170
Agent,
171171
run,

examples/docs/agents/agentForcingToolUse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Agent, tool } from '@openai/agents';
2-
import { z } from 'zod';
2+
import { z } from '@openai/zod';
33

44
const calculatorTool = tool({
55
name: 'Calculator',

examples/docs/agents/agentWithAodOutputType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Agent } from '@openai/agents';
2-
import { z } from 'zod';
2+
import { z } from '@openai/zod';
33

44
const CalendarEvent = z.object({
55
name: z.string(),

examples/docs/agents/agentWithTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Agent, tool } from '@openai/agents';
2-
import { z } from 'zod';
2+
import { z } from '@openai/zod';
33

44
const getWeather = tool({
55
name: 'get_weather',

examples/docs/context/localContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Agent, run, RunContext, tool } from '@openai/agents';
2-
import { z } from 'zod';
2+
import { z } from '@openai/zod';
33

44
interface UserInfo {
55
name: string;

examples/docs/guardrails/guardrails-input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
InputGuardrailTripwireTriggered,
55
InputGuardrail,
66
} from '@openai/agents';
7-
import { z } from 'zod';
7+
import { z } from '@openai/zod';
88

99
const guardrailAgent = new Agent({
1010
name: 'Guardrail check',

examples/docs/guardrails/guardrails-output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
OutputGuardrailTripwireTriggered,
55
OutputGuardrail,
66
} from '@openai/agents';
7-
import { z } from 'zod';
7+
import { z } from '@openai/zod';
88

99
// The output by the main agent
1010
const MessageOutput = z.object({ response: z.string() });

examples/docs/handoffs/handoffInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from 'zod';
1+
import { z } from '@openai/zod';
22
import { Agent, handoff, RunContext } from '@openai/agents';
33

44
const EscalationData = z.object({ reason: z.string() });

examples/docs/human-in-the-loop/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from 'zod';
1+
import { z } from '@openai/zod';
22
import readline from 'node:readline/promises';
33
import fs from 'node:fs/promises';
44
import { Agent, run, tool, RunState, RunResult } from '@openai/agents';

0 commit comments

Comments
 (0)