nomic-ai / gpt4all

GPT4All: Run Local LLMs on Any Device. Open-source and available for commercial use.
https://nomic.ai/gpt4all
MIT License
70.93k stars 7.72k forks source link

[Feature] Export conversation (screenshot, JSON, HTML, ...) #2826

Open BurrHM opened 3 months ago

BurrHM commented 3 months ago

Feature Request

save current conversation as a screenshot.

Manual screenshotting takes a bit of time and can't be full-length (if the conversation is long).

thingsiplay commented 3 months ago

I would rather have a "Save conversation as HTML" option, as it retains the content and styling as text. At least as regular text files, if HTML is not possible.

SINAPSA-IC commented 3 months ago

Indeed, conversations should be regarded as memories/experiences worthy to remember, and keeping them in binary form, really unreadable outside the program, do not serve any human purpose, since 1) people want to be able to access their worthy memories and 2) there is no plain text in the saved chats that could be used as a LocalDocument in subsequent conversations. The user should be able to save their chats as plain text, for whatever reasons; binary is for computers.

thingsiplay commented 3 months ago

@SINAPSA-IC I just looked up what's inside the .chat file. It's almost normal text, but filled in with ton of null characters. The file can be converted to something readable very easy with sed (on Linux) or any program to strip out all null characters:

sed 's/\x0//g' filename.chat

It's not perfect, but gets the job done to be readable outside of the application. So this shouldn't be complicated to do, at least converting into regular text. The code parts from the chat output are even marked with correct format as toml or rust code.

SINAPSA-IC commented 3 months ago

image

VS2022 didn't even create an exception :)

thingsiplay commented 3 months ago

Hmm. I have converted it to .txt format this way and can open and read the text file in Vim. Some of the other non printable characters might be troublesome. Now I tried

sed 's/\x0//g' filename.chat | strings > filename.txt

to remove the rest of the non printable characters. Still not perfect, but it seems to be better.

BurrHM commented 3 months ago

@thingsiplay @SINAPSA-IC What you are saying is true and more durable, but sometimes you want something that can be easily shared online.

There is no reason we can't have both options.

brankoradovanovic-mcom commented 3 months ago

I would rather have a "Save conversation as HTML" option, as it retains the content and styling as text. At least as regular text files, if HTML is not possible.

Agree. Let me also suggest "Save conversation as JSON". When using Python bindings, saving the conversation as JSON is a one-liner, so perhaps this wouldn't be too difficult to implement. Of course, most users will probably prefer either plain text output or HTML.

cebtenzzre commented 3 months ago

By the way: You can always load the chat and use the "Copy chat session to clipboard" button at the bottom of the conversation view (hidden behind the three dots). Not the same as batch export to JSON, but trying to extract the text from the binary representation seems unnecessary. It would be a reasonable request to make this button available even for chats that are not loaded—that would be a separate issue.