Skip to content
Open
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
2 changes: 1 addition & 1 deletion apis/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"@opentelemetry/resources": "^1.18.1",
"@opentelemetry/sdk-metrics": "^1.18.1",
"dotenv": "^16.3.1",
"zod": "3.25.34"
"zod": "4.1.8"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
},
"packageManager": "[email protected]",
"resolutions": {
"zod": "3.25.34"
"zod": "4.1.8"
}
}
2 changes: 1 addition & 1 deletion packages/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@
"jsonwebtoken": "^9.0.2",
"openai": "4.104.0",
"uuid": "^9.0.1",
"zod": "^3.25.34"
"zod": "4.1.8"
}
}
4 changes: 3 additions & 1 deletion packages/proxy/schema/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ export const ModelSchema = z.object({
export type ModelSpec = z.infer<typeof ModelSchema>;

import modelListJson from "./model_list.json";
const modelListJsonTyped = z.record(ModelSchema).parse(modelListJson);
const modelListJsonTyped = z
.record(z.string(), ModelSchema)
.parse(modelListJson);

// Because this file can be included and bundled in various ways, it's important to
// really inject these variables into the global scope, rather than let the bundler
Expand Down
2 changes: 1 addition & 1 deletion packages/proxy/schema/openai-realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const toolDefinitionTypeSchema = z.object({
type: z.literal("function").optional(),
name: z.string(),
description: z.string(),
parameters: z.record(z.unknown()),
parameters: z.record(z.string(), z.unknown()),
});

export const sessionResourceTypeSchema = z.object({
Expand Down
4 changes: 2 additions & 2 deletions packages/proxy/schema/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ModelSchema } from "./models";
export const BaseMetadataSchema = z
.object({
models: z.array(z.string()).nullish(),
customModels: z.record(ModelSchema).nullish(),
customModels: z.record(z.string(), ModelSchema).nullish(),
excludeDefaultModels: z.boolean().nullish(),
additionalHeaders: z.record(z.string(), z.string()).nullish(),
supportsStreaming: z.boolean().default(true),
Expand Down Expand Up @@ -88,7 +88,7 @@ const APISecretBaseSchema = z
org_name: z.string().nullish(),
name: z.string().nullish(),
secret: z.string(),
metadata: z.record(z.unknown()).nullish(),
metadata: z.record(z.string(), z.unknown()).nullish(),
})
.strict();

Expand Down
22 changes: 11 additions & 11 deletions packages/proxy/src/generated_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export const ExperimentEvent = z.object({
expected: z.unknown().optional(),
error: z.unknown().optional(),
scores: z
.union([z.record(z.union([z.number(), z.null()])), z.null()])
.union([z.record(z.string(), z.union([z.number(), z.null()])), z.null()])
.optional(),
metadata: z
.union([
Expand All @@ -529,7 +529,7 @@ export const ExperimentEvent = z.object({
])
.optional(),
tags: z.union([z.array(z.string()), z.null()]).optional(),
metrics: z.union([z.record(z.number()), z.null()]).optional(),
metrics: z.union([z.record(z.string(), z.number()), z.null()]).optional(),
context: z
.union([
z
Expand Down Expand Up @@ -648,7 +648,7 @@ export const PromptParserNullish = z.union([
z.object({
type: z.literal("llm_classifier"),
use_cot: z.boolean(),
choice_scores: z.record(z.number().gte(0).lte(1)),
choice_scores: z.record(z.string(), z.number().gte(0).lte(1)),
}),
z.null(),
]);
Expand Down Expand Up @@ -770,8 +770,8 @@ export const GraphEdge = z.object({
export type GraphEdgeType = z.infer<typeof GraphEdge>;
export const GraphData = z.object({
type: z.literal("graph"),
nodes: z.record(GraphNode),
edges: z.record(GraphEdge),
nodes: z.record(z.string(), GraphNode),
edges: z.record(z.string(), GraphEdge),
});
export type GraphDataType = z.infer<typeof GraphData>;
export const FunctionData = z.union([
Expand Down Expand Up @@ -1122,7 +1122,7 @@ export const ProjectLogsEvent = z.object({
expected: z.unknown().optional(),
error: z.unknown().optional(),
scores: z
.union([z.record(z.union([z.number(), z.null()])), z.null()])
.union([z.record(z.string(), z.union([z.number(), z.null()])), z.null()])
.optional(),
metadata: z
.union([
Expand All @@ -1134,7 +1134,7 @@ export const ProjectLogsEvent = z.object({
])
.optional(),
tags: z.union([z.array(z.string()), z.null()]).optional(),
metrics: z.union([z.record(z.number()), z.null()]).optional(),
metrics: z.union([z.record(z.string(), z.number()), z.null()]).optional(),
context: z
.union([
z
Expand Down Expand Up @@ -1173,7 +1173,7 @@ export const ProjectScoreCategory = z.object({
export type ProjectScoreCategoryType = z.infer<typeof ProjectScoreCategory>;
export const ProjectScoreCategories = z.union([
z.array(ProjectScoreCategory),
z.record(z.number()),
z.record(z.string(), z.number()),
z.array(z.string()),
z.null(),
]);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ export const ViewOptions = z.union([
frameStart: z.union([z.string(), z.null()]),
frameEnd: z.union([z.string(), z.null()]),
tzUTC: z.union([z.boolean(), z.null()]),
chartVisibility: z.union([z.record(z.boolean()), z.null()]),
chartVisibility: z.union([z.record(z.string(), z.boolean()), z.null()]),
projectId: z.union([z.string(), z.null()]),
type: z.union([z.enum(["project", "experiment"]), z.null()]),
groupBy: z.union([z.string(), z.null()]),
Expand All @@ -1425,9 +1425,9 @@ export const ViewOptions = z.union([
}),
z
.object({
columnVisibility: z.union([z.record(z.boolean()), z.null()]),
columnVisibility: z.union([z.record(z.string(), z.boolean()), z.null()]),
columnOrder: z.union([z.array(z.string()), z.null()]),
columnSizing: z.union([z.record(z.number()), z.null()]),
columnSizing: z.union([z.record(z.string(), z.number()), z.null()]),
grouping: z.union([z.string(), z.null()]),
rowHeight: z.union([z.string(), z.null()]),
tallGroupRows: z.union([z.boolean(), z.null()]),
Expand Down
8 changes: 4 additions & 4 deletions packages/proxy/types/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ const anthropicToolUseContentPartSchema = z.object({
type: z.literal("tool_use"),
id: z.string(),
name: z.string(),
input: z.record(z.any()),
input: z.record(z.string(), z.any()),
cache_control: cacheControlSchema.optional(),
});

const anthropicServerToolUseContentPartSchema = z.object({
type: z.literal("server_tool_use"),
id: z.string(),
name: z.enum(["web_search", "code_execution"]),
input: z.record(z.any()),
input: z.record(z.string(), z.any()),
cache_control: cacheControlSchema.optional(),
});

Expand Down Expand Up @@ -128,7 +128,7 @@ const anthropicMCPToolUseContentPartSchema = z.object({
type: z.literal("mcp_tool_use"),
id: z.string(),
name: z.string(),
input: z.record(z.any()),
input: z.record(z.string(), z.any()),
server_name: z.string(),
cache_control: cacheControlSchema.nullish(),
});
Expand All @@ -144,7 +144,7 @@ const anthropicMCPToolResultContentPartSchema = z.object({
type: z.literal("text"),
text: z.string(),
// This is a simplification of the strict citation schema
citations: z.array(z.record(z.any())).nullish(),
citations: z.array(z.record(z.string(), z.any())).nullish(),
cache_control: cacheControlSchema.nullish(),
}),
),
Expand Down
56 changes: 28 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading