Skip to content

Commit d04d9d8

Browse files
committed
support null in reasoning (returned by openrouter sometimes)
1 parent ff88745 commit d04d9d8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export interface Message {
120120
role: "assistant" | "user" | "system" | "function" | "tool"
121121
name?: string
122122
content: string | ContentArray | null
123-
reasoning?: MessageReasoning[]
123+
reasoning?: MessageReasoning[] | null
124124
function_call?: {
125125
name: string
126126
arguments: string

src/vercel-ai/langtail-language-model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ const openaiChatResponseSchema = z.object({
700700
data: z.string(),
701701
})
702702
])),
703-
]).optional(),
703+
]).nullish(),
704704
function_call: z
705705
.object({
706706
arguments: z.string(),
@@ -780,7 +780,7 @@ const langtailChatChunksSchema = z.union([
780780
data: z.string(),
781781
})
782782
])),
783-
]).optional(),
783+
]).nullish(),
784784
function_call: z
785785
.object({
786786
name: z.string().optional(),

0 commit comments

Comments
 (0)