Skip to content

Commit 594a4b8

Browse files
committed
get proxy ready for zod 4
1 parent 798ba5f commit 594a4b8

File tree

19 files changed

+21
-20
lines changed

19 files changed

+21
-20
lines changed

packages/proxy/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"vite-tsconfig-paths": "^4.3.2",
9898
"vitest": "^2.1.9",
9999
"yargs": "^17.7.2",
100-
"zod-to-json-schema": "^3.24.6"
100+
"zod-to-json-schema": "^3.25.0"
101101
},
102102
"dependencies": {
103103
"@anthropic-ai/sdk": "^0.39.0",
@@ -120,6 +120,7 @@
120120
"openai": "4.104.0",
121121
"openapi-json-schema": "^2.0.0",
122122
"uuid": "^9.0.1",
123-
"zod": "^3.25.34"
123+
"zod": "4.2.1",
124+
"zod-to-json-schema": "^3.25.0"
124125
}
125126
}

packages/proxy/schema/audio.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 "zod/v3";
22

33
export const mp3BitrateSchema = z.union([
44
z.literal(8),

packages/proxy/schema/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 "zod/v3";
22
import type {
33
AnyModelParamsType as AnyModelParam,
44
ChatCompletionMessageParamType as Message,

packages/proxy/schema/models.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from "vitest";
22
import { it } from "vitest";
33
import raw_models from "./model_list.json";
44
import { ModelSchema } from "./models";
5-
import { z } from "zod";
5+
import { z } from "zod/v3";
66

77
it("parse model list", () => {
88
const models = z.record(z.unknown()).parse(raw_models);

packages/proxy/schema/models.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 "zod/v3";
22
import { _urljoin } from "../src/util";
33

44
export const PromptInputs = ["chat", "completion"] as const;

packages/proxy/schema/openai-realtime.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 "zod/v3";
22

33
// Type definitions adapted from:
44
// https://github.com/openai/openai-realtime-api-beta/blob/0126e4bfc19901598c3f20d0a4b32bb3e0bea376/lib/client.js

packages/proxy/schema/secrets.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 "zod/v3";
22
import { ModelSchema } from "./models";
33

44
export const BaseMetadataSchema = z

packages/proxy/scripts/sync_models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from "fs";
22
import https from "https";
33
import path from "path";
4-
import { z } from "zod";
4+
import { z } from "zod/v3";
55
import yargs from "yargs";
66
import { hideBin } from "yargs/helpers";
77
import { exec, spawn } from "child_process";

packages/proxy/src/generated_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Auto-generated file (internal git SHA e6490ffb3d42f5dbc59d748bb5016f6d8f11cac2) -- do not modify
22

3-
import { z } from "zod";
3+
import { z } from "zod/v3";
44

55
export const AclObjectType = z.union([
66
z.enum([

packages/proxy/src/providers/anthropic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { ModelSpec } from "@schema";
3131
import { getBudgetMultiplier } from "utils";
3232
import { cleanOpenAIParams } from "utils/openai";
3333
import { v4 as uuidv4 } from "uuid";
34-
import { z } from "zod";
34+
import { z } from "zod/v3";
3535
import { getTimestampInSeconds, isEmpty, isObject } from "../util";
3636
import { convertMediaToBase64 } from "./util";
3737

0 commit comments

Comments
 (0)