Pārlūkot izejas kodu

Merge branch 'dev' of https://github.com/open-webui/open-webui into dev

Michael Poluektov 10 mēneši atpakaļ
vecāks
revīzija
49b4211c06

+ 8 - 8
backend/config.py

@@ -5,9 +5,8 @@ import importlib.metadata
 import pkgutil
 import chromadb
 from chromadb import Settings
-from base64 import b64encode
 from bs4 import BeautifulSoup
-from typing import TypeVar, Generic, Union
+from typing import TypeVar, Generic
 from pydantic import BaseModel
 from typing import Optional
 
@@ -19,7 +18,6 @@ import markdown
 import requests
 import shutil
 
-from secrets import token_bytes
 from constants import ERROR_MESSAGES
 
 ####################################
@@ -768,12 +766,14 @@ class BannerModel(BaseModel):
     dismissible: bool
     timestamp: int
 
+try:
+    banners = json.loads(os.environ.get("WEBUI_BANNERS", "[]"))
+    banners = [BannerModel(**banner) for banner in banners]
+except Exception as e:
+    print(f"Error loading WEBUI_BANNERS: {e}")
+    banners = []
 
-WEBUI_BANNERS = PersistentConfig(
-    "WEBUI_BANNERS",
-    "ui.banners",
-    [BannerModel(**banner) for banner in json.loads("[]")],
-)
+WEBUI_BANNERS = PersistentConfig("WEBUI_BANNERS", "ui.banners", banners)
 
 
 SHOW_ADMIN_DETAILS = PersistentConfig(

+ 1 - 1
backend/requirements.txt

@@ -40,7 +40,7 @@ sentence-transformers==3.0.1
 pypdf==4.2.0
 docx2txt==0.8
 python-pptx==0.6.23
-unstructured==0.14.0
+unstructured==0.14.9
 Markdown==3.6
 pypandoc==1.13
 pandas==2.2.2

+ 4 - 4
src/lib/components/admin/Settings/Pipelines.svelte

@@ -480,18 +480,18 @@
 													<!-- {valves[property]} -->
 													<div class="flex mt-0.5 mb-1.5 space-x-2">
 														<div class=" flex-1">
-															{#if valvesSpec.properties[property]?.enum ?? null}
+															{#if valves_spec.properties[property]?.enum ?? null}
 																<select
 																	class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
 																	bind:value={valves[property]}
 																>
-																	{#each valvesSpec.properties[property].enum as option}
+																	{#each valves_spec.properties[property].enum as option}
 																		<option value={option} selected={option === valves[property]}>
 																			{option}
 																		</option>
 																	{/each}
 																</select>
-															{:else if (valvesSpec.properties[property]?.type ?? null) === 'boolean'}
+															{:else if (valves_spec.properties[property]?.type ?? null) === 'boolean'}
 																<div class="flex justify-between items-center">
 																	<div class="text-xs text-gray-500">
 																		{valves[property] ? 'Enabled' : 'Disabled'}
@@ -505,7 +505,7 @@
 																<input
 																	class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
 																	type="text"
-																	placeholder={valvesSpec.properties[property].title}
+																	placeholder={valves_spec.properties[property].title}
 																	bind:value={valves[property]}
 																	autocomplete="off"
 																	required