Feat: support disable tool parser (#10184)

This commit is contained in:
Xinyuan Tong
2025-09-10 14:03:55 -07:00
committed by GitHub
parent 2286e85e77
commit f3b5db6ee8
2 changed files with 26 additions and 16 deletions

View File

@@ -332,7 +332,7 @@ class ServingChatTestCase(unittest.TestCase):
"""Ensure non-streaming tool_call.id matches functions.{name}:{index} for kimi_k2 parser."""
# Force kimi_k2 parser
self.tm.server_args.tool_call_parser = "kimi_k2"
self.chat.tool_call_parser = "kimi_k2"
# Mock FunctionCallParser.parse_non_stream to return one tool call
with patch(
@@ -357,7 +357,6 @@ class ServingChatTestCase(unittest.TestCase):
tool_calls, remaining_text, _ = self.chat._process_tool_calls(
text="<|tool_calls_section_begin|>...",
tools=tools,
tool_call_parser="kimi_k2",
finish_reason=finish_reason,
)
@@ -370,7 +369,7 @@ class ServingChatTestCase(unittest.TestCase):
"""Ensure streaming first chunk tool_call.id matches functions.{name}:{index} for kimi_k2 parser."""
# Force kimi_k2 parser
self.tm.server_args.tool_call_parser = "kimi_k2"
self.chat.tool_call_parser = "kimi_k2"
# Prepare request with tools
req = ChatCompletionRequest(