Closed restlessronin closed 4 months ago
@aramallo I have merged into main a fix for your issue, please let me know if you see any problems with it.
Basically when there's an error, we just return an error field instead of a task_pid field and a body_stream field.
the logger warning has been removed.
@aramallo published this as v0.6.5.
For example, sending an invalid request now generates the following log
I guess this was the purpose of your Logger.warning call in the first place, but the problem is that we are logging a perfectly valid reponse payload and we are not adding it to the request state.
To see what is going on you can check this
curl
requestSo OpenaiEx will return the following, without the actual error content.
The ideal would be not to log this as a warning but to add the error event to the
body_stream
so that we can consume onstatus != 200
or to returned it the struct like in the following example_Originally posted by @aramallo in https://github.com/restlessronin/openai_ex/issues/83#issuecomment-2044502289_