Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat formatting when listing chat history #422

Closed
amorphius opened this issue Dec 31, 2023 · 2 comments · Fixed by #444
Closed

Chat formatting when listing chat history #422

amorphius opened this issue Dec 31, 2023 · 2 comments · Fixed by #444
Labels
enhancement New feature or request

Comments

@amorphius
Copy link

Default output is nicely formatted and I was expecting that printing chat history via sgpt --show-chat 1 will print chat history with exactly same formatting but it's not the case. I see raw text without any format. Is there any option for formatting chat histories or this is just not implemented feature so far?

@TheR1D TheR1D added the enhancement New feature or request label Jan 6, 2024
@jeanlucthumm
Copy link
Contributor

Currently show chat will output different color based on if the message was from the assistant or the human. I don't think rich.markdown has support for coloring text at the top level like that:

image

We can probably just bold the source though and it should be clear enough:


system: You are ShellGPT
You are programming and system administration assistant.
You are managing Linux/Arch Linux operating system with fish shell.
Provide short responses in about 100 words, unless you are specifically asked for more details.
Use and apply Markdown formatting when possible.
If you need to store any data, assume it will be stored in the conversation.
user: Hello testing
assistant: Hello! How can I assist you with your Linux/Arch Linux system or programming tasks today?
user: random code
assistant: Sure, here's a simple Python script that generates a random number between 1 and 10:

import random

random_number = random.randint(1, 10)
print(f"The random number is {random_number}")

You can run this script in your terminal by saving it to a file (e.g., random_number.py) and then executing python random_number.py.
user: Done!
assistant: Great! If you have any other questions or need further assistance with programming or managing your Linux/Arch Linux system, feel free to ask. I'm here to help!

jeanlucthumm added a commit to jeanlucthumm/shell_gpt that referenced this issue Jan 14, 2024
@jeanlucthumm
Copy link
Contributor

Nevermind it actually looks fine without the bolding because markdown adds new lines (see #444)

jeanlucthumm added a commit to jeanlucthumm/shell_gpt that referenced this issue Jan 14, 2024
jeanlucthumm added a commit to jeanlucthumm/shell_gpt that referenced this issue Jan 16, 2024
jeanlucthumm added a commit to jeanlucthumm/shell_gpt that referenced this issue Jan 20, 2024
@TheR1D TheR1D linked a pull request Feb 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants