Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
be03cbe8
Commit
be03cbe8
authored
Mar 23, 2026
by
jujl1
Committed by
zhangzbb
Apr 01, 2026
Browse files
[BugFix] 合入官方pr,修复Qwen3/Qwen3.5 tool calling 不能正确调用工具的bug (github #36774)
parent
676545b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
vllm/tool_parsers/qwen3coder_tool_parser.py
vllm/tool_parsers/qwen3coder_tool_parser.py
+7
-4
No files found.
vllm/tool_parsers/qwen3coder_tool_parser.py
View file @
be03cbe8
...
...
@@ -243,7 +243,10 @@ class Qwen3CoderToolParser(ToolParser):
self
,
function_call_str
:
str
,
tools
:
list
[
ChatCompletionToolsParam
]
|
None
)
->
ToolCall
|
None
:
# Extract function name
end_index
=
function_call_str
.
index
(
">"
)
end_index
=
function_call_str
.
find
(
">"
)
# If there's no ">" character, this is not a valid xml function call
if
end_index
==
-
1
:
return
None
function_name
=
function_call_str
[:
end_index
]
param_config
=
self
.
_get_arguments_config
(
function_name
,
tools
)
parameters
=
function_call_str
[
end_index
+
1
:]
...
...
@@ -327,10 +330,10 @@ class Qwen3CoderToolParser(ToolParser):
idx
=
model_output
.
find
(
self
.
tool_call_prefix
)
content_index
=
content_index
if
content_index
>=
0
else
idx
content
=
model_output
[:
content_index
]
# .rstrip()
valid_tool_calls
=
[
tc
for
tc
in
tool_calls
if
tc
is
not
None
]
return
ExtractedToolCallInformation
(
tools_called
=
(
len
(
tool_calls
)
>
0
),
tool_calls
=
tool_calls
,
tools_called
=
(
len
(
valid_
tool_calls
)
>
0
),
tool_calls
=
valid_
tool_calls
,
content
=
content
if
content
else
None
,
)
...
...
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