diff --git a/assistant/assistant.py b/assistant/assistant.py index 62eefaf..ce43901 100644 --- a/assistant/assistant.py +++ b/assistant/assistant.py @@ -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})