-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
One example is Google as a provider for Claude Models (e.g., Sonnet 4.5).
Thrown at @openrouter/sdk/0.8.0/esm/models/operations/sendchatcompletionrequest.js:37:72
ZodError: [
{
"code": "invalid_union",
"errors": [
[
{
"code": "invalid_value",
"values": [
"tool_calls"
],
"path": [],
"message": "Invalid input: expected \"tool_calls\""
}
],
[
{
"code": "invalid_value",
"values": [
"stop"
],
"path": [],
"message": "Invalid input: expected \"stop\""
}
],
[
{
"code": "invalid_value",
"values": [
"length"
],
"path": [],
"message": "Invalid input: expected \"length\""
}
],
[
{
"code": "invalid_value",
"values": [
"content_filter"
],
"path": [],
"message": "Invalid input: expected \"content_filter\""
}
],
[
{
"code": "invalid_value",
"values": [
"error"
],
"path": [],
"message": "Invalid input: expected \"error\""
}
],
[
{
"expected": "string",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected string, received undefined"
}
]
],
"path": [
"data",
"choices",
0,
"finish_reason"
],
"message": "Invalid input"
}
]
Inspecting the rawEvent at that point shows that the property is indeed missing, and adding it (just setting finish_reason to null on the chunk) before the call to parse let's the SDK accept and process the chunks without complaint.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels