From cdba3579d66956d356c424945a346a0f044facea Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Tue, 18 Apr 2023 19:38:26 +0200 Subject: empty message warning, reference #20 --- py/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'py') diff --git a/py/utils.py b/py/utils.py index 2da0302..9539d84 100644 --- a/py/utils.py +++ b/py/utils.py @@ -36,12 +36,16 @@ def make_http_options(options): def render_text_chunks(chunks): generating_text = False + full_text = '' for text in chunks: if not text.strip() and not generating_text: continue # trim newlines from the beginning generating_text = True vim.command("normal! a" + text) vim.command("redraw") + full_text += text + if not full_text.strip(): + print_info_message('Empty response received. Tip: You can try modifying the prompt and retry.') def parse_chat_messages(chat_content): lines = chat_content.splitlines() -- cgit v1.2.3