Skip to content

Commit

Permalink
Bug:fix issue with vercel sdk model noth validating schema properly
Browse files Browse the repository at this point in the history
  • Loading branch information
parzival418 committed Jun 11, 2024
1 parent 79f6ee2 commit 4ef9ca6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ const openAIChatResponseSchema = z.object({
z.object({
message: z.object({
role: z.literal('assistant'),
content: z.string().nullable().optional(),
content: z.string().nullable().nullish(),
tool_calls: z
.array(
z.object({
Expand All @@ -388,7 +388,7 @@ const openAIChatResponseSchema = z.object({
}),
})
)
.optional(),
.nullish(),
}),
index: z.number(),
logprobs: z
Expand All @@ -409,7 +409,7 @@ const openAIChatResponseSchema = z.object({
.nullable(),
})
.nullable()
.optional(),
.nullish(),
finish_reason: z.string().optional().nullable(),
})
),
Expand All @@ -425,7 +425,7 @@ const openaiChatChunkSchema = z.object({
choices: z.array(
z.object({
delta: z.object({
role: z.enum(['assistant']).optional(),
role: z.enum(['assistant']).nullish(),
content: z.string().nullable().optional(),
tool_calls: z
.array(
Expand All @@ -439,7 +439,7 @@ const openaiChatChunkSchema = z.object({
}),
})
)
.optional(),
.nullish(),
}),
logprobs: z
.object({
Expand All @@ -456,7 +456,7 @@ const openaiChatChunkSchema = z.object({
})
),
})
.optional(),
.nullish(),
finish_reason: z.string().nullable().optional(),
index: z.number(),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ const openAICompletionResponseSchema = z.object({
top_logprobs: z.array(z.record(z.string(), z.number())).nullable(),
})
.nullable()
.optional(),
.nullish(),
})
),
usage: z.object({
Expand All @@ -317,7 +317,7 @@ const openaiCompletionChunkSchema = z.object({
top_logprobs: z.array(z.record(z.string(), z.number())).nullable(),
})
.nullable()
.optional(),
.nullish(),
})
),
usage: z
Expand Down

0 comments on commit 4ef9ca6

Please sign in to comment.