Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
34b6b842
Unverified
Commit
34b6b842
authored
Jun 23, 2025
by
Chang Su
Committed by
GitHub
Jun 23, 2025
Browse files
feat(func_call): Add more check in `BaseFormatDetector.parse_streaming_increment` (#7479)
parent
25549433
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
python/sglang/srt/function_call/base_format_detector.py
python/sglang/srt/function_call/base_format_detector.py
+4
-0
test/srt/openai_server/function_call/test_tool_choice.py
test/srt/openai_server/function_call/test_tool_choice.py
+1
-4
No files found.
python/sglang/srt/function_call/base_format_detector.py
View file @
34b6b842
...
@@ -142,6 +142,10 @@ class BaseFormatDetector(ABC):
...
@@ -142,6 +142,10 @@ class BaseFormatDetector(ABC):
try
:
try
:
if
current_text
.
startswith
(
self
.
bot_token
):
if
current_text
.
startswith
(
self
.
bot_token
):
start_idx
=
len
(
self
.
bot_token
)
start_idx
=
len
(
self
.
bot_token
)
elif
self
.
current_tool_id
>
0
and
current_text
.
startswith
(
self
.
tool_call_separator
+
self
.
bot_token
):
start_idx
=
len
(
self
.
tool_call_separator
+
self
.
bot_token
)
elif
self
.
current_tool_id
>
0
and
current_text
.
startswith
(
elif
self
.
current_tool_id
>
0
and
current_text
.
startswith
(
self
.
tool_call_separator
self
.
tool_call_separator
):
):
...
...
test/srt/openai_server/function_call/test_tool_choice.py
View file @
34b6b842
...
@@ -468,10 +468,7 @@ class TestToolChoiceQwen25(TestToolChoiceLlama32):
...
@@ -468,10 +468,7 @@ class TestToolChoiceQwen25(TestToolChoiceLlama32):
@
classmethod
@
classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
cls
.
flaky_tests
=
{
cls
.
flaky_tests
=
{}
"test_multi_tool_scenario_auto"
,
"test_multi_tool_scenario_required"
,
}
cls
.
model
=
"Qwen/Qwen2.5-7B-Instruct"
cls
.
model
=
"Qwen/Qwen2.5-7B-Instruct"
cls
.
base_url
=
DEFAULT_URL_FOR_TEST
cls
.
base_url
=
DEFAULT_URL_FOR_TEST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment