-
Notifications
You must be signed in to change notification settings - Fork 124
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
NullReferenceException
when retrieving properties of a streaming chat chunk using Asynchronous Filter
#198
Comments
NullPointException
when retrieving the role of a streaming chat chunk using Asynchronous FilterNullReferenceException
when retrieving the role of a streaming chat chunk using Asynchronous Filter
NullReferenceException
when retrieving the role of a streaming chat chunk using Asynchronous FilterNullReferenceException
when retrieving properties of a streaming chat chunk using Asynchronous Filter
### Motivation and Context Resolve #8407 ### Description Add temporary bugfix for error described in below issues: - #8407 - openai/openai-dotnet#198 - Added UnitTest to ensure expected behavior. ### Contribution Checklist - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
The problem seems to be that the SDK assumes that first "Choices" object always have a not-null Delta, while for Propagating null should help to not throw in this case: |
…tion when using Function Calling. (#8654) ### Motivation and Context Closes #8629 Workaround BugFix for issue in OpenAI SDK: - openai/openai-dotnet#198
…tion when using Function Calling. (#8654) ### Motivation and Context Closes #8629 Workaround BugFix for issue in OpenAI SDK: - openai/openai-dotnet#198
Thank you for reaching out, @RogerBarreto ! We have merged and released a fix for this issue. It is available starting with version 2.0.0-beta.12. |
Confirm this is not an issue with the underlying OpenAI API
Confirm this is not an issue with Azure OpenAI
Describe the bug
When using
StreamingChatCompletionUpdate
with Asynchronous Filter enabled in azure, this class breaks.openai-dotnet/src/Custom/Chat/StreamingChatCompletionUpdate.cs
Line 83 in 583e9f6
When a SSE
data:
doesn't have adelta
(null) theChoice[0].Delta
line throwsNullReferenceException
.Final 3 streaming chunks of an
Asynchornous Filter
response.This issue was reported in our Semantic Kernel Issues Here but actually seems to be a problem when Azure tries to use the
OpenAI SDK
for those chunks, this potentially can be handled byAzure SDK
library in a non-ideal (try catch block) or in the back-end (providing always an empty delta) but I wonder would be quicker/simple getting a fix in here.The problem also happen for other properties of the class as below:
To Reproduce
Role
property of the last 2 chunksSince the property is a pointer, we are unable to test it for null.
Code snippets
No response
OS
Windows 11
.NET version
.net 8
Library version
beta.10
The text was updated successfully, but these errors were encountered: