-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
finish_reason
not set in AzureOpenAIChatCompletionClient.create_stream
#4213
Comments
I think the behavior should be just to set finished reason to unknown in this case. Under the hood simply skip the empty chunks. Having to this parameter is too confusing and error prone. |
If not more specific reason is known then unknown is the right thing to set it to. I agree on removing empty chunks, kinda feels like some sort of bug on their end and we should smooth it over in our client |
I have seen this happens whenever the endpoint is probably under a lot of loads. For example, now the hugging face interference API often gives this error. Another thing for removing this from To reduce complexity of the interface let's remove this all together and just handle empty chunks by skipping. @MohMaz |
I agree with defaulting to an unknown finish reason if a better one is not available. I can create a PR to clean this up. The only catch that might happen is, if the API keeps returning empty chunks, we will get stuck in a loop, which I think should not be considered as an AutoGen bug that needs a fix. |
I think in this case we can throw a warning once we get, say, 10 empty chunks in a row. This will remind the users that there is something not right going on and need to address it separately from the library.
Yes please thanks! |
What happened?
The provided code snippet works fine for the
.create
call ofAzureOpenAIChatCompletionClient
, but errors on.create_stream
call:What did you expect to happen?
I expected to get some reasonable response from
.create_stream
call as well.How can we reproduce it (as minimally and precisely as possible)?
AutoGen version
0.4.0.dev6
Which package was this bug in
Extensions
Model used
gpt-4o
Python version
3.11.10
Operating system
macOS Sequoia Version 15.1 (24B83)
Any additional info you think would be helpful for fixing this bug
No response
The text was updated successfully, but these errors were encountered: