From 370f97b44e76d3da76054bc2dfd200fe635816df Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 30 Nov 2024 23:33:19 -0800 Subject: [PATCH] refac --- package.json | 2 +- pyproject.toml | 10 ++-- .../Users/UserList/UserChatsModal.svelte | 58 ++++++++++--------- .../common/RichTextInput/AutoCompletion.js | 16 ++++- 4 files changed, 52 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 80e7b4fc3..220f5c691 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.4.6", + "version": "0.4.7", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host", diff --git a/pyproject.toml b/pyproject.toml index 0dc8e856d..0554baa9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ dependencies = [ "fastapi==0.111.0", "uvicorn[standard]==0.30.6", "pydantic==2.9.2", - "python-multipart==0.0.17", + "python-multipart==0.0.18", "Flask==3.0.3", "Flask-Cors==5.0.0", @@ -19,13 +19,13 @@ dependencies = [ "passlib[bcrypt]==1.7.4", "requests==2.32.3", - "aiohttp==3.10.8", + "aiohttp==3.11.8", "async-timeout", "aiocache", "aiofiles", "sqlalchemy==2.0.32", - "alembic==1.13.2", + "alembic==1.14.0", "peewee==3.17.6", "peewee-migrate==1.12.2", "psycopg2-binary==2.9.9", @@ -51,11 +51,11 @@ dependencies = [ "fake-useragent==1.5.1", "chromadb==0.5.15", - "pymilvus==2.4.9", + "pymilvus==2.5.0", "qdrant-client~=1.12.0", "opensearch-py==2.7.1", - "sentence-transformers==3.2.0", + "sentence-transformers==3.3.1", "colbert-ai==0.2.21", "einops==0.8.0", diff --git a/src/lib/components/admin/Users/UserList/UserChatsModal.svelte b/src/lib/components/admin/Users/UserList/UserChatsModal.svelte index 4c8447829..7cf03b4b7 100644 --- a/src/lib/components/admin/Users/UserList/UserChatsModal.svelte +++ b/src/lib/components/admin/Users/UserList/UserChatsModal.svelte @@ -9,13 +9,14 @@ import Modal from '$lib/components/common/Modal.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte'; + import Spinner from '$lib/components/common/Spinner.svelte'; const i18n = getContext('i18n'); export let show = false; export let user; - let chats = []; + let chats = null; const deleteChatHandler = async (chatId) => { const res = await deleteChatById(localStorage.token, chatId).catch((error) => { @@ -31,6 +32,8 @@ chats = await getChatListByUserId(localStorage.token, user.id); } })(); + } else { + chats = null; } let sortKey = 'updated_at'; // default sort key @@ -46,33 +49,32 @@ -
-
-
- {$i18n.t("{{user}}'s Chats", { user: user.name })} -
- +
+
+ {$i18n.t("{{user}}'s Chats", { user: user.name })}
-
+ +
-
-
+
+
+ {#if chats} {#if chats.length > 0}
@@ -176,7 +178,9 @@ {$i18n.t('has no conversations.')}
{/if} -
+ {:else} + + {/if}
diff --git a/src/lib/components/common/RichTextInput/AutoCompletion.js b/src/lib/components/common/RichTextInput/AutoCompletion.js index 678112050..ff3a23dff 100644 --- a/src/lib/components/common/RichTextInput/AutoCompletion.js +++ b/src/lib/components/common/RichTextInput/AutoCompletion.js @@ -1,3 +1,16 @@ +/* +Here we initialize the plugin with keyword mapping. +Intended to handle user interactions seamlessly. + +Observe the keydown events for proactive suggestions. +Provide a mechanism for accepting AI suggestions. +Evaluate each input change with debounce logic. +Next, we implement touch and mouse interactions. + +Anchor the user experience to intuitive behavior. +Intelligently reset suggestions on new input. +*/ + import { Extension } from '@tiptap/core' import { Plugin, PluginKey } from 'prosemirror-state' @@ -202,4 +215,5 @@ export const AIAutocompletion = Extension.create({ }), ] }, -}) \ No newline at end of file +}) +