Skip to content

Commit

Permalink
fix (@ai-sdk/openai): make function name and arguments nullish. (#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored Jun 6, 2024
1 parent 69f3383 commit 0e78960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-pets-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@ai-sdk/openai': patch
---

fix (@ai-sdk/openai): make function name and arguments nullish
4 changes: 2 additions & 2 deletions packages/openai/src/openai-chat-language-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ const openaiChatChunkSchema = z.union([
id: z.string().nullish(),
type: z.literal('function').optional(),
function: z.object({
name: z.string().optional(),
arguments: z.string().optional(),
name: z.string().nullish(),
arguments: z.string().nullish(),
}),
}),
)
Expand Down

0 comments on commit 0e78960

Please sign in to comment.