-
-
Couldn't load subscription status.
- Fork 10.8k
[BugFix] enable DOTALL to match multi-line tool_call parameters in extract_tool_call_required_streaming #24668
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
Conversation
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.
Code Review
The pull request enables the re.DOTALL flag in the extract_tool_call_required_streaming function to correctly match multi-line tool call parameters. This fixes an issue where newline characters within the parameters would cause incorrect parsing. I have added a review comment to highlight the importance of this fix.
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run You ask your reviewers to trigger select CI tests on top of 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 either: Add If you have any questions, please reach out to us on Slack at https://slack.vllm.ai. 🚀 |
…l_call_required_streaming Signed-off-by: Shijun Yin <[email protected]>
|
It looks reasonable—could you please post the code for the reproduction steps? |
Prerequisites: #23312 (to avoid duplicate tokens, which is another bug) Log from the client:
The arguments in the first Delta message for the second tool call should be And if the following debug log is added in extract_tool_call_required_streaming Then the log from the server:
The BUG can be fixed after adding
|
|
@chaunceyjiang any 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.
LGTM
@chaunceyjiang seems like the workflows still need approval from a maintainer lol |
…tract_tool_call_required_streaming (vllm-project#24668) Signed-off-by: Shijun Yin <[email protected]>
…tract_tool_call_required_streaming (vllm-project#24668) Signed-off-by: Shijun Yin <[email protected]> Signed-off-by: charlifu <[email protected]>
…tract_tool_call_required_streaming (vllm-project#24668) Signed-off-by: Shijun Yin <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
…tract_tool_call_required_streaming (vllm-project#24668) Signed-off-by: Shijun Yin <[email protected]>
…tract_tool_call_required_streaming (vllm-project#24668) Signed-off-by: Shijun Yin <[email protected]> Signed-off-by: xuebwang-amd <[email protected]>
Purpose
The original regex in extract_tool_call_required_streaming will meet trouble if there is
\nbetween two tool calls in current_text.In that case, the first tool call parameters will always be captured so that the delta messages will be incorrect starting from the second tool call.
It can be simply fixed by adding re.DOTALL as parameter.
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.