-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Error responses are not consistent across many providers.
Reviewing my code, here are a few different ways I have error handling across a variety of providers:
- Non 200 error codes are treated as errors, some are probably retryable (408, 425, 429, 500, 502-504)
- JSON response with a top-level error key indicates a standard openai client protocol level error, but the contents of this key differ on some providers: Some return a string value, others as an object.
- I have also seen errors indicated by placing error keys inside of choices[]
- Errors from content filtering show up in a variety of ways. In one case the only clear indication that the response was filtered is a truncated messaage and a choices[n]['finish_reason'] of "content_filter".
I don't have special handling for this in my code right now, but how rate limiting is communicated to clients, and how clients should behave on receiving it should be covered in any error reporting specification. Also, clear specification about what errors are retryable and which are not.
Also, I have not gone back and reviewed what the OpenAI docs say about errors yet, but that would be the place to start in writing an actual specification on this.
vgel and ConcurrentSquared
Metadata
Metadata
Assignees
Labels
No labels