darrenburns / elia

A snappy, keyboard-centric terminal user interface for interacting with large language models. Chat with ChatGPT, Claude, Llama 3, Phi 3, Mistral, Gemma and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sent messages are rendered as markdown

The-Compiler opened this issue · comments

On the 0.5.0 release,

image

renders as:

image

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?

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