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

save complete history #19

Open
monperrus opened this issue May 1, 2023 · 11 comments · Fixed by #27
Open

save complete history #19

monperrus opened this issue May 1, 2023 · 11 comments · Fixed by #27
Labels
enhancement New feature or request

Comments

@monperrus
Copy link
Contributor

thanks for the great repo.

right now, we may lose interesting chatgpt answers if we don't copy-paste.

to solve this problem, it would be great to save the history of both prompts and answers (and model version and query date for traceability).

@marcolardera marcolardera added the enhancement New feature or request label May 4, 2023
@marcolardera
Copy link
Owner

Thank you for the feedback, it's on my to-do list ;)

@mk-pmb
Copy link

mk-pmb commented May 20, 2023

Thanks for this great tool! It helped me a lot today. I'd be interested in the logging as well. I tried using this workaround:

rlwrap "python3 ./chatgpt.py | tee --append -- logs/$(date +%y%m%d.%H%M%S).$$.log"

but that doesn't fly with the fancy output formatting.

Also I noticed there are seemingly-random numbers in front of my prompts. I guess they are for somehow referencing earlier prompts in the current conversation. Maybe we can log them in a way that makes them usable accross sessions?

@marcolardera
Copy link
Owner

marcolardera commented May 20, 2023

The "random numbers" are the number of token used for that session, as mentioned in the README.

There is no way for ChatGPT to continue a conversation from a previous session, unless you save the message history and push it in the new prompt BUT there is the token limit to take in account (4096 for gpt 3.5 turbo, more for gpt 4).

I will implement the save/restore feature in the future but that doesen't mean that you will be able to continue a conversation with ChatGPT forever because at a certain point you will hit the token limit.

@andrius
Copy link

andrius commented May 24, 2023

It's would be definitely a great thing:

  1. to save current dialog to the .md file (i.e. /save foobar.md);
  2. to load context (/load foobar.md or /context foobar.md)

@mk-pmb
Copy link

mk-pmb commented May 28, 2023

  1. an option for a path where to save by default.

@marcolardera
Copy link
Owner

With #27 now chat history is automatically saved in json format.

However, there are still two features to made in order to have this issue closed:

  1. Import previous chat in order to restart the conversation from that point
  2. Option to export in a more human readable format (txt or markdown)

@marcolardera marcolardera reopened this Jun 2, 2023
@marcolardera
Copy link
Owner

Update:

I just committed 4b790b1

This introduces the capability of restoring a previous chat session. See README for details. I think this works quite nicely but please give me any feedback :)

@mk-pmb

This comment was marked as spam.

@mk-pmb
Copy link

mk-pmb commented Jul 28, 2023

Sorry for my accidential spam post a minute ago. (The license warning was meant for another project.)
I'd prefer "latest" or "prev" or "previous" for restoring the latest saved session, because "last" evokes (at least in me) a faint notion of doom.

@mk-pmb
Copy link

mk-pmb commented Jul 29, 2023

I now had opportunity to test it, and it works as expected. Thanks! 👍

@dwymark
Copy link
Contributor

dwymark commented Nov 27, 2023

It would be nice if restoring a conversation printed all of the messages that were exchanged in that conversation. I know you would have to look at the JSON to know which conversation is which (other than last), but it would still be a nice convenience IMO.

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.

5 participants