-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Error Propagation During Chat Streaming #285
Comments
Chasing it down a bit, the actual response is contained in the error, so a fix shouldn't be that hard. Basically, in the file That is, if the error code defined by the macro is used. In Changing this to something that properly captures the Response or just adds it to the Error String will drastically improve stream debugging capabilities, as was talked about in this issue. I might work on it later. |
I added a simple block to, if an invalid status code or content type is encountered, a custom error String is used instead that also contains the full Response text. I didn't understand the testing suite or whether this is covered by the tests; sorry about that. I'll quickly test it in my local environment and report back. |
It does work, I got it to output a more useful error when calling o3-mini. Before:
Now:
Note that the error is quite ugly, but is much more informative. Edit: |
Thanks for debugging and sharing, it seems like underlying |
Could someone share a code snippet of what exactly needs to change in order to support better error handling? |
I did a minimal solution on my fork: SeseMueller@4b82e9a |
If
stream = True
, we are noticing that a 400 returns (in the server logs):On the client side (Python consumption):
If
stream = False
, then we still get the 400, but also more rich information:What would be great is that we are able to retrieve the enriched error information even if streaming is true. That is the current behavior with the Python client.
The text was updated successfully, but these errors were encountered: