You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@effect/ai-anthropic: messageBatchesResults fails with "Unexpected status code" on its 200 JSON Lines response #10107
The generated client's messageBatchesResults fails with StatusCode: Unexpected status code on a successful response. GET /v1/messages/batches/{id}/results returns 200 with a JSON Lines body (application/x-jsonl), one result per line. The operation in src/Generated.ts matches only 4xx, and sends every other status to unexpectedStatus:
We hit the same failure against the live API after a batch had ended.
Workaround
GET the batch's results_url with HttpClient and decode each line with a Schema of the result.
A possible fix
Give the operation a 2xx case that decodes the body line by line with a schema for one result (custom_id and result), which Generated.ts has none of yet, and returns them as an array or as a Stream, since a batch's results can be large.
Activity