From 6b0af942db2f60762866a7ddb847b925635293d0 Mon Sep 17 00:00:00 2001 From: Tiancong Li Date: Thu, 6 Mar 2025 07:23:55 +0800 Subject: [PATCH 1/9] i18n: update zh-TW --- src/lib/i18n/locales/zh-TW/translation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/i18n/locales/zh-TW/translation.json b/src/lib/i18n/locales/zh-TW/translation.json index 8cb3632c4..cba9e6291 100644 --- a/src/lib/i18n/locales/zh-TW/translation.json +++ b/src/lib/i18n/locales/zh-TW/translation.json @@ -450,7 +450,7 @@ "Example: mail": "範例:mail", "Example: ou=users,dc=foo,dc=example": "範例:ou=users,dc=foo,dc=example", "Example: sAMAccountName or uid or userPrincipalName": "範例:sAMAccountName 或 uid 或 userPrincipalName", - "Exceeded the number of seats in your license. Please contact support to increase the number of seats.": "", + "Exceeded the number of seats in your license. Please contact support to increase the number of seats.": "您的授權名額已超過上限。請聯絡支援以增加授權名額。", "Exclude": "排除", "Execute code for analysis": "執行程式碼以進行分析", "Expand": "展開", @@ -1158,7 +1158,7 @@ "Write your model template content here": "在此撰寫您的模型範本内容", "Yesterday": "昨天", "You": "您", - "You are currently using a trial license. Please contact support to upgrade your license.": "", + "You are currently using a trial license. Please contact support to upgrade your license.": "您目前使用的是試用授權。請聯絡支援以升級您的授權。", "You can only chat with a maximum of {{maxCount}} file(s) at a time.": "您一次最多只能與 {{maxCount}} 個檔案進行對話。", "You can personalize your interactions with LLMs by adding memories through the 'Manage' button below, making them more helpful and tailored to you.": "您可以透過下方的「管理」按鈕新增記憶,將您與大型語言模型的互動個人化,讓它們更有幫助並更符合您的需求。", "You cannot upload an empty file.": "您無法上傳空檔案", From 23bb0d927f6924c0b5f5a89140fdfbf4bdb1694c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 18:10:24 -0800 Subject: [PATCH 2/9] chore: format --- backend/open_webui/static/site.webmanifest | 40 +++++++++++----------- backend/open_webui/utils/auth.py | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/backend/open_webui/static/site.webmanifest b/backend/open_webui/static/site.webmanifest index 2b74733fa..95915ae2b 100644 --- a/backend/open_webui/static/site.webmanifest +++ b/backend/open_webui/static/site.webmanifest @@ -1,21 +1,21 @@ { - "name": "Open WebUI", - "short_name": "WebUI", - "icons": [ - { - "src": "/static/web-app-manifest-192x192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "/static/web-app-manifest-512x512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -} + "name": "Open WebUI", + "short_name": "WebUI", + "icons": [ + { + "src": "/static/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "/static/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/backend/open_webui/utils/auth.py b/backend/open_webui/utils/auth.py index d0c02a569..6dd3234b0 100644 --- a/backend/open_webui/utils/auth.py +++ b/backend/open_webui/utils/auth.py @@ -72,7 +72,7 @@ def get_license_data(app, key): if key: try: res = requests.post( - "https://api.openwebui.com/api/v1/license", + "https://api.openwebui.com/api/v1/license/", json={"key": key, "version": "1"}, timeout=5, ) From f9b44c6bf2834fa36c5b54cd6706ab699553a384 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 18:39:32 -0800 Subject: [PATCH 3/9] refac --- src/lib/components/chat/Chat.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 74f57f564..338ff75d0 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1937,7 +1937,7 @@ - {#if $banners.length > 0 && !history.currentId && !$chatId && selectedModels.length <= 1} + {#if ($banners.length > 0 && !history.currentId && !$chatId && selectedModels.length <= 1) || ($config?.license_metadata?.type ?? null) === 'trial' || (($config?.license_metadata?.seats ?? null) !== null && $config?.user_count > $config?.license_metadata?.seats)}
{#if ($config?.license_metadata?.type ?? null) === 'trial'} From 5e78a5c510c959625120445aaebd279d1731efc2 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:06:28 -0800 Subject: [PATCH 4/9] enh: enable_code_execution toggle Co-Authored-By: recrudesce <6450799+recrudesce@users.noreply.github.com> --- backend/open_webui/config.py | 9 ++++++++- backend/open_webui/main.py | 3 +++ backend/open_webui/routers/configs.py | 5 +++++ src/lib/components/admin/Settings/CodeExecution.svelte | 10 ++++++++++ src/lib/components/chat/Chat.svelte | 2 +- src/lib/components/chat/Messages/CodeBlock.svelte | 2 +- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index b2a1dc00b..9b8e865fc 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1377,6 +1377,11 @@ Responses from models: {{responses}}""" # Code Interpreter #################################### +ENABLE_CODE_EXECUTION = PersistentConfig( + "ENABLE_CODE_EXECUTION", + "code_execution.enable", + os.environ.get("ENABLE_CODE_EXECUTION", "True").lower() == "true", +) CODE_EXECUTION_ENGINE = PersistentConfig( "CODE_EXECUTION_ENGINE", @@ -1553,7 +1558,9 @@ ELASTICSEARCH_USERNAME = os.environ.get("ELASTICSEARCH_USERNAME", None) ELASTICSEARCH_PASSWORD = os.environ.get("ELASTICSEARCH_PASSWORD", None) ELASTICSEARCH_CLOUD_ID = os.environ.get("ELASTICSEARCH_CLOUD_ID", None) SSL_ASSERT_FINGERPRINT = os.environ.get("SSL_ASSERT_FINGERPRINT", None) -ELASTICSEARCH_INDEX_PREFIX = os.environ.get("ELASTICSEARCH_INDEX_PREFIX", "open_webui_collections") +ELASTICSEARCH_INDEX_PREFIX = os.environ.get( + "ELASTICSEARCH_INDEX_PREFIX", "open_webui_collections" +) # Pgvector PGVECTOR_DB_URL = os.environ.get("PGVECTOR_DB_URL", DATABASE_URL) if VECTOR_DB == "pgvector" and not PGVECTOR_DB_URL.startswith("postgres"): diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 779fcec2b..416460837 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -105,6 +105,7 @@ from open_webui.config import ( # Direct Connections ENABLE_DIRECT_CONNECTIONS, # Code Execution + ENABLE_CODE_EXECUTION, CODE_EXECUTION_ENGINE, CODE_EXECUTION_JUPYTER_URL, CODE_EXECUTION_JUPYTER_AUTH, @@ -660,6 +661,7 @@ app.state.EMBEDDING_FUNCTION = get_embedding_function( # ######################################## +app.state.config.ENABLE_CODE_EXECUTION = ENABLE_CODE_EXECUTION app.state.config.CODE_EXECUTION_ENGINE = CODE_EXECUTION_ENGINE app.state.config.CODE_EXECUTION_JUPYTER_URL = CODE_EXECUTION_JUPYTER_URL app.state.config.CODE_EXECUTION_JUPYTER_AUTH = CODE_EXECUTION_JUPYTER_AUTH @@ -1173,6 +1175,7 @@ async def get_app_config(request: Request): "enable_direct_connections": app.state.config.ENABLE_DIRECT_CONNECTIONS, "enable_channels": app.state.config.ENABLE_CHANNELS, "enable_web_search": app.state.config.ENABLE_RAG_WEB_SEARCH, + "enable_code_execution": app.state.config.ENABLE_CODE_EXECUTION, "enable_code_interpreter": app.state.config.ENABLE_CODE_INTERPRETER, "enable_image_generation": app.state.config.ENABLE_IMAGE_GENERATION, "enable_autocomplete_generation": app.state.config.ENABLE_AUTOCOMPLETE_GENERATION, diff --git a/backend/open_webui/routers/configs.py b/backend/open_webui/routers/configs.py index 388c44f9c..2a4c651f2 100644 --- a/backend/open_webui/routers/configs.py +++ b/backend/open_webui/routers/configs.py @@ -70,6 +70,7 @@ async def set_direct_connections_config( # CodeInterpreterConfig ############################ class CodeInterpreterConfigForm(BaseModel): + ENABLE_CODE_EXECUTION: bool CODE_EXECUTION_ENGINE: str CODE_EXECUTION_JUPYTER_URL: Optional[str] CODE_EXECUTION_JUPYTER_AUTH: Optional[str] @@ -89,6 +90,7 @@ class CodeInterpreterConfigForm(BaseModel): @router.get("/code_execution", response_model=CodeInterpreterConfigForm) async def get_code_execution_config(request: Request, user=Depends(get_admin_user)): return { + "ENABLE_CODE_EXECUTION": request.app.state.config.ENABLE_CODE_EXECUTION, "CODE_EXECUTION_ENGINE": request.app.state.config.CODE_EXECUTION_ENGINE, "CODE_EXECUTION_JUPYTER_URL": request.app.state.config.CODE_EXECUTION_JUPYTER_URL, "CODE_EXECUTION_JUPYTER_AUTH": request.app.state.config.CODE_EXECUTION_JUPYTER_AUTH, @@ -111,6 +113,8 @@ async def set_code_execution_config( request: Request, form_data: CodeInterpreterConfigForm, user=Depends(get_admin_user) ): + request.app.state.config.ENABLE_CODE_EXECUTION = form_data.ENABLE_CODE_EXECUTION + request.app.state.config.CODE_EXECUTION_ENGINE = form_data.CODE_EXECUTION_ENGINE request.app.state.config.CODE_EXECUTION_JUPYTER_URL = ( form_data.CODE_EXECUTION_JUPYTER_URL @@ -153,6 +157,7 @@ async def set_code_execution_config( ) return { + "ENABLE_CODE_EXECUTION": request.app.state.config.ENABLE_CODE_EXECUTION, "CODE_EXECUTION_ENGINE": request.app.state.config.CODE_EXECUTION_ENGINE, "CODE_EXECUTION_JUPYTER_URL": request.app.state.config.CODE_EXECUTION_JUPYTER_URL, "CODE_EXECUTION_JUPYTER_AUTH": request.app.state.config.CODE_EXECUTION_JUPYTER_AUTH, diff --git a/src/lib/components/admin/Settings/CodeExecution.svelte b/src/lib/components/admin/Settings/CodeExecution.svelte index c83537455..6050fb26b 100644 --- a/src/lib/components/admin/Settings/CodeExecution.svelte +++ b/src/lib/components/admin/Settings/CodeExecution.svelte @@ -45,6 +45,16 @@
+
+
+
+ {$i18n.t('Enable Code Execution')} +
+ + +
+
+
{$i18n.t('Code Execution Engine')}
diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 338ff75d0..ca766c9f7 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1937,7 +1937,7 @@ - {#if ($banners.length > 0 && !history.currentId && !$chatId && selectedModels.length <= 1) || ($config?.license_metadata?.type ?? null) === 'trial' || (($config?.license_metadata?.seats ?? null) !== null && $config?.user_count > $config?.license_metadata?.seats)} + {#if !history.currentId && !$chatId && selectedModels.length <= 1 && ($banners.length > 0 || ($config?.license_metadata?.type ?? null) === 'trial' || (($config?.license_metadata?.seats ?? null) !== null && $config?.user_count > $config?.license_metadata?.seats))}
{#if ($config?.license_metadata?.type ?? null) === 'trial'} diff --git a/src/lib/components/chat/Messages/CodeBlock.svelte b/src/lib/components/chat/Messages/CodeBlock.svelte index 64fa1d973..c6a4f0328 100644 --- a/src/lib/components/chat/Messages/CodeBlock.svelte +++ b/src/lib/components/chat/Messages/CodeBlock.svelte @@ -439,7 +439,7 @@
- {#if lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code))} + {#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))} {#if executing}
Running
{:else if run} From 6eccf8668e19ef05424351b6e3a5a9da977eca8c Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:14:43 -0800 Subject: [PATCH 5/9] fix: non-root container issue --- backend/open_webui/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 9b8e865fc..1e265f2ce 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -593,7 +593,10 @@ for file_path in (FRONTEND_BUILD_DIR / "static").glob("**/*"): (FRONTEND_BUILD_DIR / "static") ) target_path.parent.mkdir(parents=True, exist_ok=True) - shutil.copyfile(file_path, target_path) + try: + shutil.copyfile(file_path, target_path) + except Exception as e: + logging.error(f"An error occurred: {e}") frontend_favicon = FRONTEND_BUILD_DIR / "static" / "favicon.png" From aaaebfabbe6679071502fa5587ec2e94ce9037dd Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:16:59 -0800 Subject: [PATCH 6/9] chore: format --- package-lock.json | 4 ++-- package.json | 2 +- src/lib/i18n/locales/ar-BH/translation.json | 1 + src/lib/i18n/locales/bg-BG/translation.json | 1 + src/lib/i18n/locales/bn-BD/translation.json | 1 + src/lib/i18n/locales/ca-ES/translation.json | 1 + src/lib/i18n/locales/ceb-PH/translation.json | 1 + src/lib/i18n/locales/cs-CZ/translation.json | 1 + src/lib/i18n/locales/da-DK/translation.json | 1 + src/lib/i18n/locales/de-DE/translation.json | 1 + src/lib/i18n/locales/dg-DG/translation.json | 1 + src/lib/i18n/locales/el-GR/translation.json | 1 + src/lib/i18n/locales/en-GB/translation.json | 1 + src/lib/i18n/locales/en-US/translation.json | 1 + src/lib/i18n/locales/es-ES/translation.json | 1 + src/lib/i18n/locales/eu-ES/translation.json | 1 + src/lib/i18n/locales/fa-IR/translation.json | 1 + src/lib/i18n/locales/fi-FI/translation.json | 1 + src/lib/i18n/locales/fr-CA/translation.json | 1 + src/lib/i18n/locales/fr-FR/translation.json | 1 + src/lib/i18n/locales/he-IL/translation.json | 1 + src/lib/i18n/locales/hi-IN/translation.json | 1 + src/lib/i18n/locales/hr-HR/translation.json | 1 + src/lib/i18n/locales/hu-HU/translation.json | 1 + src/lib/i18n/locales/id-ID/translation.json | 1 + src/lib/i18n/locales/ie-GA/translation.json | 1 + src/lib/i18n/locales/it-IT/translation.json | 1 + src/lib/i18n/locales/ja-JP/translation.json | 1 + src/lib/i18n/locales/ka-GE/translation.json | 1 + src/lib/i18n/locales/ko-KR/translation.json | 1 + src/lib/i18n/locales/lt-LT/translation.json | 1 + src/lib/i18n/locales/ms-MY/translation.json | 1 + src/lib/i18n/locales/nb-NO/translation.json | 1 + src/lib/i18n/locales/nl-NL/translation.json | 1 + src/lib/i18n/locales/pa-IN/translation.json | 1 + src/lib/i18n/locales/pl-PL/translation.json | 1 + src/lib/i18n/locales/pt-BR/translation.json | 1 + src/lib/i18n/locales/pt-PT/translation.json | 1 + src/lib/i18n/locales/ro-RO/translation.json | 1 + src/lib/i18n/locales/ru-RU/translation.json | 1 + src/lib/i18n/locales/sk-SK/translation.json | 1 + src/lib/i18n/locales/sr-RS/translation.json | 1 + src/lib/i18n/locales/sv-SE/translation.json | 1 + src/lib/i18n/locales/th-TH/translation.json | 1 + src/lib/i18n/locales/tk-TW/translation.json | 1 + src/lib/i18n/locales/tr-TR/translation.json | 1 + src/lib/i18n/locales/uk-UA/translation.json | 1 + src/lib/i18n/locales/ur-PK/translation.json | 1 + src/lib/i18n/locales/vi-VN/translation.json | 1 + src/lib/i18n/locales/zh-CN/translation.json | 1 + src/lib/i18n/locales/zh-TW/translation.json | 1 + 51 files changed, 52 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 719e8718d..e98b0968c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.5.19", + "version": "0.5.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.5.19", + "version": "0.5.20", "dependencies": { "@azure/msal-browser": "^4.5.0", "@codemirror/lang-javascript": "^6.2.2", diff --git a/package.json b/package.json index 63d7a49c9..2e4b905b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.5.19", + "version": "0.5.20", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host", diff --git a/src/lib/i18n/locales/ar-BH/translation.json b/src/lib/i18n/locales/ar-BH/translation.json index eb627f626..76befab8d 100644 --- a/src/lib/i18n/locales/ar-BH/translation.json +++ b/src/lib/i18n/locales/ar-BH/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "تم تعيين نموذج التضمين على \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "تمكين مشاركة المجتمع", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/bg-BG/translation.json b/src/lib/i18n/locales/bg-BG/translation.json index 8eda67acf..58c8df7c7 100644 --- a/src/lib/i18n/locales/bg-BG/translation.json +++ b/src/lib/i18n/locales/bg-BG/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Модел за вграждане е настроен на \"{{embedding_model}}\"", "Enable API Key": "Активиране на API ключ", "Enable autocomplete generation for chat messages": "Активиране на автоматично довършване за съобщения в чата", + "Enable Code Execution": "", "Enable Code Interpreter": "Активиране на интерпретатор на код", "Enable Community Sharing": "Разрешаване на споделяне в общност", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Активиране на заключване на паметта (mlock), за да се предотврати изваждането на данните на модела от RAM. Тази опция заключва работния набор от страници на модела в RAM, гарантирайки, че няма да бъдат изхвърлени на диска. Това може да помогне за поддържане на производителността, като се избягват грешки в страниците и се осигурява бърз достъп до данните.", diff --git a/src/lib/i18n/locales/bn-BD/translation.json b/src/lib/i18n/locales/bn-BD/translation.json index c132db62b..a887df62b 100644 --- a/src/lib/i18n/locales/bn-BD/translation.json +++ b/src/lib/i18n/locales/bn-BD/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "ইমেজ ইমেবডিং মডেল সেট করা হয়েছে - \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "সম্প্রদায় শেয়ারকরণ সক্ষম করুন", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ca-ES/translation.json b/src/lib/i18n/locales/ca-ES/translation.json index 6581e4d4e..b4c6d4e5e 100644 --- a/src/lib/i18n/locales/ca-ES/translation.json +++ b/src/lib/i18n/locales/ca-ES/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model d'incrustació configurat a \"{{embedding_model}}\"", "Enable API Key": "Activar la Clau API", "Enable autocomplete generation for chat messages": "Activar la generació automàtica per als missatges del xat", + "Enable Code Execution": "", "Enable Code Interpreter": "Activar l'intèrpret de codi", "Enable Community Sharing": "Activar l'ús compartit amb la comunitat", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Activar el bloqueig de memòria (mlock) per evitar que les dades del model s'intercanviïn fora de la memòria RAM. Aquesta opció bloqueja el conjunt de pàgines de treball del model a la memòria RAM, assegurant-se que no s'intercanviaran al disc. Això pot ajudar a mantenir el rendiment evitant errors de pàgina i garantint un accés ràpid a les dades.", diff --git a/src/lib/i18n/locales/ceb-PH/translation.json b/src/lib/i18n/locales/ceb-PH/translation.json index 2ae99a929..95e65eab6 100644 --- a/src/lib/i18n/locales/ceb-PH/translation.json +++ b/src/lib/i18n/locales/ceb-PH/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/cs-CZ/translation.json b/src/lib/i18n/locales/cs-CZ/translation.json index 6ee02804e..7839d00ab 100644 --- a/src/lib/i18n/locales/cs-CZ/translation.json +++ b/src/lib/i18n/locales/cs-CZ/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model vkládání nastaven na \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Povolit sdílení komunity", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/da-DK/translation.json b/src/lib/i18n/locales/da-DK/translation.json index 598213dcc..c5cff11eb 100644 --- a/src/lib/i18n/locales/da-DK/translation.json +++ b/src/lib/i18n/locales/da-DK/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding model sat til \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Aktiver deling til Community", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/de-DE/translation.json b/src/lib/i18n/locales/de-DE/translation.json index a7da3d47d..7e721e838 100644 --- a/src/lib/i18n/locales/de-DE/translation.json +++ b/src/lib/i18n/locales/de-DE/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding-Modell auf \"{{embedding_model}}\" gesetzt", "Enable API Key": "API-Schlüssel aktivieren", "Enable autocomplete generation for chat messages": "Automatische Vervollständigung für Chat-Nachrichten aktivieren", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Community-Freigabe aktivieren", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Aktiviere Memory Locking (mlock), um zu verhindern, dass Modelldaten aus dem RAM ausgelagert werden. Diese Option sperrt die Arbeitsseiten des Modells im RAM, um sicherzustellen, dass sie nicht auf die Festplatte ausgelagert werden. Dies kann die Leistung verbessern, indem Page Faults vermieden und ein schneller Datenzugriff sichergestellt werden.", diff --git a/src/lib/i18n/locales/dg-DG/translation.json b/src/lib/i18n/locales/dg-DG/translation.json index 5c9dc6774..6da9d7fd7 100644 --- a/src/lib/i18n/locales/dg-DG/translation.json +++ b/src/lib/i18n/locales/dg-DG/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/el-GR/translation.json b/src/lib/i18n/locales/el-GR/translation.json index 0a5b2393e..38b33d0b0 100644 --- a/src/lib/i18n/locales/el-GR/translation.json +++ b/src/lib/i18n/locales/el-GR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Το μοντέλο ενσωμάτωσης έχει οριστεί σε \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Ενεργοποίηση Κοινοτικής Κοινής Χρήσης", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Ενεργοποίηση Κλείδωσης Μνήμης (mlock) για την αποτροπή της ανταλλαγής δεδομένων του μοντέλου από τη μνήμη RAM. Αυτή η επιλογή κλειδώνει το σύνολο εργασίας των σελίδων του μοντέλου στη μνήμη RAM, διασφαλίζοντας ότι δεν θα ανταλλαχθούν στο δίσκο. Αυτό μπορεί να βοηθήσει στη διατήρηση της απόδοσης αποφεύγοντας σφάλματα σελίδων και διασφαλίζοντας γρήγορη πρόσβαση στα δεδομένα.", diff --git a/src/lib/i18n/locales/en-GB/translation.json b/src/lib/i18n/locales/en-GB/translation.json index f1aa076c9..e1f06f335 100644 --- a/src/lib/i18n/locales/en-GB/translation.json +++ b/src/lib/i18n/locales/en-GB/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index f1aa076c9..e1f06f335 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/es-ES/translation.json b/src/lib/i18n/locales/es-ES/translation.json index c7817e8b3..00f6e18d1 100644 --- a/src/lib/i18n/locales/es-ES/translation.json +++ b/src/lib/i18n/locales/es-ES/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modelo de Embedding configurado a \"{{embedding_model}}\"", "Enable API Key": "Habilitar clave de API", "Enable autocomplete generation for chat messages": "Habilitar generación de autocompletado para mensajes de chat", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Habilitar el uso compartido de la comunidad", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Habilitar bloqueo de memoria (mlock) para evitar que los datos del modelo se intercambien fuera de la RAM. Esta opción bloquea el conjunto de páginas de trabajo del modelo en la RAM, asegurando que no se intercambiarán fuera del disco. Esto puede ayudar a mantener el rendimiento evitando fallos de página y asegurando un acceso rápido a los datos.", diff --git a/src/lib/i18n/locales/eu-ES/translation.json b/src/lib/i18n/locales/eu-ES/translation.json index f9c1d9f10..5759a4747 100644 --- a/src/lib/i18n/locales/eu-ES/translation.json +++ b/src/lib/i18n/locales/eu-ES/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding eredua \"{{embedding_model}}\"-ra ezarri da", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Gaitu Komunitatearen Partekatzea", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Gaitu Memoria Blokeatzea (mlock) ereduaren datuak RAM memoriatik kanpo ez trukatzeko. Aukera honek ereduaren lan-orri multzoa RAMean blokatzen du, diskora ez direla trukatuko ziurtatuz. Honek errendimendua mantentzen lagun dezake, orri-hutsegiteak saihestuz eta datuen sarbide azkarra bermatuz.", diff --git a/src/lib/i18n/locales/fa-IR/translation.json b/src/lib/i18n/locales/fa-IR/translation.json index 937cfbcdb..3ce451d2c 100644 --- a/src/lib/i18n/locales/fa-IR/translation.json +++ b/src/lib/i18n/locales/fa-IR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "مدل پیدائش را به \"{{embedding_model}}\" تنظیم کنید", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "فعالسازی اشتراک انجمن", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/fi-FI/translation.json b/src/lib/i18n/locales/fi-FI/translation.json index 4b9ff557a..6fea592da 100644 --- a/src/lib/i18n/locales/fi-FI/translation.json +++ b/src/lib/i18n/locales/fi-FI/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "\"{{embedding_model}}\" valittu upotusmalliksi", "Enable API Key": "Ota API -avain käyttöön", "Enable autocomplete generation for chat messages": "Ota automaattinen täydennys käyttöön keskusteluviesteissä", + "Enable Code Execution": "", "Enable Code Interpreter": "Ota ohjelmatulkki käyttöön", "Enable Community Sharing": "Ota yhteisön jakaminen käyttöön", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Ota Memory Locking (mlock) käyttöön estääksesi mallidatan vaihtamisen pois RAM-muistista. Tämä lukitsee mallin työsivut RAM-muistiin, varmistaen että niitä ei vaihdeta levylle. Tämä voi parantaa suorituskykyä välttämällä sivuvikoja ja varmistamalla nopean tietojen käytön.", diff --git a/src/lib/i18n/locales/fr-CA/translation.json b/src/lib/i18n/locales/fr-CA/translation.json index 769c95787..7a08c8321 100644 --- a/src/lib/i18n/locales/fr-CA/translation.json +++ b/src/lib/i18n/locales/fr-CA/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modèle d'encodage défini sur « {{embedding_model}} »", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Activer le partage communautaire", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/fr-FR/translation.json b/src/lib/i18n/locales/fr-FR/translation.json index 9cba64335..5116d65bc 100644 --- a/src/lib/i18n/locales/fr-FR/translation.json +++ b/src/lib/i18n/locales/fr-FR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modèle d'embedding défini sur « {{embedding_model}} »", "Enable API Key": "Activer la clé API", "Enable autocomplete generation for chat messages": "Activer la génération des suggestions pour les messages", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Activer le partage communautaire", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Activer le verrouillage de la mémoire (mlock) pour empêcher les données du modèle d'être échangées de la RAM. Cette option verrouille l'ensemble de pages de travail du modèle en RAM, garantissant qu'elles ne seront pas échangées vers le disque. Cela peut aider à maintenir les performances en évitant les défauts de page et en assurant un accès rapide aux données.", diff --git a/src/lib/i18n/locales/he-IL/translation.json b/src/lib/i18n/locales/he-IL/translation.json index e5af652c9..6021462e1 100644 --- a/src/lib/i18n/locales/he-IL/translation.json +++ b/src/lib/i18n/locales/he-IL/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "מודל ההטמעה הוגדר ל-\"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "הפיכת שיתוף קהילה לזמין", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/hi-IN/translation.json b/src/lib/i18n/locales/hi-IN/translation.json index 2f25632d9..47584b852 100644 --- a/src/lib/i18n/locales/hi-IN/translation.json +++ b/src/lib/i18n/locales/hi-IN/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "एम्बेडिंग मॉडल को \"{{embedding_model}}\" पर सेट किया गया", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "समुदाय साझाकरण सक्षम करें", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/hr-HR/translation.json b/src/lib/i18n/locales/hr-HR/translation.json index ffd87f83d..d36aac019 100644 --- a/src/lib/i18n/locales/hr-HR/translation.json +++ b/src/lib/i18n/locales/hr-HR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding model postavljen na \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Omogući zajedničko korištenje zajednice", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/hu-HU/translation.json b/src/lib/i18n/locales/hu-HU/translation.json index 306ec737f..ce86bb131 100644 --- a/src/lib/i18n/locales/hu-HU/translation.json +++ b/src/lib/i18n/locales/hu-HU/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Beágyazási modell beállítva: \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Közösségi megosztás engedélyezése", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/id-ID/translation.json b/src/lib/i18n/locales/id-ID/translation.json index 43f4c58fc..2b5ec88f7 100644 --- a/src/lib/i18n/locales/id-ID/translation.json +++ b/src/lib/i18n/locales/id-ID/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model penyematan diatur ke \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Aktifkan Berbagi Komunitas", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ie-GA/translation.json b/src/lib/i18n/locales/ie-GA/translation.json index 41b803ff1..bfa7bd63c 100644 --- a/src/lib/i18n/locales/ie-GA/translation.json +++ b/src/lib/i18n/locales/ie-GA/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Múnla leabaithe socraithe go \"{{embedding_model}}\"", "Enable API Key": "Cumasaigh Eochair API", "Enable autocomplete generation for chat messages": "Cumasaigh giniúint uathchríochnaithe le haghaidh teachtaireachtaí comhrá", + "Enable Code Execution": "", "Enable Code Interpreter": "Cumasaigh Ateangaire Cóid", "Enable Community Sharing": "Cumasaigh Comhroinnt Pobail", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Cumasaigh Glasáil Cuimhne (mlock) chun sonraí samhaltaithe a chosc ó RAM. Glasálann an rogha seo sraith oibre leathanaigh an mhúnla isteach i RAM, ag cinntiú nach ndéanfar iad a mhalartú go diosca. Is féidir leis seo cabhrú le feidhmíocht a choinneáil trí lochtanna leathanaigh a sheachaint agus rochtain tapa ar shonraí a chinntiú.", diff --git a/src/lib/i18n/locales/it-IT/translation.json b/src/lib/i18n/locales/it-IT/translation.json index 2499e366c..17aa0dede 100644 --- a/src/lib/i18n/locales/it-IT/translation.json +++ b/src/lib/i18n/locales/it-IT/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modello di embedding impostato su \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Abilita la condivisione della community", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ja-JP/translation.json b/src/lib/i18n/locales/ja-JP/translation.json index 60ebb3530..78cee236f 100644 --- a/src/lib/i18n/locales/ja-JP/translation.json +++ b/src/lib/i18n/locales/ja-JP/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "埋め込みモデルを\"{{embedding_model}}\"に設定しました", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "コミュニティ共有を有効にする", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ka-GE/translation.json b/src/lib/i18n/locales/ka-GE/translation.json index 980a1bec8..f64fa4499 100644 --- a/src/lib/i18n/locales/ka-GE/translation.json +++ b/src/lib/i18n/locales/ka-GE/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "ჩაშენებული მოდელი დაყენებულია მნიშვნელობაზე \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "საზოგადოების გაზიარების ჩართვა", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json index bed205601..649eae61b 100644 --- a/src/lib/i18n/locales/ko-KR/translation.json +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "임베딩 모델을 \"{{embedding_model}}\"로 설정함", "Enable API Key": "API 키 활성화", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "커뮤니티 공유 활성화", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/lt-LT/translation.json b/src/lib/i18n/locales/lt-LT/translation.json index ef85c677e..031fc412d 100644 --- a/src/lib/i18n/locales/lt-LT/translation.json +++ b/src/lib/i18n/locales/lt-LT/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding modelis nustatytas kaip\"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Leisti dalinimąsi su bendruomene", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ms-MY/translation.json b/src/lib/i18n/locales/ms-MY/translation.json index 8a1b1e021..9d6501c72 100644 --- a/src/lib/i18n/locales/ms-MY/translation.json +++ b/src/lib/i18n/locales/ms-MY/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model Benamkan ditetapkan kepada \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Benarkan Perkongsian Komuniti", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/nb-NO/translation.json b/src/lib/i18n/locales/nb-NO/translation.json index 4e97236ff..7aa4c9720 100644 --- a/src/lib/i18n/locales/nb-NO/translation.json +++ b/src/lib/i18n/locales/nb-NO/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Innbyggingsmodell angitt til \"{{embedding_model}}\"", "Enable API Key": "Aktiver ", "Enable autocomplete generation for chat messages": "Aktiver automatisk utfylling av chatmeldinger", + "Enable Code Execution": "", "Enable Code Interpreter": "Aktiver kodetolker", "Enable Community Sharing": "Aktiver deling i fellesskap", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Aktiver Memory Locking (mlock) for å forhindre at modelldata byttes ut av RAM. Dette alternativet låser modellens arbeidssett med sider i RAM-minnet, slik at de ikke byttes ut til disk. Dette kan bidra til å opprettholde ytelsen ved å unngå sidefeil og sikre rask datatilgang.", diff --git a/src/lib/i18n/locales/nl-NL/translation.json b/src/lib/i18n/locales/nl-NL/translation.json index 25ffe027c..f3909e9e8 100644 --- a/src/lib/i18n/locales/nl-NL/translation.json +++ b/src/lib/i18n/locales/nl-NL/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Embedding model ingesteld op \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Delen via de community inschakelen", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Schakel Memory Locking (mlock) in om te voorkomen dat modelgegevens uit het RAM worden verwisseld. Deze optie vergrendelt de werkset pagina's van het model in het RAM, zodat ze niet naar de schijf worden uitgewisseld. Dit kan helpen om de prestaties op peil te houden door paginafouten te voorkomen en snelle gegevenstoegang te garanderen.", diff --git a/src/lib/i18n/locales/pa-IN/translation.json b/src/lib/i18n/locales/pa-IN/translation.json index e473441e1..e4197505e 100644 --- a/src/lib/i18n/locales/pa-IN/translation.json +++ b/src/lib/i18n/locales/pa-IN/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "ਐਮਬੈੱਡਿੰਗ ਮਾਡਲ ਨੂੰ \"{{embedding_model}}\" 'ਤੇ ਸੈੱਟ ਕੀਤਾ ਗਿਆ", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "ਕਮਿਊਨਿਟੀ ਸ਼ੇਅਰਿੰਗ ਨੂੰ ਸਮਰੱਥ ਕਰੋ", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/pl-PL/translation.json b/src/lib/i18n/locales/pl-PL/translation.json index f3e1be87d..cbba5009b 100644 --- a/src/lib/i18n/locales/pl-PL/translation.json +++ b/src/lib/i18n/locales/pl-PL/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model osadzania ustawiony na '{{embedding_model}}'", "Enable API Key": "Włącz klucz API", "Enable autocomplete generation for chat messages": "Włącz generowanie autouzupełniania dla wiadomości czatu", + "Enable Code Execution": "", "Enable Code Interpreter": "Włącz interpreter kodu", "Enable Community Sharing": "Włączanie udostępniania społecznościowego", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Włącz blokowanie pamięci (mlock), aby zapobiec swappingowi danych modelu z RAM. Ta opcja blokuje zbiór stron roboczych modelu w RAM, co gwarantuje, że nie będą one wymieniane na dysk. Może to pomóc w utrzymaniu wydajności poprzez unikanie błędów strony i zapewnienie szybkiego dostępu do danych.", diff --git a/src/lib/i18n/locales/pt-BR/translation.json b/src/lib/i18n/locales/pt-BR/translation.json index 9dc5c4d60..c3cf9ea7f 100644 --- a/src/lib/i18n/locales/pt-BR/translation.json +++ b/src/lib/i18n/locales/pt-BR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modelo de embedding definido para \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Ativar Compartilhamento com a Comunidade", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Habilite o bloqueio de memória (mlock) para evitar que os dados do modelo sejam transferidos da RAM para a área de troca (swap). Essa opção bloqueia o conjunto de páginas em uso pelo modelo na RAM, garantindo que elas não sejam transferidas para o disco. Isso pode ajudar a manter o desempenho, evitando falhas de página e garantindo acesso rápido aos dados.", diff --git a/src/lib/i18n/locales/pt-PT/translation.json b/src/lib/i18n/locales/pt-PT/translation.json index 12799885d..9bcb3b7ff 100644 --- a/src/lib/i18n/locales/pt-PT/translation.json +++ b/src/lib/i18n/locales/pt-PT/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modelo de Embedding definido como \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Active a Partilha da Comunidade", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ro-RO/translation.json b/src/lib/i18n/locales/ro-RO/translation.json index 309e1e309..dce026085 100644 --- a/src/lib/i18n/locales/ro-RO/translation.json +++ b/src/lib/i18n/locales/ro-RO/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Modelul de încapsulare setat la \"{{embedding_model}}\"", "Enable API Key": "Activează cheia API", "Enable autocomplete generation for chat messages": "Activează generarea automată pentru mesajele de chat", + "Enable Code Execution": "", "Enable Code Interpreter": "Activează interpretul de cod", "Enable Community Sharing": "Activează Partajarea Comunitară", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/ru-RU/translation.json b/src/lib/i18n/locales/ru-RU/translation.json index 2b6349ed6..6213f55a7 100644 --- a/src/lib/i18n/locales/ru-RU/translation.json +++ b/src/lib/i18n/locales/ru-RU/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Модель встраивания установлена в \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "Включить генерацию автозаполнения для сообщений чата", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Включить совместное использование", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Включите блокировку памяти (mlock), чтобы предотвратить выгрузку данных модели из ОЗУ. Эта опция блокирует рабочий набор страниц модели в оперативной памяти, гарантируя, что они не будут выгружены на диск. Это может помочь поддерживать производительность, избегая ошибок страниц и обеспечивая быстрый доступ к данным.", diff --git a/src/lib/i18n/locales/sk-SK/translation.json b/src/lib/i18n/locales/sk-SK/translation.json index 549a9bdf4..3ca7cac53 100644 --- a/src/lib/i18n/locales/sk-SK/translation.json +++ b/src/lib/i18n/locales/sk-SK/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Model vkladania nastavený na \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Povoliť zdieľanie komunity", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/sr-RS/translation.json b/src/lib/i18n/locales/sr-RS/translation.json index eb41f50b3..abe816715 100644 --- a/src/lib/i18n/locales/sr-RS/translation.json +++ b/src/lib/i18n/locales/sr-RS/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Модел уградње подешен на \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Омогући дељење заједнице", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/sv-SE/translation.json b/src/lib/i18n/locales/sv-SE/translation.json index 2feb7f338..d3c4ebb99 100644 --- a/src/lib/i18n/locales/sv-SE/translation.json +++ b/src/lib/i18n/locales/sv-SE/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Inbäddningsmodell inställd på \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Aktivera community-delning", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/th-TH/translation.json b/src/lib/i18n/locales/th-TH/translation.json index 7beaed612..63594bfef 100644 --- a/src/lib/i18n/locales/th-TH/translation.json +++ b/src/lib/i18n/locales/th-TH/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "ตั้งค่าโมเดลการฝังเป็น \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "เปิดใช้งานการแชร์ในชุมชน", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/tk-TW/translation.json b/src/lib/i18n/locales/tk-TW/translation.json index f1aa076c9..e1f06f335 100644 --- a/src/lib/i18n/locales/tk-TW/translation.json +++ b/src/lib/i18n/locales/tk-TW/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/tr-TR/translation.json b/src/lib/i18n/locales/tr-TR/translation.json index e62e1f52a..e7082300f 100644 --- a/src/lib/i18n/locales/tr-TR/translation.json +++ b/src/lib/i18n/locales/tr-TR/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Gömme modeli \"{{embedding_model}}\" olarak ayarlandı", "Enable API Key": "API Anahtarını Etkinleştir", "Enable autocomplete generation for chat messages": "Sohbet mesajları için otomatik tamamlama üretimini etkinleştir", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Topluluk Paylaşımını Etkinleştir", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/uk-UA/translation.json b/src/lib/i18n/locales/uk-UA/translation.json index 4efc20a7a..5e9c7e07f 100644 --- a/src/lib/i18n/locales/uk-UA/translation.json +++ b/src/lib/i18n/locales/uk-UA/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Встановлена модель вбудовування \"{{embedding_model}}\"", "Enable API Key": "Увімкнути ключ API", "Enable autocomplete generation for chat messages": "Увімкнути генерацію автозаповнення для повідомлень чату", + "Enable Code Execution": "", "Enable Code Interpreter": "Увімкнути інтерпретатор коду", "Enable Community Sharing": "Увімкнути спільний доступ", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "Увімкнути блокування пам'яті (mlock), щоб запобігти виведенню даних моделі з оперативної пам'яті. Цей параметр блокує робочий набір сторінок моделі в оперативній пам'яті, гарантуючи, що вони не будуть виведені на диск. Це може допомогти підтримувати продуктивність, уникати помилок сторінок та забезпечувати швидкий доступ до даних.", diff --git a/src/lib/i18n/locales/ur-PK/translation.json b/src/lib/i18n/locales/ur-PK/translation.json index ab255fc34..ffd539aa3 100644 --- a/src/lib/i18n/locales/ur-PK/translation.json +++ b/src/lib/i18n/locales/ur-PK/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "ایمبیڈنگ ماڈل \"{{embedding_model}}\" پر سیٹ کیا گیا ہے", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "کمیونٹی شیئرنگ فعال کریں", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/vi-VN/translation.json b/src/lib/i18n/locales/vi-VN/translation.json index 3f40b10b5..52c7a8201 100644 --- a/src/lib/i18n/locales/vi-VN/translation.json +++ b/src/lib/i18n/locales/vi-VN/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "Mô hình embedding đã được thiết lập thành \"{{embedding_model}}\"", "Enable API Key": "", "Enable autocomplete generation for chat messages": "", + "Enable Code Execution": "", "Enable Code Interpreter": "", "Enable Community Sharing": "Cho phép Chia sẻ Cộng đồng", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "", diff --git a/src/lib/i18n/locales/zh-CN/translation.json b/src/lib/i18n/locales/zh-CN/translation.json index eb848fc91..ebb53a1b5 100644 --- a/src/lib/i18n/locales/zh-CN/translation.json +++ b/src/lib/i18n/locales/zh-CN/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "语义向量模型设置为 \"{{embedding_model}}\"", "Enable API Key": "启用 API 密钥", "Enable autocomplete generation for chat messages": "启用聊天消息的输入框内容猜测补全", + "Enable Code Execution": "", "Enable Code Interpreter": "启用代码解释器", "Enable Community Sharing": "启用分享至社区", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "启用内存锁定(mlock)以防止模型数据被交换出RAM。此选项将模型的工作集页面锁定在RAM中,确保它们不会被交换到磁盘。这可以通过避免页面错误和确保快速数据访问来帮助维持性能。", diff --git a/src/lib/i18n/locales/zh-TW/translation.json b/src/lib/i18n/locales/zh-TW/translation.json index cba9e6291..884e5a19c 100644 --- a/src/lib/i18n/locales/zh-TW/translation.json +++ b/src/lib/i18n/locales/zh-TW/translation.json @@ -359,6 +359,7 @@ "Embedding model set to \"{{embedding_model}}\"": "嵌入模型已設定為 \"{{embedding_model}}\"", "Enable API Key": "啟用 API 金鑰", "Enable autocomplete generation for chat messages": "啟用聊天訊息的自動完成生成", + "Enable Code Execution": "", "Enable Code Interpreter": "啟用程式碼解釋器", "Enable Community Sharing": "啟用社群分享", "Enable Memory Locking (mlock) to prevent model data from being swapped out of RAM. This option locks the model's working set of pages into RAM, ensuring that they will not be swapped out to disk. This can help maintain performance by avoiding page faults and ensuring fast data access.": "啟用記憶體鎖定(mlock)以防止模型資料被換出 RAM。此選項會將模型的工作頁面集鎖定在 RAM 中,確保它們不會被換出到磁碟。這可以透過避免頁面錯誤和確保快速資料存取來維持效能。", From d4fca9dabf084bd205473386e37d94e13cb9b487 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:17:41 -0800 Subject: [PATCH 7/9] chore: format --- .../retrieval/vector/dbs/elasticsearch.py | 183 ++++++++---------- 1 file changed, 81 insertions(+), 102 deletions(-) diff --git a/backend/open_webui/retrieval/vector/dbs/elasticsearch.py b/backend/open_webui/retrieval/vector/dbs/elasticsearch.py index a558e1fb0..c89628494 100644 --- a/backend/open_webui/retrieval/vector/dbs/elasticsearch.py +++ b/backend/open_webui/retrieval/vector/dbs/elasticsearch.py @@ -1,30 +1,28 @@ from elasticsearch import Elasticsearch, BadRequestError from typing import Optional import ssl -from elasticsearch.helpers import bulk,scan +from elasticsearch.helpers import bulk, scan from open_webui.retrieval.vector.main import VectorItem, SearchResult, GetResult from open_webui.config import ( ELASTICSEARCH_URL, - ELASTICSEARCH_CA_CERTS, + ELASTICSEARCH_CA_CERTS, ELASTICSEARCH_API_KEY, ELASTICSEARCH_USERNAME, - ELASTICSEARCH_PASSWORD, + ELASTICSEARCH_PASSWORD, ELASTICSEARCH_CLOUD_ID, ELASTICSEARCH_INDEX_PREFIX, SSL_ASSERT_FINGERPRINT, - ) - - class ElasticsearchClient: """ Important: - in order to reduce the number of indexes and since the embedding vector length is fixed, we avoid creating - an index for each file but store it as a text field, while seperating to different index + in order to reduce the number of indexes and since the embedding vector length is fixed, we avoid creating + an index for each file but store it as a text field, while seperating to different index baesd on the embedding length. """ + def __init__(self): self.index_prefix = ELASTICSEARCH_INDEX_PREFIX self.client = Elasticsearch( @@ -32,15 +30,19 @@ class ElasticsearchClient: ca_certs=ELASTICSEARCH_CA_CERTS, api_key=ELASTICSEARCH_API_KEY, cloud_id=ELASTICSEARCH_CLOUD_ID, - basic_auth=(ELASTICSEARCH_USERNAME,ELASTICSEARCH_PASSWORD) if ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD else None, - ssl_assert_fingerprint=SSL_ASSERT_FINGERPRINT - + basic_auth=( + (ELASTICSEARCH_USERNAME, ELASTICSEARCH_PASSWORD) + if ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD + else None + ), + ssl_assert_fingerprint=SSL_ASSERT_FINGERPRINT, ) - #Status: works - def _get_index_name(self,dimension:int)->str: + + # Status: works + def _get_index_name(self, dimension: int) -> str: return f"{self.index_prefix}_d{str(dimension)}" - - #Status: works + + # Status: works def _scan_result_to_get_result(self, result) -> GetResult: if not result: return None @@ -55,7 +57,7 @@ class ElasticsearchClient: return GetResult(ids=[ids], documents=[documents], metadatas=[metadatas]) - #Status: works + # Status: works def _result_to_get_result(self, result) -> GetResult: if not result["hits"]["hits"]: return None @@ -70,7 +72,7 @@ class ElasticsearchClient: return GetResult(ids=[ids], documents=[documents], metadatas=[metadatas]) - #Status: works + # Status: works def _result_to_search_result(self, result) -> SearchResult: ids = [] distances = [] @@ -84,19 +86,21 @@ class ElasticsearchClient: metadatas.append(hit["_source"].get("metadata")) return SearchResult( - ids=[ids], distances=[distances], documents=[documents], metadatas=[metadatas] + ids=[ids], + distances=[distances], + documents=[documents], + metadatas=[metadatas], ) - #Status: works + + # Status: works def _create_index(self, dimension: int): body = { "mappings": { "dynamic_templates": [ { - "strings": { - "match_mapping_type": "string", - "mapping": { - "type": "keyword" - } + "strings": { + "match_mapping_type": "string", + "mapping": {"type": "keyword"}, } } ], @@ -111,68 +115,52 @@ class ElasticsearchClient: }, "text": {"type": "text"}, "metadata": {"type": "object"}, - } + }, } } self.client.indices.create(index=self._get_index_name(dimension), body=body) - #Status: works + + # Status: works def _create_batches(self, items: list[VectorItem], batch_size=100): for i in range(0, len(items), batch_size): - yield items[i : min(i + batch_size,len(items))] + yield items[i : min(i + batch_size, len(items))] - #Status: works - def has_collection(self,collection_name) -> bool: + # Status: works + def has_collection(self, collection_name) -> bool: query_body = {"query": {"bool": {"filter": []}}} - query_body["query"]["bool"]["filter"].append({"term": {"collection": collection_name}}) + query_body["query"]["bool"]["filter"].append( + {"term": {"collection": collection_name}} + ) try: - result = self.client.count( - index=f"{self.index_prefix}*", - body=query_body - ) - - return result.body["count"]>0 + result = self.client.count(index=f"{self.index_prefix}*", body=query_body) + + return result.body["count"] > 0 except Exception as e: return None - - def delete_collection(self, collection_name: str): - query = { - "query": { - "term": {"collection": collection_name} - } - } + query = {"query": {"term": {"collection": collection_name}}} self.client.delete_by_query(index=f"{self.index_prefix}*", body=query) - #Status: works + + # Status: works def search( self, collection_name: str, vectors: list[list[float]], limit: int ) -> Optional[SearchResult]: query = { "size": limit, - "_source": [ - "text", - "metadata" - ], + "_source": ["text", "metadata"], "query": { "script_score": { "query": { - "bool": { - "filter": [ - { - "term": { - "collection": collection_name - } - } - ] - } + "bool": {"filter": [{"term": {"collection": collection_name}}]} }, "script": { "source": "cosineSimilarity(params.vector, 'vector') + 1.0", "params": { "vector": vectors[0] - }, # Assuming single query vector + }, # Assuming single query vector }, } }, @@ -183,7 +171,8 @@ class ElasticsearchClient: ) return self._result_to_search_result(result) - #Status: only tested halfwat + + # Status: only tested halfwat def query( self, collection_name: str, filter: dict, limit: Optional[int] = None ) -> Optional[GetResult]: @@ -197,7 +186,9 @@ class ElasticsearchClient: for field, value in filter.items(): query_body["query"]["bool"]["filter"].append({"term": {field: value}}) - query_body["query"]["bool"]["filter"].append({"term": {"collection": collection_name}}) + query_body["query"]["bool"]["filter"].append( + {"term": {"collection": collection_name}} + ) size = limit if limit else 10 try: @@ -206,59 +197,53 @@ class ElasticsearchClient: body=query_body, size=size, ) - + return self._result_to_get_result(result) except Exception as e: return None - #Status: works - def _has_index(self,dimension:int): - return self.client.indices.exists(index=self._get_index_name(dimension=dimension)) + # Status: works + def _has_index(self, dimension: int): + return self.client.indices.exists( + index=self._get_index_name(dimension=dimension) + ) def get_or_create_index(self, dimension: int): if not self._has_index(dimension=dimension): self._create_index(dimension=dimension) - #Status: works + + # Status: works def get(self, collection_name: str) -> Optional[GetResult]: # Get all the items in the collection. query = { - "query": { - "bool": { - "filter": [ - { - "term": { - "collection": collection_name - } - } - ] - } - }, "_source": ["text", "metadata"]} + "query": {"bool": {"filter": [{"term": {"collection": collection_name}}]}}, + "_source": ["text", "metadata"], + } results = list(scan(self.client, index=f"{self.index_prefix}*", query=query)) - + return self._scan_result_to_get_result(results) - #Status: works + # Status: works def insert(self, collection_name: str, items: list[VectorItem]): if not self._has_index(dimension=len(items[0]["vector"])): self._create_index(dimension=len(items[0]["vector"])) - for batch in self._create_batches(items): actions = [ - { - "_index":self._get_index_name(dimension=len(items[0]["vector"])), - "_id": item["id"], - "_source": { - "collection": collection_name, - "vector": item["vector"], - "text": item["text"], - "metadata": item["metadata"], - }, - } + { + "_index": self._get_index_name(dimension=len(items[0]["vector"])), + "_id": item["id"], + "_source": { + "collection": collection_name, + "vector": item["vector"], + "text": item["text"], + "metadata": item["metadata"], + }, + } for item in batch ] - bulk(self.client,actions) + bulk(self.client, actions) # Upsert documents using the update API with doc_as_upsert=True. def upsert(self, collection_name: str, items: list[VectorItem]): @@ -280,8 +265,7 @@ class ElasticsearchClient: } for item in batch ] - bulk(self.client,actions) - + bulk(self.client, actions) # Delete specific documents from a collection by filtering on both collection and document IDs. def delete( @@ -292,21 +276,16 @@ class ElasticsearchClient: ): query = { - "query": { - "bool": { - "filter": [ - {"term": {"collection": collection_name}} - ] - } - } + "query": {"bool": {"filter": [{"term": {"collection": collection_name}}]}} } - #logic based on chromaDB + # logic based on chromaDB if ids: query["query"]["bool"]["filter"].append({"terms": {"_id": ids}}) elif filter: for field, value in filter.items(): - query["query"]["bool"]["filter"].append({"term": {f"metadata.{field}": value}}) - + query["query"]["bool"]["filter"].append( + {"term": {f"metadata.{field}": value}} + ) self.client.delete_by_query(index=f"{self.index_prefix}*", body=query) From c0ecff9d709f371d383c46a72f63e10ba6e7750b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:36:30 -0800 Subject: [PATCH 8/9] fix: pinyin keyboard --- src/lib/components/chat/MessageInput.svelte | 14 ++++++++++++++ src/lib/components/common/RichTextInput.svelte | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index ae7717a11..7db31010b 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -85,6 +85,8 @@ let loaded = false; let recording = false; + let isComposing = false; + let chatInputContainerElement; let chatInputElement; @@ -707,6 +709,8 @@ console.log(res); return res; }} + oncompositionstart={() => (isComposing = true)} + oncompositionend={() => (isComposing = false)} on:keydown={async (e) => { e = e.detail.event; @@ -806,6 +810,10 @@ navigator.msMaxTouchPoints > 0 ) ) { + if (isComposing) { + return; + } + // Uses keyCode '13' for Enter key for chinese/japanese keyboards. // // Depending on the user's settings, it will send the message @@ -882,6 +890,8 @@ class="scrollbar-hidden bg-transparent dark:text-gray-100 outline-hidden w-full pt-3 px-1 resize-none" placeholder={placeholder ? placeholder : $i18n.t('Send a Message')} bind:value={prompt} + on:compositionstart={() => (isComposing = true)} + on:compositionend={() => (isComposing = false)} on:keydown={async (e) => { const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac @@ -983,6 +993,10 @@ navigator.msMaxTouchPoints > 0 ) ) { + if (isComposing) { + return; + } + console.log('keypress', e); // Prevent Enter key from creating a new line const isCtrlPressed = e.ctrlKey || e.metaKey; diff --git a/src/lib/components/common/RichTextInput.svelte b/src/lib/components/common/RichTextInput.svelte index 80f92694c..3a30eb646 100644 --- a/src/lib/components/common/RichTextInput.svelte +++ b/src/lib/components/common/RichTextInput.svelte @@ -27,6 +27,9 @@ import { PASTED_TEXT_CHARACTER_LIMIT } from '$lib/constants'; + export let oncompositionstart = (e) => {}; + export let oncompositionend = (e) => {}; + // create a lowlight instance with all languages loaded const lowlight = createLowlight(all); @@ -226,6 +229,14 @@ editorProps: { attributes: { id }, handleDOMEvents: { + compositionstart: (view, event) => { + oncompositionstart(event); + return false; + }, + compositionend: (view, event) => { + oncompositionend(event); + return false; + }, focus: (view, event) => { eventDispatch('focus', { event }); return false; From 1173459eee8a1c46a77883bd898f7eea082160cd Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 5 Mar 2025 19:42:41 -0800 Subject: [PATCH 9/9] doc: changelog --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e1122870..da4046e73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.5.19] - 2024-03-04 +## [0.5.20] - 2025-03-05 + +### Added + +- **⚡ Toggle Code Execution On/Off**: You can now enable or disable code execution, providing more control over security, ensuring a safer and more customizable experience. + +### Fixed + +- **📜 Pinyin Keyboard Enter Key Now Works Properly**: Resolved an issue where the Enter key for Pinyin keyboards was not functioning as expected, ensuring seamless input for Chinese users. +- **🖼️ Web Manifest Loading Issue Fixed**: Addressed inconsistencies with 'site.webmanifest', guaranteeing proper loading and representation of the app across different browsers and devices. +- **📦 Non-Root Container Issue Resolved**: Fixed a critical issue where the UI failed to load correctly in non-root containers, ensuring reliable deployment in various environments. + +## [0.5.19] - 2025-03-04 ### Added