[PR #486] [MERGED] Fix/chat imports #7145

Closed
opened 2025-11-11 17:18:13 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/486
Author: @bhulston
Created: 1/16/2024
Status: Merged
Merged: 1/16/2024
Merged by: @tjbck

Base: mainHead: fix/chat-imports


📝 Commits (2)

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 src/lib/components/chat/SettingsModal.svelte (+1 -1)
📝 src/routes/(app)/c/[id]/+page.svelte (+2 -2)

📄 Description

Relating to this issue: https://github.com/ollama-webui/ollama-webui/issues/337

It seems like chat imports are not working for ollama in general. The fix for this was pretty simple:

  1. Send correct object to the backend router to match insert_new_chat method
    a. Instead we send chat.chat, also called chatContent elsewhere in the repo, which matches the dict structure used when creating brand new chats.

** Note **: Maybe we should just create a new class method for importing chats to use in the importChats function in SettingsModal.svelte? As of now, we lose all original information from imports since it uses the insert_new_chat method from here backend/apps/web/models/chats.py, when instead, we could directly import the original chat id and chat user id and timestamp. But this is a very small QOL difference.

  1. Add import of necessary function and correct to chatContent.models.
    a. Model was not loading on import because key is models, not model, so I fixed that too.
    a. page.svelte was missing a function for converting messages to history.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/486 **Author:** [@bhulston](https://github.com/bhulston) **Created:** 1/16/2024 **Status:** ✅ Merged **Merged:** 1/16/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/chat-imports` --- ### 📝 Commits (2) - [`3b7775a`](https://github.com/open-webui/open-webui/commit/3b7775a5356ddb5e0a3c95cb633824ae9d1edf25) Fix chat import bug - [`4b3acfa`](https://github.com/open-webui/open-webui/commit/4b3acfa49167c92e8063baac28458cf4bf3a32d5) Remove console logs ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/components/chat/SettingsModal.svelte` (+1 -1) 📝 `src/routes/(app)/c/[id]/+page.svelte` (+2 -2) </details> ### 📄 Description Relating to this issue: https://github.com/ollama-webui/ollama-webui/issues/337 It seems like chat imports are not working for ollama in general. The fix for this was pretty simple: 1. Send correct object to the backend router to match `insert_new_chat` method a. Instead we send chat.chat, also called chatContent elsewhere in the repo, which matches the dict structure used when creating brand new chats. ** Note **: Maybe we should just create a new class method for importing chats to use in the importChats function in SettingsModal.svelte? As of now, we lose all original information from imports since it uses the `insert_new_chat` method from here `backend/apps/web/models/chats.py`, when instead, we could directly import the original chat id and chat user id and timestamp. But this is a very small QOL difference. 2. Add import of necessary function and correct to chatContent.models. a. Model was not loading on import because key is `models`, not `model`, so I fixed that too. a. page.svelte was missing a function for converting messages to history. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:18:13 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#7145