diff --git a/core/js/typespecs/prompt.ts b/core/js/typespecs/prompt.ts index 030a57aa..01eb9619 100644 --- a/core/js/typespecs/prompt.ts +++ b/core/js/typespecs/prompt.ts @@ -95,21 +95,19 @@ const googleModelParamsSchema = z.strictObject({ }); const jsCompletionParamsSchema = z.strictObject({}); -export const modelParamsSchema = braintrustModelParamsSchema.and( - z.union([ - openAIModelParamsSchema, - anthropicModelParamsSchema, - googleModelParamsSchema, - jsCompletionParamsSchema, - ]) -); +export const modelParamsSchema = z.union([ + braintrustModelParamsSchema.merge(openAIModelParamsSchema), + braintrustModelParamsSchema.merge(anthropicModelParamsSchema), + braintrustModelParamsSchema.merge(googleModelParamsSchema), + braintrustModelParamsSchema.merge(jsCompletionParamsSchema), +]); export type ModelParams = z.infer; const anyModelParamsSchema = openAIModelParamsSchema - .and(anthropicModelParamsSchema) - .and(googleModelParamsSchema) - .and(braintrustModelParamsSchema); + .merge(anthropicModelParamsSchema) + .merge(googleModelParamsSchema) + .merge(braintrustModelParamsSchema); export type AnyModelParam = z.infer;