🐛 Bug Report: Generation crashes because finish_reason
is not always present in the async delta
#1235
Closed
1 task done
Which component is this bug for?
OpenAI Instrumentation
📜 Description
The async chat completion crashes because the
finish_reason
is absent from a delta.It sometimes happens with the Azure OpenAI backend.
👟 Reproduction steps
Extract of the code I used:
👍 Expected behavior
Even if
finish_reason
is absent, generation must not crash because of the instrumentation.👎 Actual Behavior with Screenshots
The generation crashes because
finish_reason
is absent in a stream delta.Short log:
Full log:
🤖 Python Version
3.11.9
📃 Provide any additional context for the Bug.
Versions:
👀 Have you spent some time to check if this bug has been raised before?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: