Skip to content

Commit 8080665

Browse files
CatherineSuewhybeyoung
authored andcommitted
feat(func_call): Add more check in BaseFormatDetector.parse_streaming_increment (sgl-project#7479)
1 parent 796662e commit 8080665

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

python/sglang/srt/function_call/base_format_detector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ def parse_streaming_increment(
142142
try:
143143
if current_text.startswith(self.bot_token):
144144
start_idx = len(self.bot_token)
145+
elif self.current_tool_id > 0 and current_text.startswith(
146+
self.tool_call_separator + self.bot_token
147+
):
148+
start_idx = len(self.tool_call_separator + self.bot_token)
145149
elif self.current_tool_id > 0 and current_text.startswith(
146150
self.tool_call_separator
147151
):

test/srt/openai_server/function_call/test_tool_choice.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,7 @@ class TestToolChoiceQwen25(TestToolChoiceLlama32):
468468

469469
@classmethod
470470
def setUpClass(cls):
471-
cls.flaky_tests = {
472-
"test_multi_tool_scenario_auto",
473-
"test_multi_tool_scenario_required",
474-
}
471+
cls.flaky_tests = {}
475472

476473
cls.model = "Qwen/Qwen2.5-7B-Instruct"
477474
cls.base_url = DEFAULT_URL_FOR_TEST

0 commit comments

Comments
 (0)