Debug: show raw API response when empty

This commit is contained in:
2026-08-16 23:26:13 -05:00
parent 8287efae0d
commit 1217bfae67
+4 -1
View File
@@ -172,7 +172,10 @@ class Assistant(commands.Cog):
try:
reply = data["choices"][0]["message"]["content"]
except (KeyError, IndexError):
return "Unexpected API response."
return f"Unexpected API response: {str(data)[:300]}"
if not reply:
return f"Empty response. Raw: {str(data)[:300]}"
self.history[key].append({"role": "assistant", "content": reply})