LibreChat
LibreChat copied to clipboard
Enhancement: Allow import/export function also for all chats
What features would you like to see added?
Export via .json for a single chat and import for that file work. Now allow an option of export all chats and import all chats.
(The other issue is more towards chatgpt move to librechat and not librechat to librechat.)
More details
Motivation : If a user want to switch an instance or just for ease of use for a single user instance withot mongo hassle. Really nice. E.g. trying other deployment types or as an easy backup. Really useful.
Current state: I tested a bit: I exported two chats, merged them in different ways in to one file and tried to import that file to look if both chats would be imported. I tried pasting them one behind the other, with "," and "," with addionally "[" and "]" at the beginning and end respectivly. At best, one chat is imported.
Implementation solution import : As the single import already works, it would be probably best to check if the imported .json is a list. If not import like it is now. If it is a list, iterate over each item and import each like it is now.
I'm currently not advanced in js, but it seems that this file might have something to do with it, but it's more the ui side: https://github.com/danny-avila/LibreChat/blob/d54458b3a6e946adfe9cd6bf4b127af51e4fcade/client/src/components/Nav/SettingsTabs/Data/ImportConversations.tsx#L52
This thing seems to have something to do with it: https://github.com/danny-avila/LibreChat/blob/d54458b3a6e946adfe9cd6bf4b127af51e4fcade/client/src/data-provider/mutations.ts#L547
__
Implementation solution export : For the export of all chats. Similar apprach. Iterate over all conversations, use the existing export function and add each to a list which is exported.
This file could have something to do with it: https://github.com/danny-avila/LibreChat/blob/d54458b3a6e946adfe9cd6bf4b127af51e4fcade/client/src/hooks/Conversations/useExportConversation.ts#L322
The ui for the all conversations export could be placed under the import conversations button (frirst pic below).
Which components are impacted by your request?
General
Pictures
Code of Conduct
- [X] I agree to follow this project's Code of Conduct