From a7a817d12b74817376447617569c03c62da16302 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Mon, 26 Feb 2024 19:34:43 +0900 Subject: [PATCH 01/13] chore: update Models.svelte HuggingFace -> Hugging Face --- src/lib/components/chat/Settings/Models.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/Models.svelte b/src/lib/components/chat/Settings/Models.svelte index 455927df..92e6b7dd 100644 --- a/src/lib/components/chat/Settings/Models.svelte +++ b/src/lib/components/chat/Settings/Models.svelte @@ -580,7 +580,7 @@ type="url" required bind:value={modelFileUrl} - placeholder="Type HuggingFace Resolve (Download) URL" + placeholder="Type Hugging Face Resolve (Download) URL" /> {/if} From bbeaa929041d46c59694798899a13ace46039cd2 Mon Sep 17 00:00:00 2001 From: Sakkus Date: Mon, 26 Feb 2024 12:25:08 +0000 Subject: [PATCH 02/13] Fix OpenAI integration: from docker on mac get errors since num_ctx not recognized; remove num_ctx from, and max_tokens to, body in API calls. --- backend/apps/openai/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index 36326430..5612e7dc 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -146,6 +146,15 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)): body["max_tokens"] = 4000 print("Modified body_dict:", body) + # Fix for ChatGPT calls failing because the num_ctx key is in body + if 'num_ctx' in body: + # If 'num_ctx' is in the dictionary, delete it + # Leaving it there generates an error with the + # OpenAI API (Feb 2024) + del body['num_ctx'] + # OpenAI API (Feb 2024) accepts max_tokens + body["max_tokens"] = 1600 + # Convert the modified body back to JSON body = json.dumps(body) except json.JSONDecodeError as e: From 70f807e8c9287427bee65ed64209204d4916dced Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:51:12 +0100 Subject: [PATCH 03/13] Added star-history Added https://star-history.com/#open-webui/open-webui&Date --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7c40239c..0b346853 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,16 @@ This project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LI If you have any questions, suggestions, or need assistance, please open an issue or join our [Open WebUI Discord community](https://discord.gg/5rJgQTnV4s) to connect with us! 🤝 +## Star History + + + + + + Star History Chart + + + --- Created by [Timothy J. Baek](https://github.com/tjbck) - Let's make Open Web UI even more amazing together! 💪 From 7c7e16c382941cb3571a5b682cef0d0c217c3c68 Mon Sep 17 00:00:00 2001 From: Jannik Streidl Date: Tue, 27 Feb 2024 13:30:03 +0100 Subject: [PATCH 04/13] added focus selector --- src/lib/components/chat/MessageInput.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 67bb3d88..e6ca374d 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -293,6 +293,9 @@ }; onMount(() => { + const chatInput = document.getElementById('chat-textarea'); + chatInput?.focus(); + const dropZone = document.querySelector('body'); const onDragOver = (e) => { From d24b6fa9af403ba0f47a0c396e1771b7b2ad8364 Mon Sep 17 00:00:00 2001 From: Jannik Streidl Date: Tue, 27 Feb 2024 15:05:38 +0100 Subject: [PATCH 05/13] link fix --- src/lib/components/layout/Sidebar.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index e0965b08..6edc7788 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -372,6 +372,7 @@ ? 'bg-gray-900' : ''} transition whitespace-nowrap text-ellipsis" href="/c/{chat.id}" + draggable="false" >
Date: Tue, 27 Feb 2024 15:34:00 +0100 Subject: [PATCH 06/13] keep the functionality to drag a chat --- src/lib/components/layout/Sidebar.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 6edc7788..499e0db0 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -31,6 +31,7 @@ let chatTitle = ''; let showDropdown = false; + let isEditing = false; onMount(async () => { if (window.innerWidth > 1280) { @@ -372,7 +373,7 @@ ? 'bg-gray-900' : ''} transition whitespace-nowrap text-ellipsis" href="/c/{chat.id}" - draggable="false" + draggable={isEditing ? 'false' : null} >
{ chatTitle = chat.title; chatTitleEditId = chat.id; - // editChatTitle(chat.id, 'a'); + isEditing = true; }} > Date: Tue, 27 Feb 2024 16:00:58 +0100 Subject: [PATCH 07/13] more readable --- src/lib/components/layout/Sidebar.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index 499e0db0..f9d87e5d 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -373,7 +373,7 @@ ? 'bg-gray-900' : ''} transition whitespace-nowrap text-ellipsis" href="/c/{chat.id}" - draggable={isEditing ? 'false' : null} + draggable={isEditing ? 'false' : 'true'} >
Date: Tue, 27 Feb 2024 19:06:32 -0800 Subject: [PATCH 08/13] revert --- src/lib/components/chat/MessageInput.svelte | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index e6ca374d..67bb3d88 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -293,9 +293,6 @@ }; onMount(() => { - const chatInput = document.getElementById('chat-textarea'); - chatInput?.focus(); - const dropZone = document.querySelector('body'); const onDragOver = (e) => { From 260a8b8b83705ba3f3133a787dcd0dc6b82e1352 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Feb 2024 19:56:52 -0800 Subject: [PATCH 09/13] feat: chat input focus on new chat --- src/lib/components/chat/MessageInput.svelte | 3 +++ src/lib/components/layout/Sidebar.svelte | 15 +++++++-------- src/routes/(app)/+page.svelte | 3 +++ src/routes/(app)/c/[id]/+page.svelte | 3 +++ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 67bb3d88..f9ff8fc3 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -293,6 +293,9 @@ }; onMount(() => { + const chatInput = document.getElementById('chat-textarea'); + window.setTimeout(() => chatInput?.focus(), 0); + const dropZone = document.querySelector('body'); const onDragOver = (e) => { diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index e0965b08..0cc8b872 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -101,17 +101,16 @@ : 'invisible'}" >
- +
{#if $user?.role === 'admin'} diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 7d424be4..581db7c0 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -134,6 +134,9 @@ settings.set({ ..._settings }); + + const chatInput = document.getElementById('chat-textarea'); + setTimeout(() => chatInput?.focus(), 0); }; const scrollToBottom = () => { diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 36f34219..515cbeea 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -99,6 +99,9 @@ if (await loadChat()) { await tick(); loaded = true; + + const chatInput = document.getElementById('chat-textarea'); + chatInput?.focus(); } else { await goto('/'); } From 781be2779bb6a20d719f8134a6b17a994358c51b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Feb 2024 20:02:23 -0800 Subject: [PATCH 10/13] refac: unnecessary max_token value removed --- backend/apps/openai/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index 5612e7dc..172332b9 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -147,13 +147,11 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)): print("Modified body_dict:", body) # Fix for ChatGPT calls failing because the num_ctx key is in body - if 'num_ctx' in body: + if "num_ctx" in body: # If 'num_ctx' is in the dictionary, delete it # Leaving it there generates an error with the # OpenAI API (Feb 2024) - del body['num_ctx'] - # OpenAI API (Feb 2024) accepts max_tokens - body["max_tokens"] = 1600 + del body["num_ctx"] # Convert the modified body back to JSON body = json.dumps(body) From a36627cbce0df177fe813ddd82dc38577a520dcb Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Feb 2024 20:07:23 -0800 Subject: [PATCH 11/13] doc: changelog --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b150de2..83758167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.106] - 2024-02-27 + +### Added + +- **👀 Enhanced User Experience**: Automatically focuses on prompt input area when initiating or opening an existing chat. + +### Fixed + +- Corrected typo from "HuggingFace" to "Hugging Face" (Issue #924). +- Resolved bug causing errors in chat completion API calls to OpenAI due to missing "num_ctx" parameter (Issue #927). +- Fixed issues preventing text editing, selection, and cursor retention in the input field (Issue #940). + ## [0.1.105] - 2024-02-25 ### Added diff --git a/package.json b/package.json index dd212e7d..2ce66e78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.1.105", + "version": "0.1.106", "private": true, "scripts": { "dev": "vite dev --host", From 59ae5b6d34b91d2a2c63b6a7d6e816c6a9e521b6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Feb 2024 20:08:57 -0800 Subject: [PATCH 12/13] fix: openai filtering --- backend/apps/openai/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index 172332b9..8d6fdb50 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -191,7 +191,7 @@ async def proxy(path: str, request: Request, user=Depends(get_verified_user)): response_data = r.json() - if "openai" in app.state.OPENAI_API_BASE_URL and path == "models": + if "api.openai.com" in app.state.OPENAI_API_BASE_URL and path == "models": response_data["data"] = list( filter(lambda model: "gpt" in model["id"], response_data["data"]) ) From 32361dc3daaeecdbac40ea75d756cff7fb1c6d7a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Feb 2024 20:10:29 -0800 Subject: [PATCH 13/13] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83758167..3c976a7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,13 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- **👀 Enhanced User Experience**: Automatically focuses on prompt input area when initiating or opening an existing chat. +- **🎯 Auto-focus Feature**: The input area now automatically focuses when initiating or opening a chat conversation. ### Fixed - Corrected typo from "HuggingFace" to "Hugging Face" (Issue #924). - Resolved bug causing errors in chat completion API calls to OpenAI due to missing "num_ctx" parameter (Issue #927). - Fixed issues preventing text editing, selection, and cursor retention in the input field (Issue #940). +- Fixed a bug where defining an OpenAI-compatible API server using 'OPENAI_API_BASE_URL' containing 'openai' string resulted in hiding models not containing 'gpt' string from the model menu. (Issue #930) ## [0.1.105] - 2024-02-25