Commit 3fd46920 authored by Your Name's avatar Your Name

Add Qwen format stripping in strip_tool_calls_from_content

parent 544896de
......@@ -822,6 +822,10 @@ class ModelParserAdapter:
if not text:
return text
# Remove Qwen format: <tool=func_name>...</tool_call> and <tool=func_name>...</tool>
text = re.sub(r'<tool=[^>]+>.*?</tool_call>', '', text, flags=re.DOTALL)
text = re.sub(r'<tool=[^>]+>.*?</tool>', '', text, flags=re.DOTALL)
# Remove <tool>...</tool> and <function>...</function> patterns
text = re.sub(r'<tool>.*?</tool>', '', text, flags=re.DOTALL)
text = re.sub(r'<function>.*?</function>', '', text, flags=re.DOTALL)
......
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