Skip to content

Commit 90eca2a

Browse files
committed
refac
1 parent 2e5b094 commit 90eca2a

66 files changed

Lines changed: 253 additions & 80 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/open_webui/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,9 +1344,7 @@ async def run_initial_title_generation():
13441344
user_message = metadata.get('user_message') or {}
13451345
selected_chat_models = user_message.get('models') if isinstance(user_message, dict) else None
13461346
if not isinstance(selected_chat_models, list) or not selected_chat_models:
1347-
selected_chat_models = [
1348-
entry.get('model_id') for entry in message_ids if entry.get('model_id')
1349-
]
1347+
selected_chat_models = [entry.get('model_id') for entry in message_ids if entry.get('model_id')]
13501348

13511349
# Persist chat-level fields the frontend used to save on every message.
13521350
# The old frontend saveChatHandler did this on every message;

backend/open_webui/migrations/versions/b10670c03dd5_update_user_table.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ def _convert_column_to_json(table: str, column: str):
8989
parsed = None
9090

9191
conn.execute(
92-
sa.update(
93-
sa.table(table, sa.column('id'), sa.column(f'{column}_json', sa.JSON))
94-
)
92+
sa.update(sa.table(table, sa.column('id'), sa.column(f'{column}_json', sa.JSON)))
9593
.where(sa.column('id') == uid)
9694
.values({f'{column}_json': parsed})
9795
)
@@ -122,9 +120,7 @@ def _convert_column_to_text(table: str, column: str):
122120

123121
for uid, raw in rows:
124122
conn.execute(
125-
sa.update(
126-
sa.table(table, sa.column('id'), sa.column(f'{column}_text', sa.Text))
127-
)
123+
sa.update(sa.table(table, sa.column('id'), sa.column(f'{column}_text', sa.Text)))
128124
.where(sa.column('id') == uid)
129125
.values({f'{column}_text': json.dumps(raw) if raw is not None else None})
130126
)

backend/open_webui/routers/audio.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,7 @@ async def _transcribe_openai(request, file_path, filename, languages, file_dir,
648648
session = await get_session()
649649
api_key = await Config.get('audio.stt.openai.api_key')
650650
api_base_url = await Config.get('audio.stt.openai.api_base_url')
651-
request_format = (
652-
await Config.get('audio.stt.openai.api_request_format') or 'multipart'
653-
).lower()
651+
request_format = (await Config.get('audio.stt.openai.api_request_format') or 'multipart').lower()
654652

655653
headers = {'Authorization': f'Bearer {api_key}'}
656654
if user and ENABLE_FORWARD_USER_INFO_HEADERS:

backend/open_webui/utils/middleware.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,7 +3471,6 @@ async def non_streaming_chat_response_handler(response, ctx):
34713471
content = choices[0].get('message', {}).get('content') if choices else ''
34723472

34733473
if choices and (content or response_output):
3474-
34753474
if content or response_output:
34763475
await event_emitter(
34773476
{
@@ -4307,11 +4306,7 @@ async def queue_pending_delta_data(delta_data: dict, delta_type: str):
43074306
if reasoning_content or reasoning_details:
43084307
reasoning_item = (
43094308
next(
4310-
(
4311-
item
4312-
for item in reversed(output)
4313-
if item.get('type') == 'reasoning'
4314-
),
4309+
(item for item in reversed(output) if item.get('type') == 'reasoning'),
43154310
None,
43164311
)
43174312
if reasoning_details and not reasoning_content

src/lib/i18n/locales/ar-BH/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@
13091309
"Jina API Key": "",
13101310
"join our Discord for help.": "انضم إلى Discord للحصول على المساعدة.",
13111311
"JSON": "JSON",
1312+
"JSON Base64": "",
13121313
"JSON Preview": "معاينة JSON",
13131314
"JSON Spec": "",
13141315
"July": "يوليو",
@@ -1441,6 +1442,7 @@
14411442
"Memory added successfully": "",
14421443
"Memory cleared successfully": "",
14431444
"Memory deleted successfully": "",
1445+
"Memory System Context": "",
14441446
"Memory updated successfully": "",
14451447
"Merge Accounts by Email": "",
14461448
"Merge Responses": "",
@@ -1520,6 +1522,7 @@
15201522
"More Options": "",
15211523
"Move": "",
15221524
"Moved {{name}}": "",
1525+
"Multipart Upload": "",
15231526
"Mute": "",
15241527
"Muted": "",
15251528
"My Terminal": "",
@@ -1909,6 +1912,7 @@
19091912
"Reply in Thread": "",
19101913
"Reply to thread...": "",
19111914
"Replying to {{NAME}}": "",
1915+
"Request Format": "",
19121916
"Require users to confirm before using Web Search.": "",
19131917
"required": "",
19141918
"Reranking Batch Size": "",
@@ -2422,7 +2426,6 @@
24222426
"Upload Pipeline": "",
24232427
"Upload profile image": "",
24242428
"Upload Progress": "جاري التحميل",
2425-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "",
24262429
"Uploaded files or images": "",
24272430
"Uploading {{current}}/{{total}}: {{file}}": "",
24282431
"Uploading...": "",

src/lib/i18n/locales/ar/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@
13091309
"Jina API Key": "مفتاح API لـ Jina",
13101310
"join our Discord for help.": "انضم إلى Discord للحصول على المساعدة.",
13111311
"JSON": "JSON",
1312+
"JSON Base64": "",
13121313
"JSON Preview": "معاينة JSON",
13131314
"JSON Spec": "",
13141315
"July": "يوليو",
@@ -1441,6 +1442,7 @@
14411442
"Memory added successfully": "تم إضافة الذاكرة بنجاح",
14421443
"Memory cleared successfully": "تم مسح الذاكرة بنجاح",
14431444
"Memory deleted successfully": "تم حذف الذاكرة بنجاح",
1445+
"Memory System Context": "",
14441446
"Memory updated successfully": "تم تحديث الذاكرة بنجاح",
14451447
"Merge Accounts by Email": "",
14461448
"Merge Responses": "دمج الردود",
@@ -1520,6 +1522,7 @@
15201522
"More Options": "",
15211523
"Move": "",
15221524
"Moved {{name}}": "",
1525+
"Multipart Upload": "",
15231526
"Mute": "",
15241527
"Muted": "",
15251528
"My Terminal": "",
@@ -1909,6 +1912,7 @@
19091912
"Reply in Thread": "الرد داخل سلسلة الرسائل",
19101913
"Reply to thread...": "",
19111914
"Replying to {{NAME}}": "",
1915+
"Request Format": "",
19121916
"Require users to confirm before using Web Search.": "",
19131917
"required": "",
19141918
"Reranking Batch Size": "",
@@ -2422,7 +2426,6 @@
24222426
"Upload Pipeline": "رفع خط المعالجة",
24232427
"Upload profile image": "",
24242428
"Upload Progress": "جاري التحميل",
2425-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "",
24262429
"Uploaded files or images": "",
24272430
"Uploading {{current}}/{{total}}: {{file}}": "",
24282431
"Uploading...": "",

src/lib/i18n/locales/az-AZ/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@
12811281
"Jina API Key": "Jina API Açarı",
12821282
"join our Discord for help.": "kömək üçün Discord kanalımıza qoşulun.",
12831283
"JSON": "JSON",
1284+
"JSON Base64": "",
12841285
"JSON Preview": "JSON Önizləmə",
12851286
"JSON Spec": "JSON Spesifikasiyası",
12861287
"July": "İyul",
@@ -1413,6 +1414,7 @@
14131414
"Memory added successfully": "Yaddaş uğurla əlavə edildi",
14141415
"Memory cleared successfully": "Yaddaş uğurla təmizləndi",
14151416
"Memory deleted successfully": "Yaddaş uğurla silindi",
1417+
"Memory System Context": "",
14161418
"Memory updated successfully": "Yaddaş uğurla yeniləndi",
14171419
"Merge Accounts by Email": "",
14181420
"Merge Responses": "Cavabları birləşdir",
@@ -1492,6 +1494,7 @@
14921494
"More Options": "Daha Çox Seçim",
14931495
"Move": "Köçür",
14941496
"Moved {{name}}": "{{name}} köçürüldü",
1497+
"Multipart Upload": "",
14951498
"Mute": "",
14961499
"Muted": "",
14971500
"My Terminal": "Mənim Terminalım",
@@ -1873,6 +1876,7 @@
18731876
"Reply in Thread": "Mövzu daxilində cavabla",
18741877
"Reply to thread...": "Mövzuya cavab yaz...",
18751878
"Replying to {{NAME}}": "{{NAME}} adlı istifadəçiyə cavab verilir",
1879+
"Request Format": "",
18761880
"Require users to confirm before using Web Search.": "",
18771881
"required": "tələb olunur",
18781882
"Reranking Batch Size": "",
@@ -2378,7 +2382,6 @@
23782382
"Upload Pipeline": "Pipeline yüklə",
23792383
"Upload profile image": "Profil şəklini yüklə",
23802384
"Upload Progress": "Yükləmə vəziyyəti",
2381-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "Yükləmə vəziyyəti: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)",
23822385
"Uploaded files or images": "Yüklənmiş fayllar və ya şəkillər",
23832386
"Uploading {{current}}/{{total}}: {{file}}": "",
23842387
"Uploading...": "Yüklənir...",

src/lib/i18n/locales/bg-BG/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@
12811281
"Jina API Key": "API ключ за Jina",
12821282
"join our Discord for help.": "свържете се с нашия Discord за помощ.",
12831283
"JSON": "JSON",
1284+
"JSON Base64": "",
12841285
"JSON Preview": "JSON Преглед",
12851286
"JSON Spec": "",
12861287
"July": "Юли",
@@ -1413,6 +1414,7 @@
14131414
"Memory added successfully": "Паметта е добавена успешно",
14141415
"Memory cleared successfully": "Паметта е изчистена успешно",
14151416
"Memory deleted successfully": "Паметта е изтрита успешно",
1417+
"Memory System Context": "",
14161418
"Memory updated successfully": "Паметта е актуализирана успешно",
14171419
"Merge Accounts by Email": "",
14181420
"Merge Responses": "Обединяване на отговори",
@@ -1492,6 +1494,7 @@
14921494
"More Options": "",
14931495
"Move": "",
14941496
"Moved {{name}}": "",
1497+
"Multipart Upload": "",
14951498
"Mute": "",
14961499
"Muted": "",
14971500
"My Terminal": "",
@@ -1873,6 +1876,7 @@
18731876
"Reply in Thread": "Отговори в тред",
18741877
"Reply to thread...": "",
18751878
"Replying to {{NAME}}": "",
1879+
"Request Format": "",
18761880
"Require users to confirm before using Web Search.": "",
18771881
"required": "",
18781882
"Reranking Batch Size": "",
@@ -2378,7 +2382,6 @@
23782382
"Upload Pipeline": "Качване на конвейер",
23792383
"Upload profile image": "",
23802384
"Upload Progress": "Прогрес на качването",
2381-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "",
23822385
"Uploaded files or images": "",
23832386
"Uploading {{current}}/{{total}}: {{file}}": "",
23842387
"Uploading...": "",

src/lib/i18n/locales/bn-BD/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,7 @@
12811281
"Jina API Key": "",
12821282
"join our Discord for help.": "সাহায্যের জন্য আমাদের Discord-এ যুক্ত হোন",
12831283
"JSON": "JSON",
1284+
"JSON Base64": "",
12841285
"JSON Preview": "JSON প্রিভিউ",
12851286
"JSON Spec": "",
12861287
"July": "জুলাই",
@@ -1413,6 +1414,7 @@
14131414
"Memory added successfully": "",
14141415
"Memory cleared successfully": "",
14151416
"Memory deleted successfully": "",
1417+
"Memory System Context": "",
14161418
"Memory updated successfully": "",
14171419
"Merge Accounts by Email": "",
14181420
"Merge Responses": "",
@@ -1492,6 +1494,7 @@
14921494
"More Options": "",
14931495
"Move": "",
14941496
"Moved {{name}}": "",
1497+
"Multipart Upload": "",
14951498
"Mute": "",
14961499
"Muted": "",
14971500
"My Terminal": "",
@@ -1873,6 +1876,7 @@
18731876
"Reply in Thread": "",
18741877
"Reply to thread...": "",
18751878
"Replying to {{NAME}}": "",
1879+
"Request Format": "",
18761880
"Require users to confirm before using Web Search.": "",
18771881
"required": "",
18781882
"Reranking Batch Size": "",
@@ -2378,7 +2382,6 @@
23782382
"Upload Pipeline": "",
23792383
"Upload profile image": "",
23802384
"Upload Progress": "আপলোড হচ্ছে",
2381-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "",
23822385
"Uploaded files or images": "",
23832386
"Uploading {{current}}/{{total}}: {{file}}": "",
23842387
"Uploading...": "",

src/lib/i18n/locales/bo-TB/translation.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@
12741274
"Jina API Key": "Jina API ལྡེ་མིག",
12751275
"join our Discord for help.": "རོགས་རམ་ཆེད་དུ་ང་ཚོའི་ Discord ལ་མཉམ་ཞུགས་བྱེད་པ།",
12761276
"JSON": "JSON",
1277+
"JSON Base64": "",
12771278
"JSON Preview": "JSON སྔོན་ལྟ།",
12781279
"JSON Spec": "",
12791280
"July": "ཟླ་བ་བདུན་པ།",
@@ -1406,6 +1407,7 @@
14061407
"Memory added successfully": "དྲན་ཤེས་ལེགས་པར་བསྣན་ཟིན།",
14071408
"Memory cleared successfully": "དྲན་ཤེས་ལེགས་པར་གཙང་སེལ་བྱས་ཟིན།",
14081409
"Memory deleted successfully": "དྲན་ཤེས་ལེགས་པར་བསུབས་ཟིན།",
1410+
"Memory System Context": "",
14091411
"Memory updated successfully": "དྲན་ཤེས་ལེགས་པར་གསར་སྒྱུར་བྱས་ཟིན།",
14101412
"Merge Accounts by Email": "",
14111413
"Merge Responses": "ལན་ཟླ་སྒྲིལ།",
@@ -1485,6 +1487,7 @@
14851487
"More Options": "",
14861488
"Move": "",
14871489
"Moved {{name}}": "",
1490+
"Multipart Upload": "",
14881491
"Mute": "",
14891492
"Muted": "",
14901493
"My Terminal": "",
@@ -1864,6 +1867,7 @@
18641867
"Reply in Thread": "བརྗོད་གཞིའི་ནང་ལན་འདེབས།",
18651868
"Reply to thread...": "",
18661869
"Replying to {{NAME}}": "",
1870+
"Request Format": "",
18671871
"Require users to confirm before using Web Search.": "",
18681872
"required": "",
18691873
"Reranking Batch Size": "",
@@ -2367,7 +2371,6 @@
23672371
"Upload Pipeline": "རྒྱུ་ལམ་སྤར་བ།",
23682372
"Upload profile image": "",
23692373
"Upload Progress": "སྤར་བའི་འཕེལ་རིམ།",
2370-
"Upload Progress: {{uploadedFiles}}/{{totalFiles}} ({{percentage}}%)": "",
23712374
"Uploaded files or images": "",
23722375
"Uploading {{current}}/{{total}}: {{file}}": "",
23732376
"Uploading...": "",

0 commit comments

Comments
 (0)