jepler / chap

chap - A Python interface to chatgpt, including a terminal user interface (tui)
15 stars 2 forks source link

basic import from chatgpt #4

Closed jepler closed 1 year ago

jepler commented 1 year ago

This understands the format produced by https://github.com/pionxzh/chatgpt-exporter and exports every branch of the conversation to a separate chap session.

peterkaminski commented 1 year ago

I've tried import with various conversations exported with ChatGPT Exporter, and it works great.

The one small enhancement request I have: be able to specify an output path for the session file. To use the same flags supported by tui, that might be -n:

chap import -n my_conversations/Bedtime_Story.json ~/Downloads/chatgpt-export-json-20230330/Bedtime_Story.json

But that's not needed to ship this PR, import works great and will be very helpful.

jepler commented 1 year ago

Thanks for testing! I just updated it with the ability to specify the output location (--output-directory) but not the filename itself. But since I also added importing every branch of the conversation it's not really possible to use a single filename...

peterkaminski commented 1 year ago

Importing all branches and specifying -o is great!

Don't let me slow you down, but wdyt:

Just ideas, not demands. :)

jepler commented 1 year ago

now the output filename will be based on the input filename + branch uuid

and chatgpt sessions without a title will not cause an import error. I had at least one session without a title.

peterkaminski commented 1 year ago

Wow, perfect! 💯