wip: Changed append_chat_history to use blockquote instead of italics.

This commit is contained in:
Paul Gauthier 2023-05-13 13:17:40 -07:00
parent da19845706
commit 06818156cf

View file

@ -170,7 +170,7 @@ class InputOutput:
res = prompt(question + " ", default=default) res = prompt(question + " ", default=default)
hist = f"{question.strip()} {res.strip()}" hist = f"{question.strip()} {res.strip()}"
self.append_chat_history(hist, linebreak=True, italics=True) self.append_chat_history(hist, linebreak=True, blockquote=True)
if not res or not res.strip(): if not res or not res.strip():
return return
@ -183,14 +183,14 @@ class InputOutput:
res = prompt(question + " ", default=default) res = prompt(question + " ", default=default)
hist = f"{question.strip()} {res.strip()}" hist = f"{question.strip()} {res.strip()}"
self.append_chat_history(hist, linebreak=True, italics=True) self.append_chat_history(hist, linebreak=True, blockquote=True)
return res return res
def tool_error(self, message): def tool_error(self, message):
if message.strip(): if message.strip():
hist = f"{message.strip()}" hist = f"{message.strip()}"
self.append_chat_history(hist, linebreak=True, italics=True) self.append_chat_history(hist, linebreak=True, blockquote=True)
message = Text(message) message = Text(message)
self.console.print(message, style="red") self.console.print(message, style="red")
@ -199,15 +199,15 @@ class InputOutput:
if messages: if messages:
hist = " ".join(messages) hist = " ".join(messages)
hist = f"{hist.strip()}" hist = f"{hist.strip()}"
self.append_chat_history(hist, linebreak=True, italics=True) self.append_chat_history(hist, linebreak=True, blockquote=True)
messages = list(map(Text, messages)) messages = list(map(Text, messages))
self.console.print(*messages) self.console.print(*messages)
def append_chat_history(self, text, linebreak=False, italics=False): def append_chat_history(self, text, linebreak=False, blockquote=False):
if italics: if blockquote:
text = text.strip() text = text.strip()
text = f'_{text}_' text = '> ' + text
if linebreak: if linebreak:
text = text.rstrip() text = text.rstrip()
text = text + " \n" text = text + " \n"