-
Notifications
You must be signed in to change notification settings - Fork 2
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
Azure OpenAI: TypeError: Cannot read properties of undefined (reading 'delta') #22
Comments
Hello thank you for reporting, do you have the actual raw content in |
For me it happens when enabling the pretty recently introduced
|
Are there plans to address this? |
@thomashibbard thank you for the details, this should help with the investigation. In the JSON payload you attached, there are no choices. Is that the complete payload? If |
@st3w4r Yeah exactly, there are no choices—I think—because the final received chunk is just token usage information, and so it doesn't have any of the choices/delta/etc included in the rest of the stream for composing responses. |
I see, indeed if the last chunk have no choices we could just skip it. A curl command could confirm this behavior it. |
I think the last chunk still needs to be processed so the usage can be accessed. Maybe it could emit a
|
I am using Azure OpenAI and trying to use this library for streaming the json object. Getting this error
I tried to fix it like this but did not work
The text was updated successfully, but these errors were encountered: