This commit is contained in:
Timothy Jaeryang Baek 2024-11-30 23:33:19 -08:00
parent a26c5d9549
commit 370f97b44e
4 changed files with 52 additions and 34 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "open-webui", "name": "open-webui",
"version": "0.4.6", "version": "0.4.7",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run pyodide:fetch && vite dev --host", "dev": "npm run pyodide:fetch && vite dev --host",

View File

@ -9,7 +9,7 @@ dependencies = [
"fastapi==0.111.0", "fastapi==0.111.0",
"uvicorn[standard]==0.30.6", "uvicorn[standard]==0.30.6",
"pydantic==2.9.2", "pydantic==2.9.2",
"python-multipart==0.0.17", "python-multipart==0.0.18",
"Flask==3.0.3", "Flask==3.0.3",
"Flask-Cors==5.0.0", "Flask-Cors==5.0.0",
@ -19,13 +19,13 @@ dependencies = [
"passlib[bcrypt]==1.7.4", "passlib[bcrypt]==1.7.4",
"requests==2.32.3", "requests==2.32.3",
"aiohttp==3.10.8", "aiohttp==3.11.8",
"async-timeout", "async-timeout",
"aiocache", "aiocache",
"aiofiles", "aiofiles",
"sqlalchemy==2.0.32", "sqlalchemy==2.0.32",
"alembic==1.13.2", "alembic==1.14.0",
"peewee==3.17.6", "peewee==3.17.6",
"peewee-migrate==1.12.2", "peewee-migrate==1.12.2",
"psycopg2-binary==2.9.9", "psycopg2-binary==2.9.9",
@ -51,11 +51,11 @@ dependencies = [
"fake-useragent==1.5.1", "fake-useragent==1.5.1",
"chromadb==0.5.15", "chromadb==0.5.15",
"pymilvus==2.4.9", "pymilvus==2.5.0",
"qdrant-client~=1.12.0", "qdrant-client~=1.12.0",
"opensearch-py==2.7.1", "opensearch-py==2.7.1",
"sentence-transformers==3.2.0", "sentence-transformers==3.3.1",
"colbert-ai==0.2.21", "colbert-ai==0.2.21",
"einops==0.8.0", "einops==0.8.0",

View File

@ -9,13 +9,14 @@
import Modal from '$lib/components/common/Modal.svelte'; import Modal from '$lib/components/common/Modal.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte'; import Tooltip from '$lib/components/common/Tooltip.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
const i18n = getContext('i18n'); const i18n = getContext('i18n');
export let show = false; export let show = false;
export let user; export let user;
let chats = []; let chats = null;
const deleteChatHandler = async (chatId) => { const deleteChatHandler = async (chatId) => {
const res = await deleteChatById(localStorage.token, chatId).catch((error) => { const res = await deleteChatById(localStorage.token, chatId).catch((error) => {
@ -31,6 +32,8 @@
chats = await getChatListByUserId(localStorage.token, user.id); chats = await getChatListByUserId(localStorage.token, user.id);
} }
})(); })();
} else {
chats = null;
} }
let sortKey = 'updated_at'; // default sort key let sortKey = 'updated_at'; // default sort key
@ -46,33 +49,32 @@
</script> </script>
<Modal size="lg" bind:show> <Modal size="lg" bind:show>
<div> <div class=" flex justify-between dark:text-gray-300 px-5 pt-4">
<div class=" flex justify-between dark:text-gray-300 px-5 py-4"> <div class=" text-lg font-medium self-center capitalize">
<div class=" text-lg font-medium self-center capitalize"> {$i18n.t("{{user}}'s Chats", { user: user.name })}
{$i18n.t("{{user}}'s Chats", { user: user.name })}
</div>
<button
class="self-center"
on:click={() => {
show = false;
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
class="w-5 h-5"
>
<path
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
/>
</svg>
</button>
</div> </div>
<hr class=" dark:border-gray-850" /> <button
class="self-center"
on:click={() => {
show = false;
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
class="w-5 h-5"
>
<path
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
/>
</svg>
</button>
</div>
<div class="flex flex-col md:flex-row w-full px-5 py-4 md:space-x-4 dark:text-gray-200"> <div class="flex flex-col md:flex-row w-full px-5 pt-2 pb-4 md:space-x-4 dark:text-gray-200">
<div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6"> <div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
{#if chats}
{#if chats.length > 0} {#if chats.length > 0}
<div class="text-left text-sm w-full mb-4 max-h-[22rem] overflow-y-scroll"> <div class="text-left text-sm w-full mb-4 max-h-[22rem] overflow-y-scroll">
<div class="relative overflow-x-auto"> <div class="relative overflow-x-auto">
@ -176,7 +178,9 @@
{$i18n.t('has no conversations.')} {$i18n.t('has no conversations.')}
</div> </div>
{/if} {/if}
</div> {:else}
<Spinner />
{/if}
</div> </div>
</div> </div>
</Modal> </Modal>

View File

@ -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 { Extension } from '@tiptap/core'
import { Plugin, PluginKey } from 'prosemirror-state' import { Plugin, PluginKey } from 'prosemirror-state'
@ -202,4 +215,5 @@ export const AIAutocompletion = Extension.create({
}), }),
] ]
}, },
}) })