-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[BugFix] Fix tool call finish reason in streaming case #9209
[BugFix] Fix tool call finish reason in streaming case #9209
Conversation
When a named function is passed to tool_choice with streaming the finish_reason was "stop" instead of "tool_calls". Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Actually, this behavior may be expected in the OpenAI spec 🤔
REF: https://platform.openai.com/docs/guides/function-calling/edge-cases |
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Yeah, I'll test to see what OpenAI returns. If that is the case, then it's the non-streaming case that is inconsistent. |
@tjohnson31415 , you're right. I've tested with gpt4 on the OpenAI platform and the behavior is as follows:
So actually the non-streaming case for named function needs to be changed to return stop instead of tool_calls |
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @maxdebayser!
…9209) Signed-off-by: Max de Bayser <mbayser@br.ibm.com> Signed-off-by: Alvant <alvasian@yandex.ru>
…9209) Signed-off-by: Max de Bayser <mbayser@br.ibm.com> Signed-off-by: Amit Garg <mitgarg17495@gmail.com>
…9209) Signed-off-by: Max de Bayser <mbayser@br.ibm.com> Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
…9209) Signed-off-by: Max de Bayser <mbayser@br.ibm.com>
…9209) Signed-off-by: Max de Bayser <mbayser@br.ibm.com> Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com>
When a named function is passed to tool_choice with streaming the finish_reason was "stop" instead of "tool_calls".