From 1d64d31275c1c81b5c82ab5a3dcef4afd872d0e2 Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:17:38 +0100 Subject: [PATCH 01/57] Updated PVC naming --- kubernetes/manifest/base/webui-pvc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/manifest/base/webui-pvc.yaml b/kubernetes/manifest/base/webui-pvc.yaml index 5c75283ad..97fb761d4 100644 --- a/kubernetes/manifest/base/webui-pvc.yaml +++ b/kubernetes/manifest/base/webui-pvc.yaml @@ -2,8 +2,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: labels: - app: ollama-webui - name: ollama-webui-pvc + app: open-webui + name: open-webui-pvc namespace: open-webui spec: accessModes: ["ReadWriteOnce"] From c91c95431d0741b69a10d332067f5d9459818fa3 Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Sun, 24 Mar 2024 08:18:28 +0100 Subject: [PATCH 02/57] Changed allocation in webui-deployment.yaml --- kubernetes/manifest/base/webui-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/manifest/base/webui-deployment.yaml b/kubernetes/manifest/base/webui-deployment.yaml index 38efd5549..79a0a9a23 100644 --- a/kubernetes/manifest/base/webui-deployment.yaml +++ b/kubernetes/manifest/base/webui-deployment.yaml @@ -35,4 +35,4 @@ spec: volumes: - name: webui-volume persistentVolumeClaim: - claimName: ollama-webui-pvc \ No newline at end of file + claimName: open-webui-pvc \ No newline at end of file From 42bb1ec0894af6a422231889a0c2c5a7af050110 Mon Sep 17 00:00:00 2001 From: Plamen Vatev Date: Mon, 25 Mar 2024 02:31:47 +0200 Subject: [PATCH 03/57] Fix spelling --- src/lib/i18n/locales/bg-BG/translation.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/i18n/locales/bg-BG/translation.json b/src/lib/i18n/locales/bg-BG/translation.json index 7d84fb9f6..868d5ba3a 100644 --- a/src/lib/i18n/locales/bg-BG/translation.json +++ b/src/lib/i18n/locales/bg-BG/translation.json @@ -279,7 +279,7 @@ "Send a Message": "Изпращане на Съобщение", "Send message": "Изпращане на съобщение", "Server connection verified": "Server connection verified", - "Set as default": "Задай като по подразбиране", + "Set as default": "Задай по подразбиране", "Set Default Model": "Задай Модел По Подразбиране", "Set Image Size": "Задай Размер на Изображението", "Set Steps": "Задай Стъпки", @@ -320,7 +320,7 @@ "Title": "Заглавие", "Title Auto-Generation": "Автоматично Генериране на Заглавие", "Title Generation Prompt": "Промпт за Генериране на Заглавие", - "to": "до", + "to": "в", "To access the available model names for downloading,": "За да получите достъп до наличните имена на модели за изтегляне,", "To access the GGUF models available for downloading,": "За да получите достъп до GGUF моделите, налични за изтегляне,", "to chat input.": "към чат входа.", @@ -360,4 +360,4 @@ "You": "Вие", "You're a helpful assistant.": "Вие сте полезен асистент.", "You're now logged in.": "Сега, вие влязохте в системата." -} \ No newline at end of file +} From c19ea89a1d7a1bac1713ed44cbab9ab1ca243fea Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 24 Mar 2024 23:03:26 -0700 Subject: [PATCH 04/57] feat: model download from model selector --- src/lib/components/chat/ModelSelector.svelte | 4 +- .../chat/ModelSelector/Selector.svelte | 326 ++++++++++++++++++ .../common/{Select.svelte => Selector.svelte} | 66 ++-- src/lib/stores/index.ts | 3 +- 4 files changed, 367 insertions(+), 32 deletions(-) create mode 100644 src/lib/components/chat/ModelSelector/Selector.svelte rename src/lib/components/common/{Select.svelte => Selector.svelte} (57%) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index 38ed51f7a..bccfd22c0 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -3,7 +3,7 @@ import { models, showSettings, settings, user } from '$lib/stores'; import { onMount, tick, getContext } from 'svelte'; import { toast } from 'svelte-sonner'; - import Select from '../common/Select.svelte'; + import Selector from './ModelSelector/Selector.svelte'; const i18n = getContext('i18n'); @@ -38,7 +38,7 @@
- +
+ +
+ {/if} + +
+ {#each filteredItems as item} + + {item.label} + + {#if value === item.value} +
+ +
+ {/if} +
+ {:else} +
+
+ No results found +
+
+ {/each} + + {#each Object.keys($MODEL_DOWNLOAD_POOL) as model} +
+
+
+ +
+ +
+
+ Downloading "{model}" {'pullProgress' in $MODEL_DOWNLOAD_POOL[model] + ? `(${$MODEL_DOWNLOAD_POOL[model].pullProgress}%)` + : ''} +
+ + {#if 'digest' in $MODEL_DOWNLOAD_POOL[model] && $MODEL_DOWNLOAD_POOL[model].digest} +
+ {$MODEL_DOWNLOAD_POOL[model].digest} +
+ {/if} +
+
+ +
+ + + +
+
+ {/each} + + {#if !(searchValue.trim() in $MODEL_DOWNLOAD_POOL) && searchValue && ollamaVersion && $user.role === 'admin'} + + {/if} +
+ + + diff --git a/src/lib/components/common/Select.svelte b/src/lib/components/common/Selector.svelte similarity index 57% rename from src/lib/components/common/Select.svelte rename to src/lib/components/common/Selector.svelte index a8563cedb..9a56f30bb 100644 --- a/src/lib/components/common/Select.svelte +++ b/src/lib/components/common/Selector.svelte @@ -12,6 +12,9 @@ export let value = ''; export let placeholder = 'Select a model'; + export let searchEnabled = true; + export let searchPlaceholder = 'Search a model'; + export let items = [ { value: 'mango', label: 'Mango' }, { value: 'watermelon', label: 'Watermelon' }, @@ -49,39 +52,44 @@ transition={flyAndScale} sideOffset={4} > -
- + + {#if searchEnabled} +
+ - -
+ +
-
+
+ {/if} -
- {#each filteredItems as item} - - {item.label} +
+ {#each filteredItems as item} + + {item.label} - {#if value === item.value} -
- + {#if value === item.value} +
+ +
+ {/if} + + {:else} +
+
+ No results found
- {/if} - - {:else} - - No results found - - {/each} -
+
+ {/each} +
+ - diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index c0e38a21e..fc58db6bd 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -7,8 +7,9 @@ export const config = writable(undefined); export const user = writable(undefined); // Frontend -export const theme = writable('system'); +export const MODEL_DOWNLOAD_POOL = writable({}); +export const theme = writable('system'); export const chatId = writable(''); export const chats = writable([]); From 302bd11b33ca399307c811113ef0ff435209ad64 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 24 Mar 2024 23:11:55 -0700 Subject: [PATCH 05/57] fix: pull model from selector --- .../chat/ModelSelector/Selector.svelte | 30 ++++++++++--------- src/lib/utils/index.ts | 26 ++++++++++++++++ 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index 0d9fa0ad3..c32201de3 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -10,9 +10,9 @@ import { cancelOllamaRequest, deleteModel, getOllamaVersion, pullModel } from '$lib/apis/ollama'; - import { user, MODEL_DOWNLOAD_POOL } from '$lib/stores'; + import { user, MODEL_DOWNLOAD_POOL, models } from '$lib/stores'; import { toast } from 'svelte-sonner'; - import { splitStream } from '$lib/utils'; + import { getModels, splitStream } from '$lib/utils'; import Tooltip from '$lib/components/common/Tooltip.svelte'; const i18n = getContext('i18n'); @@ -141,6 +141,8 @@ modelName: sanitizedModelTag }) ); + + models.set(await getModels(localStorage.token)); } else { toast.error('Download canceled'); } @@ -233,6 +235,17 @@
{/each} + {#if !(searchValue.trim() in $MODEL_DOWNLOAD_POOL) && searchValue && ollamaVersion && $user.role === 'admin'} + + {/if} + {#each Object.keys($MODEL_DOWNLOAD_POOL) as model}
-
+
{/each} - - {#if !(searchValue.trim() in $MODEL_DOWNLOAD_POOL) && searchValue && ollamaVersion && $user.role === 'admin'} - - {/if}
diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index a2c6cb29d..ad3e38932 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -1,5 +1,31 @@ import { v4 as uuidv4 } from 'uuid'; import sha256 from 'js-sha256'; +import { getOllamaModels } from '$lib/apis/ollama'; +import { getOpenAIModels } from '$lib/apis/openai'; +import { getLiteLLMModels } from '$lib/apis/litellm'; + +export const getModels = async (token: string) => { + let models = await Promise.all([ + await getOllamaModels(token).catch((error) => { + console.log(error); + return null; + }), + await getOpenAIModels(token).catch((error) => { + console.log(error); + return null; + }), + await getLiteLLMModels(token).catch((error) => { + console.log(error); + return null; + }) + ]); + + models = models + .filter((models) => models) + .reduce((a, e, i, arr) => a.concat(e, ...(i < arr.length - 1 ? [{ name: 'hr' }] : [])), []); + + return models; +}; ////////////////////////// // Helper functions From c6f9e74477d7ce43c8f456894ba212ec7ecf08f6 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 24 Mar 2024 23:26:00 -0700 Subject: [PATCH 06/57] feat: external model icon --- src/lib/components/chat/ModelSelector.svelte | 3 ++- .../chat/ModelSelector/Selector.svelte | 21 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index bccfd22c0..b0bb5e870 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -45,7 +45,8 @@ .map((model) => ({ value: model.id, label: - model.name + `${model.size ? ` (${(model.size / 1024 ** 3).toFixed(1)}GB)` : ''}` + model.name + `${model.size ? ` (${(model.size / 1024 ** 3).toFixed(1)}GB)` : ''}`, + info: model }))} bind:value={selectedModel} /> diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index c32201de3..a84b920cc 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -219,7 +219,26 @@ value={item.value} label={item.label} > - {item.label} +
+
+ {item.label} +
+ + {#if item.info.external} +
+ + + +
+ {/if} +
{#if value === item.value}
From eb004ccfc25d8dc1822743de848cfb08bbd20ab5 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 24 Mar 2024 23:28:25 -0700 Subject: [PATCH 07/57] refac: icon update --- src/lib/components/chat/ModelSelector/Selector.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index a84b920cc..870fab2c8 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -233,7 +233,14 @@ class="w-4 h-4" > +
From 784a6ec85e18b9b798fb7292acf9015beae7fada Mon Sep 17 00:00:00 2001 From: Doug Danat Date: Mon, 25 Mar 2024 09:50:53 +0100 Subject: [PATCH 08/57] include html langchain loader for RAG --- backend/apps/rag/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index 48ca61666..163f1b0fa 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -21,6 +21,7 @@ from langchain_community.document_loaders import ( TextLoader, PyPDFLoader, CSVLoader, + UnstructuredHTMLLoader, Docx2txtLoader, UnstructuredEPubLoader, UnstructuredWordDocumentLoader, @@ -402,6 +403,8 @@ def get_loader(filename: str, file_content_type: str, file_path: str): loader = UnstructuredRSTLoader(file_path, mode="elements") elif file_ext == "xml": loader = UnstructuredXMLLoader(file_path) + elif file_ext in ["htm", "html"]: + loader = UnstructuredHTMLLoader(file_path) elif file_ext == "md": loader = UnstructuredMarkdownLoader(file_path) elif file_content_type == "application/epub+zip": From 77f4ffddc1ce8cc57ce7227999fc87049c401605 Mon Sep 17 00:00:00 2001 From: Doug Danat Date: Mon, 25 Mar 2024 11:21:34 +0100 Subject: [PATCH 09/57] add htm/html to supported extensions in ui --- src/lib/constants.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index bdd9c64e9..5adefe561 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -22,6 +22,7 @@ export const SUPPORTED_FILE_TYPE = [ 'text/plain', 'text/csv', 'text/xml', + 'text/html', 'text/x-python', 'text/css', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', @@ -50,6 +51,8 @@ export const SUPPORTED_FILE_EXTENSIONS = [ 'h', 'c', 'cs', + 'htm', + 'html', 'sql', 'log', 'ini', From c91a5d8b1fd36827f1b6e45ffc7ef9d36780a280 Mon Sep 17 00:00:00 2001 From: Doug Danat Date: Mon, 25 Mar 2024 11:26:18 +0100 Subject: [PATCH 10/57] switch to using BeautifulSoup HTML loader so title is also captured --- backend/apps/rag/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index 163f1b0fa..1e50ef20b 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -21,7 +21,7 @@ from langchain_community.document_loaders import ( TextLoader, PyPDFLoader, CSVLoader, - UnstructuredHTMLLoader, + BSHTMLLoader, Docx2txtLoader, UnstructuredEPubLoader, UnstructuredWordDocumentLoader, @@ -404,7 +404,7 @@ def get_loader(filename: str, file_content_type: str, file_path: str): elif file_ext == "xml": loader = UnstructuredXMLLoader(file_path) elif file_ext in ["htm", "html"]: - loader = UnstructuredHTMLLoader(file_path) + loader = BSHTMLLoader(file_path) elif file_ext == "md": loader = UnstructuredMarkdownLoader(file_path) elif file_content_type == "application/epub+zip": From 8962d948cd5fb77dbf0d899fca277055ad832d33 Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:21:32 +0100 Subject: [PATCH 11/57] Check if running on K8s to correctly allocate Ollama Base URL --- backend/config.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index 9236e8a86..20bc7ad29 100644 --- a/backend/config.py +++ b/backend/config.py @@ -209,6 +209,7 @@ OLLAMA_API_BASE_URL = os.environ.get( OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "") +RUNNING_ON_K8S = os.environ.get("KUBERNETES_SERVICE_HOST", "") if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": OLLAMA_BASE_URL = ( @@ -217,9 +218,23 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": else OLLAMA_API_BASE_URL ) -if ENV == "prod": +if ENV == "prod" and RUNNING_ON_K8S == "": if OLLAMA_BASE_URL == "/ollama": OLLAMA_BASE_URL = "http://host.docker.internal:11434" + else: + OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" + + + +def is_running_in_kubernetes(): + return 'KUBERNETES_SERVICE_HOST' in os.environ + +# Setze EMV auf True, wenn in Kubernetes +if is_running_in_kubernetes(): + os.environ['EMV'] = 'True' + print("Läuft in Kubernetes, EMV gesetzt auf True.") +else: + print("Läuft nicht in Kubernetes.") OLLAMA_BASE_URLS = os.environ.get("OLLAMA_BASE_URLS", "") From eecc7f3529163dff30aeaa04609323bddedfbe2c Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:32:21 +0100 Subject: [PATCH 12/57] Deleted unused checks --- backend/config.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/backend/config.py b/backend/config.py index 20bc7ad29..6b5431bce 100644 --- a/backend/config.py +++ b/backend/config.py @@ -223,18 +223,6 @@ if ENV == "prod" and RUNNING_ON_K8S == "": OLLAMA_BASE_URL = "http://host.docker.internal:11434" else: OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" - - - -def is_running_in_kubernetes(): - return 'KUBERNETES_SERVICE_HOST' in os.environ - -# Setze EMV auf True, wenn in Kubernetes -if is_running_in_kubernetes(): - os.environ['EMV'] = 'True' - print("Läuft in Kubernetes, EMV gesetzt auf True.") -else: - print("Läuft nicht in Kubernetes.") OLLAMA_BASE_URLS = os.environ.get("OLLAMA_BASE_URLS", "") From 32cb5f3ceb1920891e038f9c2f860e5bc2c5fb2c Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 25 Mar 2024 13:46:06 -0700 Subject: [PATCH 13/57] feat: external model info --- src/lib/apis/litellm/index.ts | 2 +- .../chat/ModelSelector/Selector.svelte | 42 ++++++++++--------- src/lib/utils/index.ts | 4 ++ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/lib/apis/litellm/index.ts b/src/lib/apis/litellm/index.ts index 302e9c4a3..643146b73 100644 --- a/src/lib/apis/litellm/index.ts +++ b/src/lib/apis/litellm/index.ts @@ -33,7 +33,7 @@ export const getLiteLLMModels = async (token: string = '') => { id: model.id, name: model.name ?? model.id, external: true, - source: 'litellm' + source: 'LiteLLM' })) .sort((a, b) => { return a.name.localeCompare(b.name); diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index 870fab2c8..a5e8b12d5 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -12,7 +12,7 @@ import { user, MODEL_DOWNLOAD_POOL, models } from '$lib/stores'; import { toast } from 'svelte-sonner'; - import { getModels, splitStream } from '$lib/utils'; + import { capitalizeFirstLetter, getModels, splitStream } from '$lib/utils'; import Tooltip from '$lib/components/common/Tooltip.svelte'; const i18n = getContext('i18n'); @@ -225,25 +225,27 @@
{#if item.info.external} -
- - - - -
+ +
+ + + + +
+
{/if}
diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index ad3e38932..90d5d3c38 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -31,6 +31,10 @@ export const getModels = async (token: string) => { // Helper functions ////////////////////////// +export const capitalizeFirstLetter = (string) => { + return string.charAt(0).toUpperCase() + string.slice(1); +}; + export const splitStream = (splitOn) => { let buffer = ''; return new TransformStream({ From af366cf7320e72022360ad090b18db80cfbb6d0a Mon Sep 17 00:00:00 2001 From: Jannik S <69747628+jannikstdl@users.noreply.github.com> Date: Mon, 25 Mar 2024 21:50:58 +0100 Subject: [PATCH 14/57] fix --- backend/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/config.py b/backend/config.py index 6b5431bce..385c9238a 100644 --- a/backend/config.py +++ b/backend/config.py @@ -218,8 +218,8 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": else OLLAMA_API_BASE_URL ) -if ENV == "prod" and RUNNING_ON_K8S == "": - if OLLAMA_BASE_URL == "/ollama": +if ENV == "prod": + if OLLAMA_BASE_URL == "/ollama" and RUNNING_ON_K8S == "": OLLAMA_BASE_URL = "http://host.docker.internal:11434" else: OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" From 5d6cee0c581c2d6edba82ab1617ff76b22bf4e9d Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 25 Mar 2024 14:04:46 -0700 Subject: [PATCH 15/57] feat: model selector w/ more info --- src/lib/components/chat/ModelSelector.svelte | 3 +- .../chat/ModelSelector/Selector.svelte | 33 ++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index b0bb5e870..b52929437 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -44,8 +44,7 @@ .filter((model) => model.name !== 'hr') .map((model) => ({ value: model.id, - label: - model.name + `${model.size ? ` (${(model.size / 1024 ** 3).toFixed(1)}GB)` : ''}`, + label: model.name, info: model }))} bind:value={selectedModel} diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index a5e8b12d5..c4662bc17 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -222,8 +222,14 @@
{item.label} + + {item.info?.details?.parameter_size ?? ''}
+ + {#if item.info.external}
@@ -231,7 +237,7 @@ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" - class="w-4 h-4" + class="size-3" >
+ {:else} + +
+ + + +
+
{/if}
From 7f405c74cd92ad04cc3b069767c6d7680817ffce Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 25 Mar 2024 23:20:16 -0700 Subject: [PATCH 16/57] refac: rename --- backend/config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/config.py b/backend/config.py index 385c9238a..9647fe848 100644 --- a/backend/config.py +++ b/backend/config.py @@ -208,8 +208,7 @@ OLLAMA_API_BASE_URL = os.environ.get( ) OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "") - -RUNNING_ON_K8S = os.environ.get("KUBERNETES_SERVICE_HOST", "") +KUBERNETES_SERVICE_HOST = os.environ.get("KUBERNETES_SERVICE_HOST", "") if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": OLLAMA_BASE_URL = ( @@ -219,7 +218,7 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": ) if ENV == "prod": - if OLLAMA_BASE_URL == "/ollama" and RUNNING_ON_K8S == "": + if OLLAMA_BASE_URL == "/ollama" and KUBERNETES_SERVICE_HOST == "": OLLAMA_BASE_URL = "http://host.docker.internal:11434" else: OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" From 6307adfba1048c01a9954723f8d16b02fe984470 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 25 Mar 2024 23:47:08 -0700 Subject: [PATCH 17/57] feat: better error handling --- backend/apps/rag/main.py | 93 +++++++++++++++++++++++----------------- backend/constants.py | 2 + 2 files changed, 55 insertions(+), 40 deletions(-) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index 1e50ef20b..d87f7bc73 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -115,6 +115,7 @@ class CollectionNameForm(BaseModel): class StoreWebForm(CollectionNameForm): url: str + @app.get("/") async def get_status(): return { @@ -297,13 +298,18 @@ def store_web(form_data: StoreWebForm, user=Depends(get_current_user)): def store_data_in_vector_db(data, collection_name, overwrite: bool = False) -> bool: + text_splitter = RecursiveCharacterTextSplitter( chunk_size=app.state.CHUNK_SIZE, chunk_overlap=app.state.CHUNK_OVERLAP, add_start_index=True, ) docs = text_splitter.split_documents(data) - return store_docs_in_vector_db(docs, collection_name, overwrite) + + if len(docs) > 0: + return store_docs_in_vector_db(docs, collection_name, overwrite), None + else: + raise ValueError(ERROR_MESSAGES.EMPTY_CONTENT) def store_text_in_vector_db( @@ -319,6 +325,7 @@ def store_text_in_vector_db( def store_docs_in_vector_db(docs, collection_name, overwrite: bool = False) -> bool: + texts = [doc.page_content for doc in docs] metadatas = [doc.metadata for doc in docs] @@ -455,19 +462,21 @@ def store_doc( loader, known_type = get_loader(file.filename, file.content_type, file_path) data = loader.load() - result = store_data_in_vector_db(data, collection_name) - if result: - return { - "status": True, - "collection_name": collection_name, - "filename": filename, - "known_type": known_type, - } - else: + try: + result = store_data_in_vector_db(data, collection_name) + + if result: + return { + "status": True, + "collection_name": collection_name, + "filename": filename, + "known_type": known_type, + } + except Exception as e: raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - detail=ERROR_MESSAGES.DEFAULT(), + detail=e, ) except Exception as e: log.exception(e) @@ -532,38 +541,42 @@ def scan_docs_dir(user=Depends(get_admin_user)): ) data = loader.load() - result = store_data_in_vector_db(data, collection_name) + try: + result = store_data_in_vector_db(data, collection_name) - if result: - sanitized_filename = sanitize_filename(filename) - doc = Documents.get_doc_by_name(sanitized_filename) + if result: + sanitized_filename = sanitize_filename(filename) + doc = Documents.get_doc_by_name(sanitized_filename) - if doc == None: - doc = Documents.insert_new_doc( - user.id, - DocumentForm( - **{ - "name": sanitized_filename, - "title": filename, - "collection_name": collection_name, - "filename": filename, - "content": ( - json.dumps( - { - "tags": list( - map( - lambda name: {"name": name}, - tags, + if doc == None: + doc = Documents.insert_new_doc( + user.id, + DocumentForm( + **{ + "name": sanitized_filename, + "title": filename, + "collection_name": collection_name, + "filename": filename, + "content": ( + json.dumps( + { + "tags": list( + map( + lambda name: {"name": name}, + tags, + ) ) - ) - } - ) - if len(tags) - else "{}" - ), - } - ), - ) + } + ) + if len(tags) + else "{}" + ), + } + ), + ) + except Exception as e: + print(e) + pass except Exception as e: log.exception(e) diff --git a/backend/constants.py b/backend/constants.py index 42c5c85eb..8bcdd0789 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -60,3 +60,5 @@ class ERROR_MESSAGES(str, Enum): MODEL_NOT_FOUND = lambda name="": f"Model '{name}' was not found" OPENAI_NOT_FOUND = lambda name="": f"OpenAI API was not found" OLLAMA_NOT_FOUND = "WebUI could not connect to Ollama" + + EMPTY_CONTENT = "The content provided is empty. Please ensure that there is text or data present before proceeding." From 3688955c776c5c03afd94aa86636f1f8f80de738 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 25 Mar 2024 23:50:52 -0700 Subject: [PATCH 18/57] fix: encoding issue --- backend/apps/rag/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/rag/main.py b/backend/apps/rag/main.py index d87f7bc73..da7bb307d 100644 --- a/backend/apps/rag/main.py +++ b/backend/apps/rag/main.py @@ -411,7 +411,7 @@ def get_loader(filename: str, file_content_type: str, file_path: str): elif file_ext == "xml": loader = UnstructuredXMLLoader(file_path) elif file_ext in ["htm", "html"]: - loader = BSHTMLLoader(file_path) + loader = BSHTMLLoader(file_path, open_encoding="unicode_escape") elif file_ext == "md": loader = UnstructuredMarkdownLoader(file_path) elif file_content_type == "application/epub+zip": From 5eac5c54f8577c50e35a7ce1c64fc70f25fccd07 Mon Sep 17 00:00:00 2001 From: changchiyou Date: Tue, 26 Mar 2024 15:04:17 +0800 Subject: [PATCH 19/57] feat: Teams MessageCard refer to https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using\?tabs\=cURL\#example-of-connector-message --- backend/utils/webhook.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/backend/utils/webhook.py b/backend/utils/webhook.py index 1bc5a6048..51157a4e4 100644 --- a/backend/utils/webhook.py +++ b/backend/utils/webhook.py @@ -1,4 +1,7 @@ +import json + import requests +from config import VERSION def post_webhook(url: str, message: str, event_data: dict) -> bool: @@ -9,6 +12,27 @@ def post_webhook(url: str, message: str, event_data: dict) -> bool: payload["text"] = message elif "https://discord.com/api/webhooks" in url: payload["content"] = message + elif "webhook.office.com" in url: + action = event_data.get("action", "undefined") + facts = [ + {"name": name, "value": value} + for name, value in json.loads(event_data.get("user", {})).items() + ] + payload = { + "@type": "MessageCard", + "@context": "http://schema.org/extensions", + "themeColor": "0076D7", + "summary": message, + "sections": [ + { + "activityTitle": message, + "activitySubtitle": f"Open WebUI ({VERSION}) - {action}", + "activityImage": "https://openwebui.com/favicon.png", + "facts": facts, + "markdown": True, + } + ], + } else: payload = {**event_data} From 427ca4e3f5ac7e83484bfd2e86c11d16d7382dfe Mon Sep 17 00:00:00 2001 From: changchiyou Date: Tue, 26 Mar 2024 15:45:36 +0800 Subject: [PATCH 20/57] refactor: dynamically swap `activitySubtitle` and `activityImage` if `CUSTOM_NAME` has been set --- backend/config.py | 26 ++++++++++++-------------- backend/utils/webhook.py | 6 +++--- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/backend/config.py b/backend/config.py index 67edd3f4f..613b747a0 100644 --- a/backend/config.py +++ b/backend/config.py @@ -1,29 +1,27 @@ -import os -import chromadb -from chromadb import Settings -from base64 import b64encode -from bs4 import BeautifulSoup - -from pathlib import Path import json -import yaml +import os +import shutil +from base64 import b64encode +from pathlib import Path +from secrets import token_bytes +import chromadb import markdown import requests -import shutil - -from secrets import token_bytes +import yaml +from bs4 import BeautifulSoup +from chromadb import Settings from constants import ERROR_MESSAGES - try: - from dotenv import load_dotenv, find_dotenv + from dotenv import find_dotenv, load_dotenv load_dotenv(find_dotenv("../.env")) except ImportError: print("dotenv not installed, skipping...") WEBUI_NAME = "Open WebUI" +WEBUI_FAVICON_URL = "https://openwebui.com/favicon.png" shutil.copyfile("../build/favicon.png", "./static/favicon.png") #################################### @@ -111,7 +109,7 @@ if CUSTOM_NAME: data = r.json() if r.ok: if "logo" in data: - url = ( + WEBUI_FAVICON_URL = url = ( f"https://api.openwebui.com{data['logo']}" if data["logo"][0] == "/" else data["logo"] diff --git a/backend/utils/webhook.py b/backend/utils/webhook.py index 51157a4e4..4cfa41640 100644 --- a/backend/utils/webhook.py +++ b/backend/utils/webhook.py @@ -1,7 +1,7 @@ import json import requests -from config import VERSION +from config import VERSION, WEBUI_FAVICON_URL, WEBUI_NAME def post_webhook(url: str, message: str, event_data: dict) -> bool: @@ -26,8 +26,8 @@ def post_webhook(url: str, message: str, event_data: dict) -> bool: "sections": [ { "activityTitle": message, - "activitySubtitle": f"Open WebUI ({VERSION}) - {action}", - "activityImage": "https://openwebui.com/favicon.png", + "activitySubtitle": f"{WEBUI_NAME} ({VERSION}) - {action}", + "activityImage": WEBUI_FAVICON_URL, "facts": facts, "markdown": True, } From 3edc547389a2e01dbef53aac3e78b6cb0bd299ae Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 26 Mar 2024 00:59:57 -0700 Subject: [PATCH 21/57] feat: title auto generation for external models --- src/lib/apis/openai/index.ts | 50 +++++++++++++++++ .../components/chat/Settings/Interface.svelte | 56 +++++++++++++++---- src/routes/(app)/+page.svelte | 46 +++++++++------ 3 files changed, 122 insertions(+), 30 deletions(-) diff --git a/src/lib/apis/openai/index.ts b/src/lib/apis/openai/index.ts index e38314a55..7d0d9415e 100644 --- a/src/lib/apis/openai/index.ts +++ b/src/lib/apis/openai/index.ts @@ -263,3 +263,53 @@ export const synthesizeOpenAISpeech = async ( return res; }; + +export const generateTitle = async ( + token: string = '', + template: string, + model: string, + prompt: string, + url: string = OPENAI_API_BASE_URL +) => { + let error = null; + + template = template.replace(/{{prompt}}/g, prompt); + + console.log(template); + + const res = await fetch(`${url}/chat/completions`, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + Authorization: `Bearer ${token}` + }, + body: JSON.stringify({ + model: model, + messages: [ + { + role: 'user', + content: template + } + ], + stream: false + }) + }) + .then(async (res) => { + if (!res.ok) throw await res.json(); + return res.json(); + }) + .catch((err) => { + console.log(err); + if ('detail' in err) { + error = err.detail; + } + return null; + }); + + if (error) { + throw error; + } + + return res?.choices[0]?.message?.content ?? 'New Chat'; +}; diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index 2d5862f40..ad9e05e7f 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -1,7 +1,7 @@ @@ -190,8 +203,9 @@
{$i18n.t('Set Title Auto-Generation Model')}
-
-
+
+
+
Local Models
+ + {#each $models as model} + {#if model.name !== 'hr'} + + {/if} + {/each} + +
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 417ddccda..2ccdd8d5a 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -19,7 +19,7 @@ } from '$lib/stores'; import { copyToClipboard, splitStream } from '$lib/utils'; - import { generateChatCompletion, cancelOllamaRequest, generateTitle } from '$lib/apis/ollama'; + import { generateChatCompletion, cancelOllamaRequest } from '$lib/apis/ollama'; import { addTagById, createNewChat, @@ -30,14 +30,14 @@ updateChatById } from '$lib/apis/chats'; import { queryCollection, queryDoc } from '$lib/apis/rag'; - import { generateOpenAIChatCompletion } from '$lib/apis/openai'; + import { generateOpenAIChatCompletion, generateTitle } from '$lib/apis/openai'; import MessageInput from '$lib/components/chat/MessageInput.svelte'; import Messages from '$lib/components/chat/Messages.svelte'; import ModelSelector from '$lib/components/chat/ModelSelector.svelte'; import Navbar from '$lib/components/layout/Navbar.svelte'; import { RAGTemplate } from '$lib/utils/rag'; - import { LITELLM_API_BASE_URL, OPENAI_API_BASE_URL } from '$lib/constants'; + import { LITELLM_API_BASE_URL, OLLAMA_API_BASE_URL, OPENAI_API_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants'; const i18n = getContext('i18n'); @@ -511,7 +511,8 @@ if (messages.length == 2 && messages.at(1).content !== '') { window.history.replaceState(history.state, '', `/c/${_chatId}`); - await generateChatTitle(_chatId, userPrompt); + const _title = await generateChatTitle(userPrompt); + await setChatTitle(_chatId, _title); } }; @@ -696,11 +697,8 @@ if (messages.length == 2) { window.history.replaceState(history.state, '', `/c/${_chatId}`); - if ($settings?.titleAutoGenerateModel) { - await generateChatTitle(_chatId, userPrompt); - } else { - await setChatTitle(_chatId, userPrompt); - } + const _title = await generateChatTitle(userPrompt); + await setChatTitle(_chatId, _title); } }; @@ -754,23 +752,35 @@ } }; - const generateChatTitle = async (_chatId, userPrompt) => { - if ($settings.titleAutoGenerate ?? true) { + const generateChatTitle = async (userPrompt) => { + if ($settings?.title?.auto ?? true) { + const model = $models.find((model) => model.id === selectedModels[0]); + + const titleModelId = + model?.external ?? false + ? $settings?.title?.modelExternal ?? selectedModels[0] + : $settings?.title?.model ?? selectedModels[0]; + const titleModel = $models.find((model) => model.id === titleModelId); + + console.log(titleModel); const title = await generateTitle( localStorage.token, - $settings?.titleGenerationPrompt ?? + $settings?.title?.prompt ?? $i18n.t( "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':" ) + ' {{prompt}}', - $settings?.titleAutoGenerateModel ?? selectedModels[0], - userPrompt + titleModelId, + userPrompt, + titleModel?.external ?? false + ? titleModel.source === 'litellm' + ? `${LITELLM_API_BASE_URL}/v1` + : `${OPENAI_API_BASE_URL}` + : `${OLLAMA_API_BASE_URL}/v1` ); - if (title) { - await setChatTitle(_chatId, title); - } + return title; } else { - await setChatTitle(_chatId, `${userPrompt}`); + return `${userPrompt}`; } }; From 941bb7c6038ba25bc0063966b47014e0a98c53a4 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 26 Mar 2024 01:45:25 -0700 Subject: [PATCH 22/57] refac: chat[id] page --- src/routes/(app)/+page.svelte | 22 ++++----- src/routes/(app)/c/[id]/+page.svelte | 68 ++++++++++++++++------------ 2 files changed, 51 insertions(+), 39 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 2ccdd8d5a..2343a4395 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -784,6 +784,17 @@ } }; + const setChatTitle = async (_chatId, _title) => { + if (_chatId === $chatId) { + title = _title; + } + + if ($settings.saveChatHistory ?? true) { + chat = await updateChatById(localStorage.token, _chatId, { title: _title }); + await chats.set(await getChatList(localStorage.token)); + } + }; + const getTags = async () => { return await getTagsById(localStorage.token, $chatId).catch(async (error) => { return []; @@ -811,17 +822,6 @@ _tags.set(await getAllChatTags(localStorage.token)); }; - - const setChatTitle = async (_chatId, _title) => { - if (_chatId === $chatId) { - title = _title; - } - - if ($settings.saveChatHistory ?? true) { - chat = await updateChatById(localStorage.token, _chatId, { title: _title }); - await chats.set(await getChatList(localStorage.token)); - } - }; diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 836fc90a4..0d464cd65 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -521,7 +521,8 @@ if (messages.length == 2 && messages.at(1).content !== '') { window.history.replaceState(history.state, '', `/c/${_chatId}`); - await generateChatTitle(_chatId, userPrompt); + const _title = await generateChatTitle(userPrompt); + await setChatTitle(_chatId, _title); } }; @@ -706,11 +707,8 @@ if (messages.length == 2) { window.history.replaceState(history.state, '', `/c/${_chatId}`); - if ($settings?.titleAutoGenerateModel) { - await generateChatTitle(_chatId, userPrompt); - } else { - await setChatTitle(_chatId, userPrompt); - } + const _title = await generateChatTitle(userPrompt); + await setChatTitle(_chatId, _title); } }; @@ -719,6 +717,19 @@ console.log('stopResponse'); }; + const regenerateResponse = async () => { + console.log('regenerateResponse'); + if (messages.length != 0 && messages.at(-1).done == true) { + messages.splice(messages.length - 1, 1); + messages = messages; + + let userMessage = messages.at(-1); + let userPrompt = userMessage.content; + + await sendPrompt(userPrompt, userMessage.id); + } + }; + const continueGeneration = async () => { console.log('continueGeneration'); const _chatId = JSON.parse(JSON.stringify($chatId)); @@ -751,36 +762,35 @@ } }; - const regenerateResponse = async () => { - console.log('regenerateResponse'); - if (messages.length != 0 && messages.at(-1).done == true) { - messages.splice(messages.length - 1, 1); - messages = messages; + const generateChatTitle = async (userPrompt) => { + if ($settings?.title?.auto ?? true) { + const model = $models.find((model) => model.id === selectedModels[0]); - let userMessage = messages.at(-1); - let userPrompt = userMessage.content; + const titleModelId = + model?.external ?? false + ? $settings?.title?.modelExternal ?? selectedModels[0] + : $settings?.title?.model ?? selectedModels[0]; + const titleModel = $models.find((model) => model.id === titleModelId); - await sendPrompt(userPrompt, userMessage.id); - } - }; - - const generateChatTitle = async (_chatId, userPrompt) => { - if ($settings.titleAutoGenerate ?? true) { + console.log(titleModel); const title = await generateTitle( localStorage.token, - $settings?.titleGenerationPrompt ?? + $settings?.title?.prompt ?? $i18n.t( "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':" ) + ' {{prompt}}', - $settings?.titleAutoGenerateModel ?? selectedModels[0], - userPrompt + titleModelId, + userPrompt, + titleModel?.external ?? false + ? titleModel.source === 'litellm' + ? `${LITELLM_API_BASE_URL}/v1` + : `${OPENAI_API_BASE_URL}` + : `${OLLAMA_API_BASE_URL}/v1` ); - if (title) { - await setChatTitle(_chatId, title); - } + return title; } else { - await setChatTitle(_chatId, `${userPrompt}`); + return `${userPrompt}`; } }; @@ -789,8 +799,10 @@ title = _title; } - chat = await updateChatById(localStorage.token, _chatId, { title: _title }); - await chats.set(await getChatList(localStorage.token)); + if ($settings.saveChatHistory ?? true) { + chat = await updateChatById(localStorage.token, _chatId, { title: _title }); + await chats.set(await getChatList(localStorage.token)); + } }; const getTags = async () => { From d12a7247bcb77f590d2e47d13a64d310ea6a0aab Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 26 Mar 2024 01:47:33 -0700 Subject: [PATCH 23/57] fix: missing import --- src/routes/(app)/c/[id]/+page.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 0d464cd65..987338a3d 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -19,7 +19,7 @@ } from '$lib/stores'; import { copyToClipboard, splitStream, convertMessagesToHistory } from '$lib/utils'; - import { generateChatCompletion, generateTitle, cancelOllamaRequest } from '$lib/apis/ollama'; + import { generateChatCompletion, cancelOllamaRequest } from '$lib/apis/ollama'; import { addTagById, createNewChat, @@ -31,14 +31,19 @@ updateChatById } from '$lib/apis/chats'; import { queryCollection, queryDoc } from '$lib/apis/rag'; - import { generateOpenAIChatCompletion } from '$lib/apis/openai'; + import { generateOpenAIChatCompletion, generateTitle } from '$lib/apis/openai'; import MessageInput from '$lib/components/chat/MessageInput.svelte'; import Messages from '$lib/components/chat/Messages.svelte'; import ModelSelector from '$lib/components/chat/ModelSelector.svelte'; import Navbar from '$lib/components/layout/Navbar.svelte'; import { RAGTemplate } from '$lib/utils/rag'; - import { LITELLM_API_BASE_URL, OPENAI_API_BASE_URL, WEBUI_BASE_URL } from '$lib/constants'; + import { + LITELLM_API_BASE_URL, + OPENAI_API_BASE_URL, + OLLAMA_API_BASE_URL, + WEBUI_BASE_URL + } from '$lib/constants'; const i18n = getContext('i18n'); From cb364f0ac7ca102e2d5e8731b566aab5e0686504 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 26 Mar 2024 01:51:24 -0700 Subject: [PATCH 24/57] feat: focus search input by default --- src/lib/components/chat/ModelSelector/Selector.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index c4662bc17..e7e2aa6a4 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -2,7 +2,7 @@ import { Select } from 'bits-ui'; import { flyAndScale } from '$lib/utils/transitions'; - import { createEventDispatcher, onMount, getContext } from 'svelte'; + import { createEventDispatcher, onMount, getContext, tick } from 'svelte'; import ChevronDown from '$lib/components/icons/ChevronDown.svelte'; import Check from '$lib/components/icons/Check.svelte'; @@ -177,8 +177,9 @@ { + onOpenChange={async () => { searchValue = ''; + window.setTimeout(() => document.getElementById('model-search-input')?.focus(), 0); }} selected={items.find((item) => item.value === value)} onSelectedChange={(selectedItem) => { @@ -203,6 +204,7 @@ Date: Tue, 26 Mar 2024 11:46:22 -0700 Subject: [PATCH 25/57] Add wait for tick before scrolling down in openai We had this wait on ollama but not for openai, causing it to fail to scroll down in certain cases. This fixes the issue. --- src/routes/(app)/+page.svelte | 4 ++++ src/routes/(app)/c/[id]/+page.svelte | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 417ddccda..4df39f854 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -517,6 +517,10 @@ const sendPromptOpenAI = async (model, userPrompt, responseMessageId, _chatId) => { const responseMessage = history.messages[responseMessageId]; + + // Wait until history/message have been updated + await tick(); + scrollToBottom(); const docs = messages diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 836fc90a4..2deaaf330 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -527,6 +527,10 @@ const sendPromptOpenAI = async (model, userPrompt, responseMessageId, _chatId) => { const responseMessage = history.messages[responseMessageId]; + + // Wait until history/message have been updated + await tick(); + scrollToBottom(); const docs = messages From 26121c5d881b2d34ed90eb0cca0abb4edabe07ff Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Sun, 24 Mar 2024 06:46:18 +0330 Subject: [PATCH 26/57] wip: Set default language from config --- backend/data/config.json | 1 + backend/main.py | 6 ++--- src/lib/i18n/index.ts | 54 ++++++++++++++++++++++----------------- src/routes/+layout.svelte | 7 ++++- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/backend/data/config.json b/backend/data/config.json index cd6687d79..7d15c9e69 100644 --- a/backend/data/config.json +++ b/backend/data/config.json @@ -1,6 +1,7 @@ { "version": 0, "ui": { + "locale": "en-US", "prompt_suggestions": [ { "title": [ diff --git a/backend/main.py b/backend/main.py index d4b67079c..6a5206213 100644 --- a/backend/main.py +++ b/backend/main.py @@ -32,6 +32,7 @@ from utils.utils import get_admin_user from apps.rag.utils import rag_messages from config import ( + CONFIG_DATA, WEBUI_NAME, ENV, VERSION, @@ -88,7 +89,6 @@ class RAGMiddleware(BaseHTTPMiddleware): # Example: Add a new key-value pair or modify existing ones # data["modified"] = True # Example modification if "docs" in data: - data = {**data} data["messages"] = rag_messages( data["docs"], @@ -163,11 +163,11 @@ app.mount("/rag/api/v1", rag_app) @app.get("/api/config") async def get_app_config(): - return { "status": True, "name": WEBUI_NAME, "version": VERSION, + "locale": CONFIG_DATA["ui"]["locale"], "images": images_app.state.ENABLED, "default_models": webui_app.state.DEFAULT_MODELS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, @@ -191,7 +191,6 @@ class ModelFilterConfigForm(BaseModel): async def update_model_filter_config( form_data: ModelFilterConfigForm, user=Depends(get_admin_user) ): - app.state.MODEL_FILTER_ENABLED = form_data.enabled app.state.MODEL_FILTER_LIST = form_data.models @@ -231,7 +230,6 @@ async def update_webhook_url(form_data: UrlForm, user=Depends(get_admin_user)): @app.get("/api/version") async def get_app_config(): - return { "version": VERSION, } diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts index 23edb2e1b..b0580345f 100644 --- a/src/lib/i18n/index.ts +++ b/src/lib/i18n/index.ts @@ -37,30 +37,36 @@ const createIsLoadingStore = (i18n: i18nType) => { return isLoading; }; -i18next - .use( - resourcesToBackend( - (language: string, namespace: string) => import(`./locales/${language}/${namespace}.json`) - ) - ) - .use(LanguageDetector) - .init({ - debug: false, - detection: { - order: ['querystring', 'localStorage', 'navigator'], - caches: ['localStorage'], - lookupQuerystring: 'lang', - lookupLocalStorage: 'locale' - }, - fallbackLng: { - default: ['en-US'] - }, - ns: 'translation', - returnEmptyString: false, - interpolation: { - escapeValue: false // not needed for svelte as it escapes by default - } - }); +export const initI18n = (defaultLocale: string) => { + let detectionOrder = defaultLocale + ? ['querystring', 'localStorage'] + : ['querystring', 'localStorage', 'navigator']; + let fallbackDefaultLocale = defaultLocale ? [defaultLocale] : ['en-US']; + + const loadResource = (language: string, namespace: string) => + import(`./locales/${language}/${namespace}.json`); + + i18next + .use(resourcesToBackend(loadResource)) + .use(LanguageDetector) + .init({ + debug: false, + detection: { + order: detectionOrder, + caches: ['localStorage'], + lookupQuerystring: 'lang', + lookupLocalStorage: 'locale' + }, + fallbackLng: { + default: fallbackDefaultLocale + }, + ns: 'translation', + returnEmptyString: false, + interpolation: { + escapeValue: false // not needed for svelte as it escapes by default + } + }); +}; const i18n = createI18nStore(i18next); const isLoadingStore = createIsLoadingStore(i18next); diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 865155eee..3334e0d2e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -11,7 +11,7 @@ import '../tailwind.css'; import 'tippy.js/dist/tippy.css'; import { WEBUI_BASE_URL } from '$lib/constants'; - import i18n from '$lib/i18n'; + import i18n, { initI18n } from '$lib/i18n'; setContext('i18n', i18n); @@ -25,6 +25,11 @@ if (backendConfig) { // Save Backend Status to Store await config.set(backendConfig); + if ($config.locale) { + initI18n($config.locale); + } else { + initI18n(); + } await WEBUI_NAME.set(backendConfig.name); console.log(backendConfig); From 64e60036275a5200faeade6112c62bc91e30389f Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Tue, 26 Mar 2024 23:04:01 +0330 Subject: [PATCH 27/57] refac: Remove translation values for en-US Translation values for en-US are not necessary, the keys will be used as fallback. --- src/lib/i18n/locales/en-US/translation.json | 662 ++++++++++---------- 1 file changed, 331 insertions(+), 331 deletions(-) diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index 57f3d432c..251834e00 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -1,128 +1,128 @@ { - "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.", - "(Beta)": "(Beta)", - "(e.g. `sh webui.sh --api`)": "(e.g. `sh webui.sh --api`)", - "(latest)": "(latest)", - "{{modelName}} is thinking...": "{{modelName}} is thinking...", - "{{webUIName}} Backend Required": "{{webUIName}} Backend Required", + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "", + "(Beta)": "", + "(e.g. `sh webui.sh --api`)": "", + "(latest)": "", + "{{modelName}} is thinking...": "", + "{{webUIName}} Backend Required": "", "a user": "", - "About": "About", - "Account": "Account", - "Action": "Action", - "Add a model": "Add a model", - "Add a model tag name": "Add a model tag name", - "Add a short description about what this modelfile does": "Add a short description about what this modelfile does", - "Add a short title for this prompt": "Add a short title for this prompt", - "Add a tag": "Add a tag", - "Add Docs": "Add Docs", - "Add Files": "Add Files", - "Add message": "Add message", - "add tags": "add tags", - "Adjusting these settings will apply changes universally to all users.": "Adjusting these settings will apply changes universally to all users.", - "admin": "admin", - "Admin Panel": "Admin Panel", - "Admin Settings": "Admin Settings", - "Advanced Parameters": "Advanced Parameters", - "all": "all", - "All Users": "All Users", - "Allow": "Allow", - "Allow Chat Deletion": "Allow Chat Deletion", - "alphanumeric characters and hyphens": "alphanumeric characters and hyphens", - "Already have an account?": "Already have an account?", + "About": "", + "Account": "", + "Action": "", + "Add a model": "", + "Add a model tag name": "", + "Add a short description about what this modelfile does": "", + "Add a short title for this prompt": "", + "Add a tag": "", + "Add Docs": "", + "Add Files": "", + "Add message": "", + "add tags": "", + "Adjusting these settings will apply changes universally to all users.": "", + "admin": "", + "Admin Panel": "", + "Admin Settings": "", + "Advanced Parameters": "", + "all": "", + "All Users": "", + "Allow": "", + "Allow Chat Deletion": "", + "alphanumeric characters and hyphens": "", + "Already have an account?": "", "an assistant": "", - "and": "and", - "API Base URL": "API Base URL", - "API Key": "API Key", - "API RPM": "API RPM", - "are allowed - Activate this command by typing": "are allowed - Activate this command by typing", + "and": "", + "API Base URL": "", + "API Key": "", + "API RPM": "", + "are allowed - Activate this command by typing": "", "Are you sure?": "", - "Audio": "Audio", - "Auto-playback response": "Auto-playback response", - "Auto-send input after 3 sec.": "Auto-send input after 3 sec.", - "AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", + "Audio": "", + "Auto-playback response": "", + "Auto-send input after 3 sec.": "", + "AUTOMATIC1111 Base URL": "", "AUTOMATIC1111 Base URL is required.": "", - "available!": "available!", - "Back": "Back", - "Builder Mode": "Builder Mode", - "Cancel": "Cancel", - "Categories": "Categories", - "Change Password": "Change Password", - "Chat": "Chat", - "Chat History": "Chat History", - "Chat History is off for this browser.": "Chat History is off for this browser.", - "Chats": "Chats", - "Check Again": "Check Again", - "Check for updates": "Check for updates", - "Checking for updates...": "Checking for updates...", - "Choose a model before saving...": "Choose a model before saving...", - "Chunk Overlap": "Chunk Overlap", - "Chunk Params": "Chunk Params", - "Chunk Size": "Chunk Size", - "Click here for help.": "Click here for help.", - "Click here to check other modelfiles.": "Click here to check other modelfiles.", + "available!": "", + "Back": "", + "Builder Mode": "", + "Cancel": "", + "Categories": "", + "Change Password": "", + "Chat": "", + "Chat History": "", + "Chat History is off for this browser.": "", + "Chats": "", + "Check Again": "", + "Check for updates": "", + "Checking for updates...": "", + "Choose a model before saving...": "", + "Chunk Overlap": "", + "Chunk Params": "", + "Chunk Size": "", + "Click here for help.": "", + "Click here to check other modelfiles.": "", "Click here to select": "", "Click here to select documents.": "", - "click here.": "click here.", - "Click on the user role button to change a user's role.": "Click on the user role button to change a user's role.", - "Close": "Close", - "Collection": "Collection", - "Command": "Command", - "Confirm Password": "Confirm Password", - "Connections": "Connections", - "Content": "Content", - "Context Length": "Context Length", - "Conversation Mode": "Conversation Mode", - "Copy last code block": "Copy last code block", - "Copy last response": "Copy last response", - "Copying to clipboard was successful!": "Copying to clipboard was successful!", - "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':", - "Create a modelfile": "Create a modelfile", - "Create Account": "Create Account", - "Created at": "Created at", - "Created by": "Created by", - "Current Model": "Current Model", - "Current Password": "Current Password", - "Custom": "Custom", - "Customize Ollama models for a specific purpose": "Customize Ollama models for a specific purpose", - "Dark": "Dark", - "Database": "Database", - "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", - "Default": "Default", + "click here.": "", + "Click on the user role button to change a user's role.": "", + "Close": "", + "Collection": "", + "Command": "", + "Confirm Password": "", + "Connections": "", + "Content": "", + "Context Length": "", + "Conversation Mode": "", + "Copy last code block": "", + "Copy last response": "", + "Copying to clipboard was successful!": "", + "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "", + "Create a modelfile": "", + "Create Account": "", + "Created at": "", + "Created by": "", + "Current Model": "", + "Current Password": "", + "Custom": "", + "Customize Ollama models for a specific purpose": "", + "Dark": "", + "Database": "", + "DD/MM/YYYY HH:mm": "", + "Default": "", "Default (Automatic1111)": "", - "Default (Web API)": "Default (Web API)", - "Default model updated": "Default model updated", - "Default Prompt Suggestions": "Default Prompt Suggestions", - "Default User Role": "Default User Role", - "delete": "delete", - "Delete a model": "Delete a model", - "Delete chat": "Delete chat", - "Delete Chats": "Delete Chats", - "Deleted {{deleteModelTag}}": "Deleted {{deleteModelTag}}", - "Deleted {tagName}": "Deleted {tagName}", - "Description": "Description", - "Desktop Notifications": "Notification", - "Disabled": "Disabled", - "Discover a modelfile": "Discover a modelfile", - "Discover a prompt": "Discover a prompt", - "Discover, download, and explore custom prompts": "Discover, download, and explore custom prompts", - "Discover, download, and explore model presets": "Discover, download, and explore model presets", - "Display the username instead of You in the Chat": "Display the username instead of 'You' in the Chat", - "Document": "Document", - "Document Settings": "Document Settings", - "Documents": "Documents", - "does not make any external connections, and your data stays securely on your locally hosted server.": "does not make any external connections, and your data stays securely on your locally hosted server.", - "Don't Allow": "Don't Allow", - "Don't have an account?": "Don't have an account?", - "Download as a File": "Download as a File", - "Download Database": "Download Database", - "Drop any files here to add to the conversation": "Drop any files here to add to the conversation", - "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.", - "Edit Doc": "Edit Doc", - "Edit User": "Edit User", - "Email": "Email", - "Enable Chat History": "Enable Chat History", - "Enable New Sign Ups": "Enable New Sign Ups", - "Enabled": "Enabled", + "Default (Web API)": "", + "Default model updated": "", + "Default Prompt Suggestions": "", + "Default User Role": "", + "delete": "", + "Delete a model": "", + "Delete chat": "", + "Delete Chats": "", + "Deleted {{deleteModelTag}}": "", + "Deleted {tagName}": "", + "Description": "", + "Desktop Notifications": "", + "Disabled": "", + "Discover a modelfile": "", + "Discover a prompt": "", + "Discover, download, and explore custom prompts": "", + "Discover, download, and explore model presets": "", + "Display the username instead of You in the Chat": "", + "Document": "", + "Document Settings": "", + "Documents": "", + "does not make any external connections, and your data stays securely on your locally hosted server.": "", + "Don't Allow": "", + "Don't have an account?": "", + "Download as a File": "", + "Download Database": "", + "Drop any files here to add to the conversation": "", + "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "", + "Edit Doc": "", + "Edit User": "", + "Email": "", + "Enable Chat History": "", + "Enable New Sign Ups": "", + "Enabled": "", "Enter {{role}} message here": "", "Enter API Key": "", "Enter Chunk Overlap": "", @@ -135,229 +135,229 @@ "Enter Max Tokens (litellm_params.max_tokens)": "", "Enter model tag (e.g. {{modelTag}})": "", "Enter Number of Steps (e.g. 50)": "", - "Enter stop sequence": "Enter stop sequence", + "Enter stop sequence": "", "Enter Top K": "", "Enter URL (e.g. http://127.0.0.1:7860/)": "", - "Enter Your Email": "Enter Your Email", - "Enter Your Full Name": "Enter Your Full Name", - "Enter Your Password": "Enter Your Password", - "Experimental": "Experimental", - "Export All Chats (All Users)": "Export All Chats (All Users)", - "Export Chats": "Export Chats", - "Export Documents Mapping": "Export Documents Mapping", - "Export Modelfiles": "Export Modelfiles", - "Export Prompts": "Export Prompts", - "Failed to read clipboard contents": "Failed to read clipboard contents", - "File Mode": "File Mode", - "File not found.": "File not found.", - "Focus chat input": "Focus chat input", - "Format your variables using square brackets like this:": "Format your variables using square brackets like this:", - "From (Base Model)": "From (Base Model)", - "Full Screen Mode": "Full Screen Mode", - "General": "General", - "General Settings": "General Settings", - "Hello, {{name}}": "Hello, {{name}}", - "Hide": "Hide", - "Hide Additional Params": "Hide Additional Params", - "How can I help you today?": "How can I help you today?", - "Image Generation (Experimental)": "Image Generation (Experimental)", + "Enter Your Email": "", + "Enter Your Full Name": "", + "Enter Your Password": "", + "Experimental": "", + "Export All Chats (All Users)": "", + "Export Chats": "", + "Export Documents Mapping": "", + "Export Modelfiles": "", + "Export Prompts": "", + "Failed to read clipboard contents": "", + "File Mode": "", + "File not found.": "", + "Focus chat input": "", + "Format your variables using square brackets like this:": "", + "From (Base Model)": "", + "Full Screen Mode": "", + "General": "", + "General Settings": "", + "Hello, {{name}}": "", + "Hide": "", + "Hide Additional Params": "", + "How can I help you today?": "", + "Image Generation (Experimental)": "", "Image Generation Engine": "", - "Image Settings": "Image Settings", - "Images": "Images", - "Import Chats": "Import Chats", - "Import Documents Mapping": "Import Documents Mapping", - "Import Modelfiles": "Import Modelfiles", - "Import Prompts": "Import Prompts", - "Include `--api` flag when running stable-diffusion-webui": "Include `--api` flag when running stable-diffusion-webui", - "Interface": "Interface", - "join our Discord for help.": "join our Discord for help.", - "JSON": "JSON", - "JWT Expiration": "JWT Expiration", - "JWT Token": "JWT Token", - "Keep Alive": "Keep Alive", - "Keyboard shortcuts": "Keyboard shortcuts", - "Language": "Language", - "Light": "Light", - "Listening...": "Listening...", - "LLMs can make mistakes. Verify important information.": "LLMs can make mistakes. Verify important information.", - "Made by OpenWebUI Community": "Made by OpenWebUI Community", - "Make sure to enclose them with": "Make sure to enclose them with", - "Manage LiteLLM Models": "Manage LiteLLM Models", - "Manage Models": "Manage Models", - "Manage Ollama Models": "Manage Ollama Models", - "Max Tokens": "Max Tokens", - "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "Maximum of 3 models can be downloaded simultaneously. Please try again later.", - "Mirostat": "Mirostat", - "Mirostat Eta": "Mirostat Eta", - "Mirostat Tau": "Mirostat Tau", - "MMMM DD, YYYY": "MMMM DD, YYYY", - "Model '{{modelName}}' has been successfully downloaded.": "Model '{{modelName}}' has been successfully downloaded.", - "Model '{{modelTag}}' is already in queue for downloading.": "Model '{{modelTag}}' is already in queue for downloading.", - "Model {{modelId}} not found": "Model {{modelId}} not found", - "Model {{modelName}} already exists.": "Model {{modelName}} already exists.", - "Model Name": "Model Name", - "Model not selected": "Model not selected", - "Model Tag Name": "Model Tag Name", - "Model Whitelisting": "Model Whitelisting", - "Model(s) Whitelisted": "Model(s) Whitelisted", - "Modelfile": "Modelfile", - "Modelfile Advanced Settings": "Modelfile Advanced Settings", - "Modelfile Content": "Modelfile Content", - "Modelfiles": "Modelfiles", - "Models": "Models", - "My Documents": "My Documents", - "My Modelfiles": "My Modelfiles", - "My Prompts": "My Prompts", - "Name": "Name", - "Name Tag": "Name Tag", - "Name your modelfile": "Name your modelfile", - "New Chat": "New Chat", - "New Password": "New Password", - "Not sure what to add?": "Not sure what to add?", - "Not sure what to write? Switch to": "Not sure what to write? Switch to", - "Off": "Off", - "Okay, Let's Go!": "Okay, Let's Go!", + "Image Settings": "", + "Images": "", + "Import Chats": "", + "Import Documents Mapping": "", + "Import Modelfiles": "", + "Import Prompts": "", + "Include `--api` flag when running stable-diffusion-webui": "", + "Interface": "", + "join our Discord for help.": "", + "JSON": "", + "JWT Expiration": "", + "JWT Token": "", + "Keep Alive": "", + "Keyboard shortcuts": "", + "Language": "", + "Light": "", + "Listening...": "", + "LLMs can make mistakes. Verify important information.": "", + "Made by OpenWebUI Community": "", + "Make sure to enclose them with": "", + "Manage LiteLLM Models": "", + "Manage Models": "", + "Manage Ollama Models": "", + "Max Tokens": "", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "", + "Mirostat": "", + "Mirostat Eta": "", + "Mirostat Tau": "", + "MMMM DD, YYYY": "", + "Model '{{modelName}}' has been successfully downloaded.": "", + "Model '{{modelTag}}' is already in queue for downloading.": "", + "Model {{modelId}} not found": "", + "Model {{modelName}} already exists.": "", + "Model Name": "", + "Model not selected": "", + "Model Tag Name": "", + "Model Whitelisting": "", + "Model(s) Whitelisted": "", + "Modelfile": "", + "Modelfile Advanced Settings": "", + "Modelfile Content": "", + "Modelfiles": "", + "Models": "", + "My Documents": "", + "My Modelfiles": "", + "My Prompts": "", + "Name": "", + "Name Tag": "", + "Name your modelfile": "", + "New Chat": "", + "New Password": "", + "Not sure what to add?": "", + "Not sure what to write? Switch to": "", + "Off": "", + "Okay, Let's Go!": "", "Ollama Base URL": "", - "Ollama Version": "Ollama Version", - "On": "On", - "Only": "Only", - "Only alphanumeric characters and hyphens are allowed in the command string.": "Only alphanumeric characters and hyphens are allowed in the command string.", - "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.", - "Oops! Looks like the URL is invalid. Please double-check and try again.": "Oops! Looks like the URL is invalid. Please double-check and try again.", - "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.", - "Open": "Open", - "Open AI": "Open AI", + "Ollama Version": "", + "On": "", + "Only": "", + "Only alphanumeric characters and hyphens are allowed in the command string.": "", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "", + "Oops! Looks like the URL is invalid. Please double-check and try again.": "", + "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "", + "Open": "", + "Open AI": "", "Open AI (Dall-E)": "", - "Open new chat": "Open new chat", - "OpenAI API": "OpenAI API", + "Open new chat": "", + "OpenAI API": "", "OpenAI API Key": "", "OpenAI API Key is required.": "", - "or": "or", - "Parameters": "Parameters", - "Password": "Password", - "PDF Extract Images (OCR)": "PDF Extract Images (OCR)", - "pending": "pending", - "Permission denied when accessing microphone: {{error}}": "Permission denied when accessing microphone: {{error}}", - "Playground": "Playground", - "Profile": "Profile", - "Prompt Content": "Prompt Content", - "Prompt suggestions": "Prompt suggestions", - "Prompts": "Prompts", - "Pull a model from Ollama.com": "Pull a model from Ollama.com", - "Pull Progress": "Pull Progress", - "Query Params": "Query Params", - "RAG Template": "RAG Template", - "Raw Format": "Raw Format", - "Record voice": "Record voice", - "Redirecting you to OpenWebUI Community": "Redirecting you to OpenWebUI Community", - "Release Notes": "Release Notes", - "Repeat Last N": "Repeat Last N", - "Repeat Penalty": "Repeat Penalty", - "Request Mode": "Request Mode", - "Reset Vector Storage": "Reset Vector Storage", - "Response AutoCopy to Clipboard": "Response AutoCopy to Clipboard", - "Role": "Role", - "Rosé Pine": "Rosé Pine", - "Rosé Pine Dawn": "Rosé Pine Dawn", - "Save": "Save", - "Save & Create": "Save & Create", - "Save & Submit": "Save & Submit", - "Save & Update": "Save & Update", - "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through", - "Scan": "Scan", - "Scan complete!": "Scan complete!", - "Scan for documents from {{path}}": "Scan for documents from {{path}}", - "Search": "Search", - "Search Documents": "Search Documents", - "Search Prompts": "Search Prompts", - "See readme.md for instructions": "See readme.md for instructions", - "See what's new": "See what's new", - "Seed": "Seed", + "or": "", + "Parameters": "", + "Password": "", + "PDF Extract Images (OCR)": "", + "pending": "", + "Permission denied when accessing microphone: {{error}}": "", + "Playground": "", + "Profile": "", + "Prompt Content": "", + "Prompt suggestions": "", + "Prompts": "", + "Pull a model from Ollama.com": "", + "Pull Progress": "", + "Query Params": "", + "RAG Template": "", + "Raw Format": "", + "Record voice": "", + "Redirecting you to OpenWebUI Community": "", + "Release Notes": "", + "Repeat Last N": "", + "Repeat Penalty": "", + "Request Mode": "", + "Reset Vector Storage": "", + "Response AutoCopy to Clipboard": "", + "Role": "", + "Rosé Pine": "", + "Rosé Pine Dawn": "", + "Save": "", + "Save & Create": "", + "Save & Submit": "", + "Save & Update": "", + "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "", + "Scan": "", + "Scan complete!": "", + "Scan for documents from {{path}}": "", + "Search": "", + "Search Documents": "", + "Search Prompts": "", + "See readme.md for instructions": "", + "See what's new": "", + "Seed": "", "Select a mode": "", - "Select a model": "Select a model", + "Select a model": "", "Select an Ollama instance": "", - "Send a Message": "Send a Message", - "Send message": "Send message", - "Server connection verified": "Server connection verified", - "Set as default": "Set as default", - "Set Default Model": "Set Default Model", - "Set Image Size": "Set Image Size", - "Set Steps": "Set Steps", - "Set Title Auto-Generation Model": "Set Title Auto-Generation Model", - "Set Voice": "Set Voice", - "Settings": "Settings", - "Settings saved successfully!": "Settings saved successfully!", - "Share to OpenWebUI Community": "Share to OpenWebUI Community", - "short-summary": "short-summary", - "Show": "Show", - "Show Additional Params": "Show Additional Params", - "Show shortcuts": "Show shortcuts", - "sidebar": "sidebar", - "Sign in": "Sign in", - "Sign Out": "Sign Out", - "Sign up": "Sign up", - "Speech recognition error: {{error}}": "Speech recognition error: {{error}}", - "Speech-to-Text Engine": "Speech-to-Text Engine", - "SpeechRecognition API is not supported in this browser.": "SpeechRecognition API is not supported in this browser.", - "Stop Sequence": "Stop Sequence", - "STT Settings": "STT Settings", - "Submit": "Submit", - "Success": "Success", - "Successfully updated.": "Successfully updated.", - "Sync All": "Sync All", - "System": "System", - "System Prompt": "System Prompt", - "Tags": "Tags", - "Temperature": "Temperature", - "Template": "Template", - "Text Completion": "Text Completion", - "Text-to-Speech Engine": "Text-to-Speech Engine", - "Tfs Z": "Tfs Z", - "Theme": "Theme", - "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "This ensures that your valuable conversations are securely saved to your backend database. Thank you!", - "This setting does not sync across browsers or devices.": "This setting does not sync across browsers or devices.", - "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.", - "Title": "Title", - "Title Auto-Generation": "Title Auto-Generation", - "Title Generation Prompt": "Title Generation Prompt", - "to": "to", - "To access the available model names for downloading,": "To access the available model names for downloading,", - "To access the GGUF models available for downloading,": "To access the GGUF models available for downloading,", - "to chat input.": "to chat input.", - "Toggle settings": "Toggle settings", - "Toggle sidebar": "Toggle sidebar", - "Top K": "Top K", - "Top P": "Top P", - "Trouble accessing Ollama?": "Trouble accessing Ollama?", - "TTS Settings": "TTS Settings", + "Send a Message": "", + "Send message": "", + "Server connection verified": "", + "Set as default": "", + "Set Default Model": "", + "Set Image Size": "", + "Set Steps": "", + "Set Title Auto-Generation Model": "", + "Set Voice": "", + "Settings": "", + "Settings saved successfully!": "", + "Share to OpenWebUI Community": "", + "short-summary": "", + "Show": "", + "Show Additional Params": "", + "Show shortcuts": "", + "sidebar": "", + "Sign in": "", + "Sign Out": "", + "Sign up": "", + "Speech recognition error: {{error}}": "", + "Speech-to-Text Engine": "", + "SpeechRecognition API is not supported in this browser.": "", + "Stop Sequence": "", + "STT Settings": "", + "Submit": "", + "Success": "", + "Successfully updated.": "", + "Sync All": "", + "System": "", + "System Prompt": "", + "Tags": "", + "Temperature": "", + "Template": "", + "Text Completion": "", + "Text-to-Speech Engine": "", + "Tfs Z": "", + "Theme": "", + "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "", + "This setting does not sync across browsers or devices.": "", + "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "", + "Title": "", + "Title Auto-Generation": "", + "Title Generation Prompt": "", + "to": "", + "To access the available model names for downloading,": "", + "To access the GGUF models available for downloading,": "", + "to chat input.": "", + "Toggle settings": "", + "Toggle sidebar": "", + "Top K": "", + "Top P": "", + "Trouble accessing Ollama?": "", + "TTS Settings": "", "Type Hugging Face Resolve (Download) URL": "", - "Uh-oh! There was an issue connecting to {{provider}}.": "Uh-oh! There was an issue connecting to {{provider}}.", - "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "Unknown File Type '{{file_type}}', but accepting and treating as plain text", - "Update password": "Update password", - "Upload a GGUF model": "Upload a GGUF model", - "Upload files": "Upload files", - "Upload Progress": "Upload Progress", - "URL Mode": "URL Mode", - "Use '#' in the prompt input to load and select your documents.": "Use '#' in the prompt input to load and select your documents.", + "Uh-oh! There was an issue connecting to {{provider}}.": "", + "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "", + "Update password": "", + "Upload a GGUF model": "", + "Upload files": "", + "Upload Progress": "", + "URL Mode": "", + "Use '#' in the prompt input to load and select your documents.": "", "Use Gravatar": "", - "user": "user", - "User Permissions": "User Permissions", - "Users": "Users", - "Utilize": "Utilize", - "Valid time units:": "Valid time units:", - "variable": "variable", - "variable to have them replaced with clipboard content.": "variable to have them replaced with clipboard content.", - "Version": "Version", - "Web": "Web", - "WebUI Add-ons": "WebUI Add-ons", - "WebUI Settings": "WebUI Settings", - "WebUI will make requests to": "WebUI will make requests to", - "What’s New in": "What’s New in", - "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "When history is turned off, new chats on this browser won't appear in your history on any of your devices.", - "Whisper (Local)": "Whisper (Local)", - "Write a prompt suggestion (e.g. Who are you?)": "Write a prompt suggestion (e.g. Who are you?)", - "Write a summary in 50 words that summarizes [topic or keyword].": "Write a summary in 50 words that summarizes [topic or keyword].", - "You": "You", - "You're a helpful assistant.": "You're a helpful assistant.", - "You're now logged in.": "You're now logged in." + "user": "", + "User Permissions": "", + "Users": "", + "Utilize": "", + "Valid time units:": "", + "variable": "", + "variable to have them replaced with clipboard content.": "", + "Version": "", + "Web": "", + "WebUI Add-ons": "", + "WebUI Settings": "", + "WebUI will make requests to": "", + "What’s New in": "", + "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "", + "Whisper (Local)": "", + "Write a prompt suggestion (e.g. Who are you?)": "", + "Write a summary in 50 words that summarizes [topic or keyword].": "", + "You": "", + "You're a helpful assistant.": "", + "You're now logged in.": "" } From 0c021e42f5c4f50444d6223221a884c5c7501ddf Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Tue, 26 Mar 2024 23:15:51 +0330 Subject: [PATCH 28/57] rename config key to default_locale --- backend/data/config.json | 2 +- backend/main.py | 2 +- src/routes/+layout.svelte | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/data/config.json b/backend/data/config.json index 7d15c9e69..91259c3f1 100644 --- a/backend/data/config.json +++ b/backend/data/config.json @@ -1,7 +1,7 @@ { "version": 0, "ui": { - "locale": "en-US", + "default_locale": "en-US", "prompt_suggestions": [ { "title": [ diff --git a/backend/main.py b/backend/main.py index 6a5206213..b118c673a 100644 --- a/backend/main.py +++ b/backend/main.py @@ -167,7 +167,7 @@ async def get_app_config(): "status": True, "name": WEBUI_NAME, "version": VERSION, - "locale": CONFIG_DATA["ui"]["locale"], + "default_locale": CONFIG_DATA["ui"]["default_locale"], "images": images_app.state.ENABLED, "default_models": webui_app.state.DEFAULT_MODELS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 3334e0d2e..4ab2a62e4 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -25,8 +25,8 @@ if (backendConfig) { // Save Backend Status to Store await config.set(backendConfig); - if ($config.locale) { - initI18n($config.locale); + if ($config.default_locale) { + initI18n($config.default_locale); } else { initI18n(); } From addee2f248fd2fa6b4c01a57c591751739dfb1d9 Mon Sep 17 00:00:00 2001 From: ryankupk Date: Tue, 26 Mar 2024 23:07:01 +0000 Subject: [PATCH 29/57] Update svelte.config.js to suppress unused CSS selector warnings --- svelte.config.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/svelte.config.js b/svelte.config.js index a3c75a019..be8b3f529 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -16,7 +16,15 @@ const config = { assets: 'build', fallback: 'index.html' }) - } + }, + onwarn: (warning, handler) => { + const { code, _ } = warning; + if (code === "css-unused-selector") + return; + + handler(warning); + }, + }; export default config; From d69dfb7c8b2183a633bd849839e056e9317d4803 Mon Sep 17 00:00:00 2001 From: changchiyou Date: Wed, 27 Mar 2024 10:25:57 +0800 Subject: [PATCH 30/57] feat: support google chat webhook https://github.com/open-webui/open-webui/pull/1305/\#issuecomment-2021151237 --- backend/utils/webhook.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/utils/webhook.py b/backend/utils/webhook.py index 4cfa41640..ed626d03e 100644 --- a/backend/utils/webhook.py +++ b/backend/utils/webhook.py @@ -1,17 +1,18 @@ import json - import requests from config import VERSION, WEBUI_FAVICON_URL, WEBUI_NAME - def post_webhook(url: str, message: str, event_data: dict) -> bool: try: payload = {} - if "https://hooks.slack.com" in url: + # Slack and Google Chat Webhooks + if "https://hooks.slack.com" in url or "https://chat.googleapis.com" in url: payload["text"] = message + # Discord Webhooks elif "https://discord.com/api/webhooks" in url: payload["content"] = message + # Microsoft Teams Webhooks elif "webhook.office.com" in url: action = event_data.get("action", "undefined") facts = [ @@ -33,6 +34,7 @@ def post_webhook(url: str, message: str, event_data: dict) -> bool: } ], } + # Default Payload else: payload = {**event_data} @@ -41,4 +43,4 @@ def post_webhook(url: str, message: str, event_data: dict) -> bool: return True except Exception as e: print(e) - return False + return False \ No newline at end of file From f87d5d3d9bc946a951cac119326fcf5482a4496b Mon Sep 17 00:00:00 2001 From: Lim Geun Date: Wed, 27 Mar 2024 23:05:45 +0900 Subject: [PATCH 31/57] add ko-KR translation --- src/lib/i18n/locales/ko-KR/translation.json | 362 ++++++++++++++++++++ src/lib/i18n/locales/languages.json | 4 + 2 files changed, 366 insertions(+) create mode 100644 src/lib/i18n/locales/ko-KR/translation.json diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json new file mode 100644 index 000000000..87a9efe33 --- /dev/null +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -0,0 +1,362 @@ +{ + "'s', 'm', 'h', 'd', 'w' or '-1' for no expiration.": "'초', '분', '시간', '일', '주' 또는 만료 없음 '-1'", + "(Beta)": "(Beta)", + "(e.g. `sh webui.sh --api`)": "(예: `sh webui.sh --api`)", + "(latest)": "(latest)", + "{{modelName}} is thinking...": "{{modelName}} 이(가) 생각중입니다....", + "{{webUIName}} Backend Required": "{{webUIName}} 백엔드가 필요합니다.", + "a user": "사용자", + "About": "소개", + "Account": "계정", + "Action": "액션", + "Add a model": "모델 추가", + "Add a model tag name": "모델 태그명 추가", + "Add a short description about what this modelfile does": "이 모델파일이 하는 일에 대한 간단한 설명 추가", + "Add a short title for this prompt": "이 프롬프트에 대한 간단한 제목 추가", + "Add a tag": "태그 추가", + "Add Docs": "문서 추가", + "Add Files": "파일 추가", + "Add message": "메시지 추가", + "add tags": "태그들 추가", + "Adjusting these settings will apply changes universally to all users.": "이 설정을 조정하면 모든 사용자에게 적용됩니다.", + "admin": "관리자", + "Admin Panel": "관리자 패널", + "Admin Settings": "관리자 설정", + "Advanced Parameters": "고급 매개변수", + "all": "모두", + "All Users": "모든 사용자", + "Allow": "허용", + "Allow Chat Deletion": "채팅 삭제 허용", + "alphanumeric characters and hyphens": "영문자,숫자 및 하이픈", + "Already have an account?": "이미 계정이 있으신가요?", + "an assistant": "어시스턴트", + "and": "그리고", + "API Base URL": "API 기본 URL", + "API Key": "API키", + "API RPM": "API RPM", + "are allowed - Activate this command by typing": "허용됩니다 - 이 명령을 활성화하려면 입력하세요.", + "Are you sure?": "확실합니까?", + "Audio": "오디오", + "Auto-playback response": "응답 자동 재생", + "Auto-send input after 3 sec.": "3초 후 입력 자동 전송", + "AUTOMATIC1111 Base URL": "AUTOMATIC1111 Base URL", + "AUTOMATIC1111 Base URL is required.": "AUTOMATIC1111 Base URL이 필요합니다.", + "available!": "사용 가능!", + "Back": "뒤로가기", + "Builder Mode": "빌더 모드", + "Cancel": "취소", + "Categories": "분류", + "Change Password": "비밀번호 변경", + "Chat": "채팅", + "Chat History": "채팅 기록", + "Chat History is off for this browser.": "이 브라우저에서 채팅 기록이 꺼져 있습니다.", + "Chats": "채팅", + "Check Again": "다시 확인", + "Check for updates": "업데이트 확인", + "Checking for updates...": "업데이트 확인중...", + "Choose a model before saving...": "저장하기 전에 모델을 선택하세요...", + "Chunk Overlap": "Chunk Overlap", + "Chunk Params": "Chunk Params", + "Chunk Size": "Chunk Size", + "Click here for help.": "도움말을 보려면 여기를 클릭하세요.", + "Click here to check other modelfiles.": "다른 모델파일을 확인하려면 여기를 클릭하세요.", + "Click here to select": "선택하려면 여기를 클릭하세요.", + "Click here to select documents.": "문서를 선택하려면 여기를 클릭하세요.", + "click here.": "여기를 클릭하세요.", + "Click on the user role button to change a user's role.": "사용자 역할 버튼을 클릭하여 사용자의 역할을 변경하세요.", + "Close": "닫기", + "Collection": "컬렉션", + "Command": "명령", + "Confirm Password": "비밀번호 확인", + "Connections": "연결", + "Content": "내용", + "Context Length": "내용 길이", + "Conversation Mode": "대화 모드", + "Copy last code block": "마지막 코드 블록 복사", + "Copy last response": "마지막 응답 복사", + "Copying to clipboard was successful!": "클립보드에 복사되었습니다!", + "Create a concise, 3-5 word phrase as a header for the following query, strictly adhering to the 3-5 word limit and avoiding the use of the word 'title':": "다음 질문에 대한 제목으로 간결한 3-5 단어 문구를 만드되 3-5 단어 제한을 엄격히 준수하고 'title' 단어 사용을 피하세요:", + "Create a modelfile": "모델파일 만들기", + "Create Account": "계정 만들기", + "Created at": "생성일", + "Created by": "생성자", + "Current Model": "현재 모델", + "Current Password": "현재 비밀번호", + "Custom": "사용자 정의", + "Customize Ollama models for a specific purpose": "특정 목적으로 Ollama 모델 사용자 정의", + "Dark": "어두운", + "Database": "데이터베이스", + "DD/MM/YYYY HH:mm": "DD/MM/YYYY HH:mm", + "Default": "기본값", + "Default (Automatic1111)": "기본값 (Automatic1111)", + "Default (Web API)": "기본값 (Web API)", + "Default model updated": "기본 모델이 업데이트되었습니다.", + "Default Prompt Suggestions": "기본 프롬프트 제안", + "Default User Role": "기본 사용자 역할", + "delete": "삭제", + "Delete a model": "모델 삭제", + "Delete chat": "채팅 삭제", + "Delete Chats": "채팅들 삭제", + "Deleted {{deleteModelTag}}": "{{deleteModelTag}} 삭제됨", + "Deleted {tagName}": "{tagName} 삭제됨", + "Description": "설명", + "Desktop Notifications": "알림", + "Disabled": "비활성화", + "Discover a modelfile": "모델파일 검색", + "Discover a prompt": "프롬프트 검색", + "Discover, download, and explore custom prompts": "사용자 정의 프롬프트 검색, 다운로드 및 탐색", + "Discover, download, and explore model presets": "모델 사전 설정 검색, 다운로드 및 탐색", + "Display the username instead of You in the Chat": "채팅에서 'You' 대신 사용자 이름 표시", + "Document": "문서", + "Document Settings": "문서 설정", + "Documents": "문서들", + "does not make any external connections, and your data stays securely on your locally hosted server.": "어떠한 외부 연결도 하지 않으며, 데이터는 로컬에서 호스팅되는 서버에 안전하게 유지됩니다.", + "Don't Allow": "허용 안 함", + "Don't have an account?": "계정이 없으신가요?", + "Download as a File": "파일로 다운로드", + "Download Database": "데이터베이스 다운로드", + "Drop any files here to add to the conversation": "대화에 추가할 파일을 여기에 드롭하세요.", + "e.g. '30s','10m'. Valid time units are 's', 'm', 'h'.": "예: '30s','10m'. 유효한 시간 단위는 's', 'm', 'h'입니다.", + "Edit Doc": "문서 편집", + "Edit User": "사용자 편집", + "Email": "이메일", + "Enable Chat History": "채팅 기록 활성화", + "Enable New Sign Ups": "새 회원가입 활성화", + "Enabled": "활성화", + "Enter {{role}} message here": "여기에 {{role}} 메시지 입력", + "Enter API Key": "API 키 입력", + "Enter Chunk Overlap": "청크 오버랩 입력", + "Enter Chunk Size": "청크 크기 입력", + "Enter Image Size (e.g. 512x512)": "이미지 크기 입력(예: 512x512)", + "Enter LiteLLM API Base URL (litellm_params.api_base)": "LiteLLM API 기본 URL 입력(litellm_params.api_base)", + "Enter LiteLLM API Key (litellm_params.api_key)": "LiteLLM API 키 입력(litellm_params.api_key)", + "Enter LiteLLM API RPM (litellm_params.rpm)": "LiteLLM API RPM 입력(litellm_params.rpm)", + "Enter LiteLLM Model (litellm_params.model)": "LiteLLM 모델 입력(litellm_params.model)", + "Enter Max Tokens (litellm_params.max_tokens)": "최대 토큰 수 입력(litellm_params.max_tokens)", + "Enter model tag (e.g. {{modelTag}})": "모델 태그 입력(예: {{modelTag}})", + "Enter Number of Steps (e.g. 50)": "단계 수 입력(예: 50)", + "Enter stop sequence": "중지 시퀀스 입력", + "Enter Top K": "Top K 입력", + "Enter URL (e.g. http://127.0.0.1:7860/)": "URL 입력(예: http://127.0.0.1:7860/)", + "Enter Your Email": "이메일 입력", + "Enter Your Full Name": "전체 이름 입력", + "Enter Your Password": "비밀번호 입력", + "Experimental": "실험적", + "Export All Chats (All Users)": "모든 채팅 내보내기 (모든 사용자)", + "Export Chats": "채팅 내보내기", + "Export Documents Mapping": "문서 매핑 내보내기", + "Export Modelfiles": "모델파일 내보내기", + "Export Prompts": "프롬프트 내보내기", + "Failed to read clipboard contents": "클립보드 내용을 읽는 데 실패했습니다.", + "File Mode": "파일 모드", + "File not found.": "파일을 찾을 수 없습니다.", + "Focus chat input": "채팅 입력 포커스", + "Format your variables using square brackets like this:": "이렇게 대괄호를 사용하여 변수를 형식화하세요:", + "From (Base Model)": "출처(기본 모델)", + "Full Screen Mode": "전체 화면 모드", + "General": "일반", + "General Settings": "일반 설정", + "Hello, {{name}}": "안녕하세요, {{name}}", + "Hide": "숨기기", + "Hide Additional Params": "추가 매개변수 숨기기", + "How can I help you today?": "오늘 어떻게 도와드릴까요?", + "Image Generation (Experimental)": "이미지 생성(실험적)", + "Image Generation Engine": "이미지 생성 엔진", + "Image Settings": "이미지 설정", + "Images": "이미지", + "Import Chats": "채팅 가져오기", + "Import Documents Mapping": "문서 매핑 가져오기", + "Import Modelfiles": "모델파일 가져오기", + "Import Prompts": "프롬프트 가져오기", + "Include --api flag when running stable-diffusion-webui": "stable-diffusion-webui를 실행할 때 --api 플래그 포함", + "Interface": "인터페이스", + "join our Discord for help.": "도움말을 보려면 Discord에 가입하세요.", + "JSON": "JSON", + "JWT Expiration": "JWT 만료", + "JWT Token": "JWT 토큰", + "Keep Alive": "계속 유지하기", + "Keyboard shortcuts": "키보드 단축키", + "Language": "언어", + "Light": "밝음", + "Listening...": "청취 중...", + "LLMs can make mistakes. Verify important information.": "LLM은 실수를 할 수 있습니다. 중요한 정보를 확인하세요.", + "Made by OpenWebUI Community": "OpenWebUI 커뮤니티에서 제작", + "Make sure to enclose them with": "다음으로 묶는 것을 잊지 마세요:", + "Manage LiteLLM Models": "LiteLLM 모델 관리", + "Manage Models": "모델 관리", + "Manage Ollama Models": "Ollama 모델 관리", + "Max Tokens": "최대 토큰 수", + "Maximum of 3 models can be downloaded simultaneously. Please try again later.": "최대 3개의 모델을 동시에 다운로드할 수 있습니다. 나중에 다시 시도하세요.", + "Mirostat": "Mirostat", + "Mirostat Eta": "Mirostat Eta", + "Mirostat Tau": "Mirostat Tau", + "Model '{{modelName}}' has been successfully downloaded.": "모델 '{{modelName}}'이(가) 성공적으로 다운로드되었습니다.", + "Model '{{modelTag}}' is already in queue for downloading.": "모델 '{{modelTag}}'이(가) 이미 다운로드 대기열에 있습니다.", + "Model {{modelId}} not found": "모델 {{modelId}}를 찾을 수 없습니다.", + "Model {{modelName}} already exists.": "모델 {{modelName}}이(가) 이미 존재합니다.", + "Model Name": "모델 이름", + "Model not selected": "모델이 선택되지 않았습니다.", + "Model Tag Name": "모델 태그 이름", + "Model Whitelisting": "모델 허용 목록", + "Model(s) Whitelisted": "허용된 모델", + "Modelfile": "모델파일", + "Modelfile Advanced Settings": "모델파일 고급 설정", + "Modelfile Content": "모델파일 내용", + "Modelfiles": "모델파일", + "Models": "모델", + "My Documents": "내 문서", + "My Modelfiles": "내 모델파일", + "My Prompts": "내 프롬프트", + "Name": "이름", + "Name Tag": "이름 태그", + "Name your modelfile": "모델파일 이름 지정", + "New Chat": "새 채팅", + "New Password": "새 비밀번호", + "Not sure what to add?": "추가할 것이 궁금하세요?", + "Not sure what to write? Switch to": "무엇을 쓸지 모르겠나요? 전환하세요.", + "Off": "끄기", + "Okay, Let's Go!": "그렇습니다, 시작합시다!", + "Ollama Base URL": "Ollama 기본 URL", + "Ollama Version": "Ollama 버전", + "On": "켜기", + "Only": "오직", + "Only alphanumeric characters and hyphens are allowed in the command string.": "명령어 문자열에는 영문자, 숫자 및 하이픈만 허용됩니다.", + "Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.": "이런! 잠시만 기다려 주세요! 파일이 아직 처리 중입니다. 완벽하게 준비하고 있습니다. 잠시만 기다려주시면 준비가 되면 알려드리겠습니다.", + "Oops! Looks like the URL is invalid. Please double-check and try again.": "이런! URL이 잘못된 것 같습니다. 다시 한번 확인하고 다시 시도해주세요.", + "Oops! You're using an unsupported method (frontend only). Please serve the WebUI from the backend.": "이런! 지원되지 않는 방식(프론트엔드 전용)을 사용하고 계십니다. 백엔드에서 WebUI를 제공해주세요.", + "Open": "열기", + "Open AI": "Open AI", + "Open AI (Dall-E)": "OpenAI (Dall-E)", + "Open new chat": "새 채팅 열기", + "OpenAI API": "OpenAI API", + "OpenAI API Key": "OpenAI API 키", + "OpenAI API Key is required.": "OpenAI API 키가 필요합니다.", + "or": "또는", + "Parameters": "매개변수", + "Password": "비밀번호", + "PDF Extract Images (OCR)": "PDF에서 이미지 추출 (OCR)", + "pending": "보류 중", + "Permission denied when accessing microphone: {{error}}": "마이크 액세스가 거부되었습니다: {{error}}", + "Playground": "놀이터", + "Profile": "프로필", + "Prompt Content": "프롬프트 내용", + "Prompt suggestions": "프롬프트 제안", + "Prompts": "프롬프트", + "Pull a model from Ollama.com": "Ollama.com에서 모델 가져오기", + "Pull Progress": "가져오기 진행 상황", + "Query Params": "쿼리 매개변수", + "RAG Template": "RAG 템플릿", + "Raw Format": "Raw 형식", + "Record voice": "음성 녹음", + "Redirecting you to OpenWebUI Community": "OpenWebUI 커뮤니티로 리디렉션하는 중", + "Release Notes": "릴리스 노트", + "Repeat Last N": "마지막 N 반복", + "Repeat Penalty": "반복 패널티", + "Request Mode": "요청 모드", + "Reset Vector Storage": "벡터 스토리지 초기화", + "Response AutoCopy to Clipboard": "응답 자동 클립보드 복사", + "Role": "역할", + "Rosé Pine": "로제 파인", + "Rosé Pine Dawn": "로제 파인 던", + "Save": "저장", + "Save & Create": "저장 및 생성", + "Save & Submit": "저장 및 제출", + "Save & Update": "저장 및 업데이트", + "Saving chat logs directly to your browser's storage is no longer supported. Please take a moment to download and delete your chat logs by clicking the button below. Don't worry, you can easily re-import your chat logs to the backend through": "브라우저의 저장소에 채팅 로그를 직접 저장하는 것은 더 이상 지원되지 않습니다. 아래 버튼을 클릭하여 채팅 로그를 다운로드하고 삭제하세요. 걱정 마세요. 백엔드를 통해 채팅 로그를 쉽게 다시 가져올 수 있습니다.", + "Scan": "스캔", + "Scan complete!": "스캔 완료!", + "Scan for documents from {{path}}": "{{path}}에서 문서 스캔", + "Search": "검색", + "Search Documents": "문서 검색", + "Search Prompts": "프롬프트 검색", + "See readme.md for instructions": "설명은 readme.md를 참조하세요.", + "See what's new": "새로운 기능 보기", + "Seed": "시드", + "Select a mode": "모드 선택", + "Select a model": "모델 선택", + "Select an Ollama instance": "Ollama 인스턴스 선택", + "Send a Message": "메시지 보내기", + "Send message": "메시지 보내기", + "Server connection verified": "서버 연결 확인됨", + "Set as default": "기본값으로 설정", + "Set Default Model": "기본 모델 설정", + "Set Image Size": "이미지 크기 설정", + "Set Steps": "단계 설정", + "Set Title Auto-Generation Model": "제목 자동 생성 모델 설정", + "Set Voice": "음성 설정", + "Settings": "설정", + "Settings saved successfully!": "설정이 성공적으로 저장되었습니다!", + "Share to OpenWebUI Community": "OpenWebUI 커뮤니티에 공유", + "short-summary": "간단한 요약", + "Show": "보이기", + "Show Additional Params": "추가 매개변수 보기", + "Show shortcuts": "단축키 보기", + "sidebar": "사이드바", + "Sign in": "로그인", + "Sign Out": "로그아웃", + "Sign up": "가입", + "Speech recognition error: {{error}}": "음성 인식 오류: {{error}}", + "Speech-to-Text Engine": "음성-텍스트 엔진", + "SpeechRecognition API is not supported in this browser.": "이 브라우저에서는 SpeechRecognition API를 지원하지 않습니다.", + "Stop Sequence": "중지 시퀀스", + "STT Settings": "STT 설정", + "Submit": "제출", + "Success": "성공", + "Successfully updated.": "성공적으로 업데이트되었습니다.", + "Sync All": "모두 동기화", + "System": "시스템", + "System Prompt": "시스템 프롬프트", + "Tags": "Tags", + "Temperature": "Temperature", + "Template": "Template", + "Text Completion": "텍스트 완성", + "Text-to-Speech Engine": "텍스트-음성 엔진", + "Tfs Z": "Tfs Z", + "Theme": "테마", + "This ensures that your valuable conversations are securely saved to your backend database. Thank you!": "이렇게 하면 소중한 대화 내용이 백엔드 데이터베이스에 안전하게 저장됩니다. 감사합니다!", + "This setting does not sync across browsers or devices.": "이 설정은 브라우저 또는 장치 간에 동기화되지 않습니다.", + "Tip: Update multiple variable slots consecutively by pressing the tab key in the chat input after each replacement.": "팁: 각 대체 후 채팅 입력에서 탭 키를 눌러 여러 개의 변수 슬롯을 연속적으로 업데이트하세요.", + "Title": "제목", + "Title Auto-Generation": "제목 자동 생성", + "Title Generation Prompt": "제목 생성 프롬프트", + "to": "~까지", + "To access the available model names for downloading,": "다운로드 가능한 모델명을 확인하려면,", + "To access the GGUF models available for downloading,": "다운로드 가능한 GGUF 모델을 확인하려면,", + "to chat input.": "채팅 입력으로.", + "Toggle settings": "설정 전환", + "Toggle sidebar": "사이드바 전환", + "Top K": "Top K", + "Top P": "Top P", + "Trouble accessing Ollama?": "Ollama에 접근하는 데 문제가 있나요?", + "TTS Settings": "TTS 설정", + "Type Hugging Face Resolve (Download) URL": "Hugging Face Resolve (다운로드) URL 입력", + "Uh-oh! There was an issue connecting to {{provider}}.": "앗! {{provider}}에 연결하는 데 문제가 있었습니다.", + "Unknown File Type '{{file_type}}', but accepting and treating as plain text": "알 수 없는 파일 유형 '{{file_type}}', 하지만 일반 텍스트로 허용하고 처리합니다.", + "Update password": "비밀번호 업데이트", + "Upload a GGUF model": "GGUF 모델 업로드", + "Upload files": "파일 업로드", + "Upload Progress": "업로드 진행 상황", + "URL Mode": "URL 모드", + "Use '#' in the prompt input to load and select your documents.": "프롬프트 입력에서 '#'를 사용하여 문서를 로드하고 선택하세요.", + "Use Gravatar": "Gravatar 사용", + "user": "사용자", + "User Permissions": "사용자 권한", + "Users": "사용자", + "Utilize": "활용", + "Valid time units:": "유효한 시간 단위:", + "variable": "변수", + "variable to have them replaced with clipboard content.": "변수를 사용하여 클립보드 내용으로 바꾸세요.", + "Version": "버전", + "Web": "웹", + "WebUI Add-ons": "WebUI 애드온", + "WebUI Settings": "WebUI 설정", + "WebUI will make requests to": "WebUI가 요청할 대상:", + "What's New in": "새로운 기능", + "When history is turned off, new chats on this browser won't appear in your history on any of your devices.": "기록 기능이 꺼져 있으면 이 브라우저의 새 채팅이 다른 장치의 채팅 기록에 나타나지 않습니다.", + "Whisper (Local)": "위스퍼 (Local)", + "Write a prompt suggestion (e.g. Who are you?)": "프롬프트 제안 작성 (예: 당신은 누구인가요?)", + "Write a summary in 50 words that summarizes [topic or keyword].": "[주제 또는 키워드]에 대한 50단어 요약문 작성.", + "You": "당신", + "You're a helpful assistant.": "당신은 유용한 어시스턴트입니다.", + "You're now logged in.": "로그인되었습니다." +} diff --git a/src/lib/i18n/locales/languages.json b/src/lib/i18n/locales/languages.json index b2f3e36e6..becba8c2d 100644 --- a/src/lib/i18n/locales/languages.json +++ b/src/lib/i18n/locales/languages.json @@ -66,5 +66,9 @@ { "code": "zh-TW", "title": "Chinese (Traditional)" + }, + { + "code": "ko-KR", + "title": "Korean" } ] \ No newline at end of file From 976c714063b10cceabb7cb7310cb52731382e2f0 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 10:50:30 -0700 Subject: [PATCH 32/57] feat: OLED dark theme --- src/lib/components/chat/Settings/General.svelte | 15 ++++++++++++--- tailwind.config.js | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 35f777a78..e1869f828 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -97,6 +97,10 @@ themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; } + if (themeToApply === 'dark') { + document.documentElement.style.setProperty('--color-gray-900', '#171717'); + } + themes .filter((e) => e !== themeToApply) .forEach((e) => { @@ -113,10 +117,14 @@ }; const themeChangeHandler = (_theme: string) => { - theme.set(_theme); - localStorage.setItem('theme', _theme); + if (_theme === 'oled') { + document.documentElement.style.setProperty('--color-gray-900', '#000000'); + } else { + theme.set(_theme); + localStorage.setItem('theme', _theme); - applyTheme(_theme); + applyTheme(_theme); + } }; @@ -139,6 +147,7 @@ +
diff --git a/tailwind.config.js b/tailwind.config.js index 4a2143191..63413ccdb 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -16,8 +16,7 @@ export default { 700: '#4e4e4e', 800: '#333', 850: '#262626', - - 900: '#171717', + 900: 'var(--color-gray-900, #171717)', 950: '#0d0d0d' } }, From c24d9d3beab709479a88979f26728095f25d32ee Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 11:23:00 -0700 Subject: [PATCH 33/57] Add 'oled' theme option to themes list --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index e1869f828..fb05668eb 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -14,7 +14,7 @@ export let getModels: Function; // General - let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light']; + let themes = ['dark', 'light', 'rose-pine dark', 'rose-pine-dawn light', 'oled']; let selectedTheme = 'system'; let languages = []; From 19d21212527dab4008e9ce68d7108b5f20a38772 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 27 Mar 2024 13:08:43 -0700 Subject: [PATCH 34/57] fix: docker issue --- backend/config.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/config.py b/backend/config.py index 27311face..ff73baf75 100644 --- a/backend/config.py +++ b/backend/config.py @@ -117,7 +117,18 @@ else: log = logging.getLogger(__name__) log.info(f"GLOBAL_LOG_LEVEL: {GLOBAL_LOG_LEVEL}") -log_sources = ["AUDIO", "CONFIG", "DB", "IMAGES", "LITELLM", "MAIN", "MODELS", "OLLAMA", "OPENAI", "RAG"] +log_sources = [ + "AUDIO", + "CONFIG", + "DB", + "IMAGES", + "LITELLM", + "MAIN", + "MODELS", + "OLLAMA", + "OPENAI", + "RAG", +] SRC_LOG_LEVELS = {} @@ -239,7 +250,7 @@ OLLAMA_API_BASE_URL = os.environ.get( ) OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "") -KUBERNETES_SERVICE_HOST = os.environ.get("KUBERNETES_SERVICE_HOST", "") +K8S_FLAG = os.environ.get("K8S_FLAG", "") if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": OLLAMA_BASE_URL = ( @@ -249,9 +260,10 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "": ) if ENV == "prod": - if OLLAMA_BASE_URL == "/ollama" and KUBERNETES_SERVICE_HOST == "": + if OLLAMA_BASE_URL == "/ollama": OLLAMA_BASE_URL = "http://host.docker.internal:11434" - else: + + elif K8S_FLAG: OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434" From 25c71d8ac2eadea2babb25e2cc077c843ac5aea0 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:04:34 -0700 Subject: [PATCH 35/57] Update theme options and persist OLED dark theme if selected --- src/app.html | 6 +++++- .../components/chat/Settings/General.svelte | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/app.html b/src/app.html index c52cff98c..45b5d20e7 100644 --- a/src/app.html +++ b/src/app.html @@ -9,7 +9,11 @@ @@ -147,7 +150,7 @@ - +
From dfeadf9595e6893bf5134e55ad911527071098f5 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:05:37 -0700 Subject: [PATCH 36/57] ordering of themes in select menu, group dark themes together --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 5e9c3c414..95b93824b 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -147,10 +147,10 @@ > + - From cf442097300c42fb7d40dced3e51bfef351ec00a Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:19:02 -0700 Subject: [PATCH 37/57] refac: code style --- src/lib/components/chat/Settings/General.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 95b93824b..65d358f8c 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -91,11 +91,7 @@ }); const applyTheme = (_theme: string) => { - let themeToApply = _theme; - - if (themeToApply.includes('oled')) { - themeToApply = 'dark'; - } + let themeToApply = _theme === 'oled-dark' ? 'dark' : _theme; if (_theme === 'system') { themeToApply = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; From 572eefe18175c7a8b6643ceb2923a3f65c8cd586 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 16:19:57 -0700 Subject: [PATCH 38/57] =?UTF-8?q?use=20=F0=9F=8C=83=20emoji=20for=20oled-d?= =?UTF-8?q?ark=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/chat/Settings/General.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 65d358f8c..3da335170 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -143,7 +143,7 @@ > - + From 9ad097d2655aff1822c2e4a4639482911a12eff5 Mon Sep 17 00:00:00 2001 From: ConnorsApps Date: Wed, 27 Mar 2024 20:35:21 -0400 Subject: [PATCH 39/57] fix: pvc storageClassName typo --- kubernetes/helm/templates/ollama-statefulset.yaml | 2 +- kubernetes/helm/templates/webui-pvc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/helm/templates/ollama-statefulset.yaml b/kubernetes/helm/templates/ollama-statefulset.yaml index a87aeab09..c348b04c0 100644 --- a/kubernetes/helm/templates/ollama-statefulset.yaml +++ b/kubernetes/helm/templates/ollama-statefulset.yaml @@ -88,7 +88,7 @@ spec: resources: requests: storage: {{ .Values.ollama.persistence.size | quote }} - storageClass: {{ .Values.ollama.persistence.storageClass }} + storageClassName: {{ .Values.ollama.persistence.storageClass }} {{- with .Values.ollama.persistence.selector }} selector: {{- toYaml . | nindent 8 }} diff --git a/kubernetes/helm/templates/webui-pvc.yaml b/kubernetes/helm/templates/webui-pvc.yaml index 06b2cc4a4..f06454e7a 100644 --- a/kubernetes/helm/templates/webui-pvc.yaml +++ b/kubernetes/helm/templates/webui-pvc.yaml @@ -17,7 +17,7 @@ spec: resources: requests: storage: {{ .Values.webui.persistence.size }} - storageClass: {{ .Values.webui.persistence.storageClass }} + storageClassName: {{ .Values.webui.persistence.storageClass }} {{- with .Values.webui.persistence.selector }} selector: {{- toYaml . | nindent 4 }} From 67865fc5adb230c0cfb74385482665b0caf87172 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Wed, 27 Mar 2024 22:39:47 -0700 Subject: [PATCH 40/57] dynamically adjust --color-gray-950 value for OLED black sidebar --- src/app.html | 1 + src/lib/components/chat/Settings/General.svelte | 2 ++ tailwind.config.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.html b/src/app.html index 45b5d20e7..c9f86d8f6 100644 --- a/src/app.html +++ b/src/app.html @@ -11,6 +11,7 @@ (() => { if (localStorage.theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#000000'); + document.documentElement.style.setProperty('--color-gray-950', '#000000'); document.documentElement.classList.add('dark'); } else if ( diff --git a/src/lib/components/chat/Settings/General.svelte b/src/lib/components/chat/Settings/General.svelte index 3da335170..3b7126d85 100644 --- a/src/lib/components/chat/Settings/General.svelte +++ b/src/lib/components/chat/Settings/General.svelte @@ -99,6 +99,7 @@ if (themeToApply === 'dark' && !_theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#171717'); + document.documentElement.style.setProperty('--color-gray-950', '#0d0d0d'); } themes @@ -121,6 +122,7 @@ localStorage.setItem('theme', _theme); if (_theme.includes('oled')) { document.documentElement.style.setProperty('--color-gray-900', '#000000'); + document.documentElement.style.setProperty('--color-gray-950', '#000000'); document.documentElement.classList.add('dark'); } applyTheme(_theme); diff --git a/tailwind.config.js b/tailwind.config.js index 63413ccdb..9caccabf5 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -17,7 +17,7 @@ export default { 800: '#333', 850: '#262626', 900: 'var(--color-gray-900, #171717)', - 950: '#0d0d0d' + 950: 'var(--color-gray-950, #0d0d0d)' } }, typography: { From d187b1615a751d83d648bcbeab1dd71f8ff298db Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 27 Mar 2024 23:51:26 -0700 Subject: [PATCH 41/57] fix: language ordering --- src/lib/i18n/locales/languages.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/i18n/locales/languages.json b/src/lib/i18n/locales/languages.json index becba8c2d..567900722 100644 --- a/src/lib/i18n/locales/languages.json +++ b/src/lib/i18n/locales/languages.json @@ -39,6 +39,10 @@ "code": "ja-JP", "title": "Japanese" }, + { + "code": "ko-KR", + "title": "Korean" + }, { "code": "nl-NL", "title": "Dutch (Netherlands)" @@ -66,9 +70,5 @@ { "code": "zh-TW", "title": "Chinese (Traditional)" - }, - { - "code": "ko-KR", - "title": "Korean" } ] \ No newline at end of file From b93bdfb222d2b83ac6c69ce23c1131ede4ed8f99 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 28 Mar 2024 02:44:16 -0700 Subject: [PATCH 42/57] fix: theme issue --- src/app.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app.html b/src/app.html index c9f86d8f6..f731761cf 100644 --- a/src/app.html +++ b/src/app.html @@ -9,12 +9,11 @@
{#if showTagInput}
-
- - {/if}
-
- +
+
+
+
+ model.name !== 'hr') + .map((model) => ({ + value: model.id, + label: model.name, + info: model + }))} + bind:value={selectedModelId} + /> +
+
+