Remove reasoning_content fallback - don't expose internal thinking

This commit is contained in:
2026-08-16 23:43:15 -05:00
parent a5c5d29ded
commit 7eb96c6e65
+2 -7
View File
@@ -172,15 +172,10 @@ class Assistant(commands.Cog):
try: try:
choice = data["choices"][0]["message"] choice = data["choices"][0]["message"]
reply = choice.get("content") or "" reply = choice.get("content") or ""
# Some models (e.g. DeepSeek) put their response in reasoning_content
if not reply.strip():
reasoning = choice.get("reasoning_content") or ""
if reasoning.strip():
reply = reasoning
except (KeyError, IndexError): except (KeyError, IndexError):
return f"Unexpected API response: {str(data)[:300]}" return "Unexpected API response."
if not reply or not reply.strip(): if not reply.strip():
return "The model returned an empty response. Try rephrasing or switching models." return "The model returned an empty response. Try rephrasing or switching models."
self.history[key].append({"role": "assistant", "content": reply}) self.history[key].append({"role": "assistant", "content": reply})