Commit d16f206e authored by Your Name's avatar Your Name

Add ToolCallParser fallback in ModelParserAdapter

When the model-specific parser (like QwenParser) doesn't find any
tool calls, fall back to ToolCallParser as a catch-all.
parent a7e992a0
......@@ -926,6 +926,11 @@ class ModelParserAdapter:
tool_calls = self._dispatcher.parse(text)
# Fallback: if no tool calls found, try using ToolCallParser
if not tool_calls:
tool_call_parser = ToolCallParser(model_name=self._model_name)
tool_calls = tool_call_parser.extract_tool_calls(text, available_tools)
if tool_calls:
for tc in tool_calls:
if 'id' not in tc:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment