Add --refine option to continue a conversation
With --resume or -r shell_gpt will now continue the most recently used conversation.
Disadvantage:
- Every conversation, even if not named, will be given a
chat_idand cached.
Example:

Closes #78
This is not very efficient, we will just store all messages, and spam the system with JSON files. It can be implemented in much more efficient way. I think we can just keep track of only last prompt passed to sgpt and OpenAI response. When user calls sgpt -r ... we can get that last prompt with reponse and make a chat session assigning to it some id. All following queries sgpt -r ... should be included on that single file and as soon as user stopped passing -r we delete that file.
# We are storing this query/response as last message, and keep overwriting it.
sgpt "remember my favorite number: 6"
# -> I will remember your favorite number ...
# Here we are starting new chat session with previous prompt and response and including this one.
sgpt -r "what is my favorite number + 2
# -> ... 8
# Keep adding messages to the chat session.
sgpt -r "what is my favorite number + 24
# -> ... 30
# When user doesn't pass -r delete resumable chat session.
# Also we will save this as our last prompt and response for it.
sgpt "some random query"
Thanks for the suggestion.
Oh, I get it. You want -r to work on named chat sessions too.
~Reading this:~
~> we can get that last prompt with reponse and make a chat session assigning to it some id~
~it sounds like two different files, or at least two different states: 1. last initial prompt+response, and 2. latest resumed chat session.~
~I wonder if we can simplify it to one file, a chat session called perhaps latest-unnamed, which might have only 1. query-response, or might have many.~
~If we make an unnamed request without -r then this session would be overwritten to have just 1 entry. If we use -r we would resume this session, by using latest-unnamed as the chat_id.~
~Would that be an acceptable solution?~
~Advantage: Simple. No need to store state about which chat session -r will refer to (initial or resumed).~
~Disadvantage: These resumed chats will not be given a random chat_id so they will be overwritten when a new query is made. Perhaps you prefer resumed chats to be retained in their own chat_id for posterity?~
~I can implement either way. (I hope. I am traveling next week.)~
It now tracks the latest unnamed query in a chat session called unnamed. If -r is used then that session will given a name / chat id. -r can also be used to continue a previously named session.
I renamed "resume" to "refine", to use the same language as interactive mode.
Currently, if both -r and --chat are provided, then it will use the --chat chat_id, rather than the latest conversation. (-r is ignored)

I like the date and time idea. I think that will be a great placeholder until we have some kind of a background process system to manage running little commands to make the user experience better.
https://github.com/TheR1D/shell_gpt/pull/94