-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[BugFix] Fix tool call finish reason in streaming case #9209
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
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 <[email protected]>
|
👋 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 <[email protected]>
|
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Max de Bayser <[email protected]>
njhill
left a comment
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 <[email protected]> Signed-off-by: Alvant <[email protected]>
…9209) Signed-off-by: Max de Bayser <[email protected]> Signed-off-by: Amit Garg <[email protected]>
…9209) Signed-off-by: Max de Bayser <[email protected]> Signed-off-by: Sumit Dubey <[email protected]>
…9209) Signed-off-by: Max de Bayser <[email protected]> Signed-off-by: LeiWang1999 <[email protected]>
When a named function is passed to tool_choice with streaming the finish_reason was "stop" instead of "tool_calls".