Skip to content

Commit 94569a0

Browse files
GuthiasAbdillahRobertCraigie
authored
chore: compat with zod v4 (#1658)
Co-authored-by: Hernawan Faiz Abdillah <[email protected]> Co-authored-by: Robert Craigie <[email protected]>
1 parent 01cdbe1 commit 94569a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+52
-52
lines changed

examples/parsing-run-tools.ts

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

55
const Table = z.enum(['orders', 'customers', 'products']);

examples/parsing-stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { zodResponseFormat } from 'openai/helpers/zod';
22
import OpenAI from 'openai/index';
3-
import { z } from 'zod';
3+
import { z } from 'zod/v3';
44

55
const Step = z.object({
66
explanation: z.string(),

examples/parsing-tools-stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { zodFunction } from 'openai/helpers/zod';
22
import OpenAI from 'openai/index';
3-
import { z } from 'zod';
3+
import { z } from 'zod/v3';
44

55
const GetWeatherArgs = z.object({
66
city: z.string(),

examples/parsing-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { zodFunction } from 'openai/helpers/zod';
22
import OpenAI from 'openai/index';
3-
import { z } from 'zod';
3+
import { z } from 'zod/v3';
44

55
const Table = z.enum(['orders', 'customers', 'products']);
66

examples/parsing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { zodResponseFormat } from 'openai/helpers/zod';
22
import OpenAI from 'openai/index';
3-
import { z } from 'zod';
3+
import { z } from 'zod/v3';
44

55
const Step = z.object({
66
explanation: z.string(),

examples/responses/streaming-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { OpenAI } from 'openai';
44
import { zodResponsesFunction } from 'openai/helpers/zod';
5-
import { z } from 'zod';
5+
import { z } from 'zod/v3';
66

77
const Table = z.enum(['orders', 'customers', 'products']);
88
const Column = z.enum([

examples/responses/structured-outputs-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { OpenAI } from 'openai';
44
import { zodResponsesFunction } from 'openai/helpers/zod';
5-
import { z } from 'zod';
5+
import { z } from 'zod/v3';
66

77
const Table = z.enum(['orders', 'customers', 'products']);
88
const Column = z.enum([

examples/responses/structured-outputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { OpenAI } from 'openai';
44
import { zodTextFormat } from 'openai/helpers/zod';
5-
import { z } from 'zod';
5+
import { z } from 'zod/v3';
66

77
const Step = z.object({
88
explanation: z.string(),

examples/tool-call-helpers-zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import OpenAI from 'openai';
44
import { zodFunction } from 'openai/helpers/zod';
5-
import { z } from 'zod';
5+
import { z } from 'zod/v3';
66

77
// gets API Key from environment variable OPENAI_API_KEY
88
const openai = new OpenAI();

examples/ui-generation.ts

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

55
const openai = new OpenAI();

0 commit comments

Comments
 (0)