From 0455b12d9076271b60c220cfa64802faebd8a6f4 Mon Sep 17 00:00:00 2001 From: Hayden Johnson Date: Tue, 1 Oct 2024 13:00:32 -0700 Subject: [PATCH] Add indicator in chat log for assistant responses Now it is clear when the assistant responds in the terminal interface. --- assistant.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assistant.py b/assistant.py index 6c2835e..08e0db0 100755 --- a/assistant.py +++ b/assistant.py @@ -179,12 +179,15 @@ def chat2(args, user_input, stream=True): if parse_commands(user_input): result = '' elif args.reflect: + print('assistant: ', end='') result = reflection_mode(user_input, stream) else: + print('assistant: ', end='') result = chat(user_input, stream) - conversation += 'user: ' + user_input + '\n' - conversation += 'assistant: ' + result + '\n' + if result != '': + conversation += 'user: ' + user_input + '\n' + conversation += 'assistant: ' + result + '\n' return result def highlightify_text(full_text):