Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.1.9",
"yargs": "^17.7.2",
"zod-to-json-schema": "^3.24.6"
"zod-to-json-schema": "^3.25.0"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.39.0",
Expand All @@ -120,6 +120,7 @@
"openai": "4.104.0",
"openapi-json-schema": "^2.0.0",
"uuid": "^9.0.1",
"zod": "^3.25.34"
"zod": "4.2.1",
"zod-to-json-schema": "^3.25.0"
}
}
2 changes: 1 addition & 1 deletion packages/proxy/schema/audio.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";

export const mp3BitrateSchema = z.union([
z.literal(8),
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";
import type {
AnyModelParamsType as AnyModelParam,
ChatCompletionMessageParamType as Message,
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from "vitest";
import { it } from "vitest";
import raw_models from "./model_list.json";
import { ModelSchema } from "./models";
import { z } from "zod";
import { z } from "zod/v3";

it("parse model list", () => {
const models = z.record(z.unknown()).parse(raw_models);
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";
import { _urljoin } from "../src/util";

export const PromptInputs = ["chat", "completion"] as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/openai-realtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";

// Type definitions adapted from:
// https://github.com/openai/openai-realtime-api-beta/blob/0126e4bfc19901598c3f20d0a4b32bb3e0bea376/lib/client.js
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/secrets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";
import { ModelSchema } from "./models";

export const BaseMetadataSchema = z
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/scripts/sync_models.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "fs";
import https from "https";
import path from "path";
import { z } from "zod";
import { z } from "zod/v3";
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { exec, spawn } from "child_process";
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/generated_types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Auto-generated file (internal git SHA e6490ffb3d42f5dbc59d748bb5016f6d8f11cac2) -- do not modify

import { z } from "zod";
import { z } from "zod/v3";

export const AclObjectType = z.union([
z.enum([
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/providers/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ModelSpec } from "@schema";
import { getBudgetMultiplier } from "utils";
import { cleanOpenAIParams } from "utils/openai";
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
import { z } from "zod/v3";
import { getTimestampInSeconds, isEmpty, isObject } from "../util";
import { convertMediaToBase64 } from "./util";

Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/providers/azure.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";
import { AzureEntraSecretSchema } from "@braintrust/proxy/schema";

const azureEntraResponseSchema = z.union([
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/providers/bedrock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
ChatCompletionToolMessageParam,
} from "openai/resources/chat/completions";
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
import { z } from "zod/v3";
import {
getTimestampInSeconds,
isEmpty,
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/providers/databricks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";
import { DatabricksOAuthSecretSchema } from "@braintrust/proxy/schema";

const databricksOAuthResponseSchema = z.union([
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/providers/google.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
googleEventToOpenAIChatEvent,
} from "./google";
import { zodToJsonSchema } from "zod-to-json-schema";
import { z } from "zod";
import { z } from "zod/v3";
import { IMAGE_DATA_URL, PDF_DATA_URL } from "./fixtures";

// Integration tests that actually call the Google API
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import {
parseOpenAIStream,
verifyTempCredentials,
} from "utils";
import { z } from "zod";
import { z } from "zod/v3";
import { nowMs } from "./metrics";
import {
anthropicCompletionToOpenAICompletion,
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/types/anthropic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AttachmentReference as attachmentReferenceSchema } from "../src/generated_types";
import { z } from "zod";
import { z } from "zod/v3";

const cacheControlSchema = z.object({
type: z.enum(["ephemeral"]),
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/types/google.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AttachmentReference } from "@lib/generated_types";
import { z } from "zod";
import { z } from "zod/v3";

export const finishReasonSchema = z.enum([
"FINISH_REASON_UNSPECIFIED",
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/types/openai.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChatCompletionMessageParam as chatCompletionMessageParamSchema } from "../src/generated_types";

import { z } from "zod";
import { z } from "zod/v3";

import {
ChatCompletion,
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/utils/encrypt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from "zod/v3";

let _issuedCryptoSubtleWarning = false;
function issueCryptoSubtleWarning() {
Expand Down
Loading