Closed The-Compiler closed 6 months ago
It seems simple to fix this. If you change the part of the chatbox.py file as below
...
from rich.text import Text
...
@property
def markdown(self) -> Markdown:
return Markdown(self.message.content or "")
@property
def text(self) -> Text:
return Text(self.message.content or "")
def render(self) -> RenderableType:
if self.message.type == "human":
return self.text
else:
return self.markdown
...
There are three types of messages: human, ai, and system. I confirmed that the input was rendered as text and the output was rendered as markdown.
However, I cannot judge whether it makes sense. The code may become complicated, but it will also be possible to choose whether to render the user's input as markdown or text.
This has been fixed in 1.0.0
On the 0.5.0 release,
renders as:
And more generally, markdown is rendered in what the user types. However, ChatGPT does not interpret input as Markdown as far as I know, so it might make sense to display messages coming from the user as plain text entirely?