Simatwa / python-tgpt

AI Chat in Terminal + Package + REST-API
https://python-tgpt.onrender.com
MIT License
102 stars 15 forks source link

About background of code blocks #8

Closed sameedzahoor closed 7 months ago

sameedzahoor commented 8 months ago

Is there a way to have syntax highlighting without having black background (or another theme background for that matter)? Most terminal users usually have terminal transparency enabled just for the looks of it. Perhaps there could be a flag that keeps the syntax highlighting but disables the background.

Simatwa commented 8 months ago

That's an issue with how the LLM generates responses. It doesn't exclusively specify the code language required to provide syntax highlighting.

It generates something like this :

``
def greet_user(name):
   print('Hello ',name)

greet_user('Example')
``

Instead of :

``python
def greet_user(name):
   print('Hello ',name)

greet_user('Example')
``

Prompting it to do so might help.

sameedzahoor commented 8 months ago

Can we have more themes? More dark themes actually. There is a nice theme called material. Maybe you could add it.

Simatwa commented 7 months ago

Is it specifically for code blocks or the whole response?

sameedzahoor commented 7 months ago

Code blocks mainly. When I keep the flag --raw on, it solves most of the problems. Code blocks still have syntax highlighting.

Simatwa commented 7 months ago

Unfortunately, click features only few themes for code blocks which are already implemented.