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
8a6e108e
Unverified
Commit
8a6e108e
authored
Aug 05, 2025
by
tlipoca9
Committed by
GitHub
Aug 04, 2025
Browse files
fix: kimi_k2 return empty tool call list (#22149)
Signed-off-by:
tlipoca9
<
tlipoca9@gmail.com
>
parent
d7b28f34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py
vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py
+4
-4
No files found.
vllm/entrypoints/openai/tool_parsers/kimi_k2_tool_parser.py
View file @
8a6e108e
...
@@ -38,15 +38,15 @@ class KimiK2ToolParser(ToolParser):
...
@@ -38,15 +38,15 @@ class KimiK2ToolParser(ToolParser):
self
.
tool_call_end_token
:
str
=
"<|tool_call_end|>"
self
.
tool_call_end_token
:
str
=
"<|tool_call_end|>"
self
.
tool_call_regex
=
re
.
compile
(
self
.
tool_call_regex
=
re
.
compile
(
r
"<\|tool_call_begin\|>\s*(?P<tool_call_id>
[\w\.]
+:\d+)\s*<\|tool_call_argument_begin\|>\s*(?P<function_arguments>.*?)\s*<\|tool_call_end\|>"
r
"<\|tool_call_begin\|>\s*(?P<tool_call_id>
.
+:\d+)\s*<\|tool_call_argument_begin\|>\s*(?P<function_arguments>.*?)\s*<\|tool_call_end\|>"
)
)
self
.
stream_tool_call_portion_regex
=
re
.
compile
(
self
.
stream_tool_call_portion_regex
=
re
.
compile
(
r
"(?P<tool_call_id>
[\w\.]
+:\d+)\s*<\|tool_call_argument_begin\|>\s*(?P<function_arguments>.*)"
r
"(?P<tool_call_id>
.
+:\d+)\s*<\|tool_call_argument_begin\|>\s*(?P<function_arguments>.*)"
)
)
self
.
stream_tool_call_name_regex
=
re
.
compile
(
self
.
stream_tool_call_name_regex
=
re
.
compile
(
r
"(?P<tool_call_id>
[\w\.]
+:\d+)\s*"
)
r
"(?P<tool_call_id>
.
+:\d+)\s*"
)
if
not
self
.
model_tokenizer
:
if
not
self
.
model_tokenizer
:
raise
ValueError
(
raise
ValueError
(
...
@@ -374,4 +374,4 @@ class KimiK2ToolParser(ToolParser):
...
@@ -374,4 +374,4 @@ class KimiK2ToolParser(ToolParser):
except
Exception
:
except
Exception
:
logger
.
exception
(
"Error trying to handle streaming tool call."
)
logger
.
exception
(
"Error trying to handle streaming tool call."
)
return
None
# do not stream a delta. skip this token ID.
return
None
# do not stream a delta. skip this token ID.
\ No newline at end of file
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