forked from open-webui/open-webui
Add chatGPT chat history Import functionality
This commit is contained in:
parent
5e32db1c57
commit
27d5eb4684
3 changed files with 73 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
|||
import { WEB_UI_VERSION, WEBUI_API_BASE_URL } from '$lib/constants';
|
||||
|
||||
import { config, models, settings, user, chats } from '$lib/stores';
|
||||
import { splitStream, getGravatarURL } from '$lib/utils';
|
||||
import { splitStream, getGravatarURL, getImportOrigin, convertGptChats } from '$lib/utils';
|
||||
|
||||
import Advanced from './Settings/Advanced.svelte';
|
||||
import Modal from '../common/Modal.svelte';
|
||||
|
@ -132,6 +132,9 @@
|
|||
reader.onload = (event) => {
|
||||
let chats = JSON.parse(event.target.result);
|
||||
console.log(chats);
|
||||
if (getImportOrigin(chats) == 'gpt') {
|
||||
chats = convertGptChats(chats);
|
||||
}
|
||||
importChats(chats);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue