Skip to content

Commit 5c80e57

Browse files
authored
fix(ai-openrouter): allow partial tool_call deltas in streaming (closes #6128) (#6131)
1 parent aa47393 commit 5c80e57

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/huge-peaches-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/ai-openrouter": patch
3+
---
4+
5+
Allow partial tool_call deltas in OpenRouter streaming

packages/ai/openrouter/src/OpenRouterClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ export class ChatStreamingMessageToolCall extends Schema.Class<ChatStreamingMess
313313
)({
314314
index: Schema.Number,
315315
id: Schema.optionalWith(Schema.String, { nullable: true }),
316-
type: Schema.Literal("function"),
316+
type: Schema.optionalWith(Schema.Literal("function"), { nullable: true }),
317317
function: Schema.Struct({
318318
name: Schema.optionalWith(Schema.String, { nullable: true }),
319-
arguments: Schema.String
319+
arguments: Schema.optionalWith(Schema.String, { nullable: true })
320320
})
321321
}) {}
322322

0 commit comments

Comments
 (0)