Simatwa / python-tgpt

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

Autonaming Chats and some minor issues. #4

Closed sameedzahoor closed 8 months ago

sameedzahoor commented 9 months ago

I think python-tgpt is going to be big. Great work so far. Here are a few suggestions for improvements:

  1. -s mode should have conversation flag disabled by default. While the optimiser for the -s mode was good enough for ChatGPT, LLama does a funny thing by responding with 'Sure! Here's the thing you need ... blah blah blah' before the actual answer. I found the following addition to the optimiser useful for the -s mode : “Respond in only one line. You are allowed to use semi-colon to combine commands to respond in a single line. Do not include any line starting with 'Sure' in your response.”
  2. I was wondering if we could have automatic naming of conversations rather than specifying the chat file manually everytime we have a chat. We would need the following:
    • A command such as tgpt new chat_name which creates a file named chat_name in the cache and will set this file to the current active chat.
    • If the command tgpt new is called without the argument chat_name, a temporary chat file will be created in the cache. After the first prompt (it could the be the second or the third prompt as well, tell me what you think would be a good choice) a request will be sent to the model asking it to name the chat. Something like this : “Suggest a filename for the chat so far. Make sure there are no spaces in the filename.” The model's response will have to be post processed (remove the 'Sure! Here is the thing ... blah blah blah') to get the chat_name. This chat_name will now become the current active chat.
    • We might need to check if the file with the same name exists in the cache and if so modify the name to avoid overwriting existing chats.
    • One could use a command such as tgpt select chat_name to select a chat from the existing chats to continue the same. One could use it in conjunction with a utility such as fzf to get a menu to select chats from. (One can literally use ls .cache/tgpt/ | fzf and select the file from the menu). We could in theory sort the items in the cache by file modification times to have the latest chats at the top. Since fzf supports search it would make searching chats very easy if the cache gets too large.
Simatwa commented 9 months ago

Awesome suggestions folk. This gonna have a big positive impact. They'll be implemented anytime from now.

sameedzahoor commented 9 months ago

The only bit that has not been implemented is the autonaming bit. The rest has been implemented in szl.

github-actions[bot] commented 8 months ago

Bumping this issue because it has been open for 14 days with no activity. Closing automatically in 14 days unless it becomes active again.

github-actions[bot] commented 8 months ago

Closing due to inactivity.