diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 6d80629e0..44ee67957 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1721,7 +1721,7 @@ class Coder: def show_send_output_stream(self, completion): received_content = False - + for chunk in completion: if len(chunk.choices) == 0: continue @@ -1765,9 +1765,9 @@ class Coder: sys.stdout.write(safe_text) sys.stdout.flush() yield text - + if not received_content: - self.io.tool_warning("Empty response received from LLM.") + self.io.tool_warning("Empty response received from LLM. Check your provider account?") def live_incremental_response(self, final): show_resp = self.render_incremental_response(final) diff --git a/aider/io.py b/aider/io.py index ecab5a697..d328b6bb3 100644 --- a/aider/io.py +++ b/aider/io.py @@ -933,6 +933,10 @@ class InputOutput: return mdStream def assistant_output(self, message, pretty=None): + if not message: + self.tool_warning("Empty response received from LLM. Check your provider account?") + return + show_resp = message # Coder will force pretty off if fence is not triple-backticks @@ -944,7 +948,7 @@ class InputOutput: message, style=self.assistant_output_color, code_theme=self.code_theme ) else: - show_resp = Text(message or "") + show_resp = Text(message or "(empty response)") self.console.print(show_resp)