From bec5891083cd8674107373dfaa93355a27876616 Mon Sep 17 00:00:00 2001 From: ehuaa Date: Sat, 21 Jun 2025 13:50:08 +0800 Subject: [PATCH] [BugFix]fix qwen25 invoke function call streaming responses with curly braces as the starting indicator (#7394) --- python/sglang/srt/function_call/base_format_detector.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/sglang/srt/function_call/base_format_detector.py b/python/sglang/srt/function_call/base_format_detector.py index cdd7b4607..3c0c2ff21 100644 --- a/python/sglang/srt/function_call/base_format_detector.py +++ b/python/sglang/srt/function_call/base_format_detector.py @@ -111,8 +111,7 @@ class BaseFormatDetector(ABC): # The current_text has tool_call if it is the start of a new tool call sequence # or it is the start of a new tool call after a tool call separator, when there is a previous tool call if not ( - self.bot_token in current_text - or current_text.startswith("{") + self.has_tool_call(current_text) or ( self.current_tool_id > 0 and current_text.startswith(self.tool_call_separator + "{")