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

pull/1148/head
墨梓柒 2025-07-28 19:26:31 +08:00
parent 5353a1e50d
commit 72bcbb95ea
No known key found for this signature in database
GPG Key ID: 4A65B9DBA35F7635
1 changed files with 1 additions and 1 deletions

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方法 ===