fix: 修复LLMRequest类中的思维链提取逻辑,确保正确获取推理内容

This commit is contained in:
墨梓柒
2025-07-28 19:26:31 +08:00
parent 5353a1e50d
commit 72bcbb95ea

View File

@@ -311,7 +311,7 @@ class LLMRequest:
"""CoT思维链提取"""
match = re.search(r"(?:<think>)?(.*?)</think>", content, re.DOTALL)
content = re.sub(r"(?:<think>)?.*?</think>", "", content, flags=re.DOTALL, count=1).strip()
reasoning = match.group(1).strip() if match else ""
reasoning = match[1].strip() if match else ""
return content, reasoning
# === 主要API方法 ===