mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #498] [MERGED] Feat: Add ChatGPT import functionality #59209
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/498
Author: @bhulston
Created: 1/17/2024
Status: ✅ Merged
Merged: 1/17/2024
Merged by: @tjbck
Base:
main← Head:fix/chat-imports📝 Commits (6)
27d5eb4Add chatGPT chat history Import functionality415777eAdd error catching for import81bfb97Make sure model is saved in DB for imported chats (or chats with no model saved already)1f66bbbBetter solution to handle edge casesf40147crefac: gpt renamed to openaib6ab357fix: more edge cases📊 Changes
4 files changed (+110 additions, -21 deletions)
View changed files
📝
backend/apps/web/routers/chats.py(+22 -18)📝
src/lib/components/chat/SettingsModal.svelte(+8 -1)📝
src/lib/utils/index.ts(+71 -0)📝
src/routes/(app)/c/[id]/+page.svelte(+9 -2)📄 Description
For this issue: https://github.com/ollama-webui/ollama-webui/issues/337
Enable imports of ChatGPT histories (conversations.json), and ability to choose a new model upon import.
Added several functions to
src/lib/utils/index.tsthat are used at import before sending tocreateNewChatapia) Identify if import is a chatGPT one or Ollama-webui one (as they are very different)
b) Parses and iterates through the chatGPT json to match the ollama-webui chat structure
Make sure new chats work with existing code
a) Adjusted the "disabled" tag to let you choose what model to use for new chat
b) Add one more check when message is sent that saves selectedModel when current saved model is different
- With imported models, messages already exist but no model exists! so need to update. or if you import chats using models that you don't have (i.e. 'gpt-3.5-turbo')
** Note **: When we import from ChatGPT, we don't default to a model so users aren't forced to use chatgpt
Does not import context (i.e. pdf RAG) info from GPT chats.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.