chat: improved history printing

This commit is contained in:
2023-09-02 08:18:41 +02:00
parent 96980bc4a8
commit 88766dd5ae
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -146,7 +146,7 @@ class Chat:
return sum(m.tokens() for m in self.messages)
def print(self, dump: bool = False, source_code_only: bool = False,
with_tags: bool = False, with_file: bool = False,
with_tags: bool = False, with_files: bool = False,
paged: bool = True) -> None:
if dump:
pp(self)
@@ -157,15 +157,15 @@ class Chat:
output.extend(source_code(message.question, include_delims=True))
continue
output.append('-' * terminal_width())
if with_tags:
output.append(message.tags_str())
if with_files:
output.append('FILE: ' + str(message.file_path))
output.append(Question.txt_header)
output.append(message.question)
if message.answer:
output.append(Answer.txt_header)
output.append(message.answer)
if with_tags:
output.append(message.tags_str())
if with_file:
output.append('FILE: ' + str(message.file_path))
if paged:
print_paged('\n'.join(output))
else: