diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index dc2f63695..5f53e741e 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -827,9 +827,7 @@ class ChatTable: else: query = query.order_by(Chat.updated_at.desc(), Chat.id) - query = query.with_entities( - Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at - ) + query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at) if skip: query = query.offset(skip) @@ -1263,9 +1261,7 @@ class ChatTable: query = query.order_by(Chat.updated_at.desc(), Chat.id) - query = query.with_entities( - Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at - ) + query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at) if skip: query = query.offset(skip) @@ -1348,9 +1344,7 @@ class ChatTable: query = query.order_by(Chat.updated_at.desc(), Chat.id) - query = query.with_entities( - Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at - ) + query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at) if skip: query = query.offset(skip) diff --git a/backend/open_webui/models/feedbacks.py b/backend/open_webui/models/feedbacks.py index f930739f6..9172e2ba8 100644 --- a/backend/open_webui/models/feedbacks.py +++ b/backend/open_webui/models/feedbacks.py @@ -218,9 +218,7 @@ class FeedbackTable: # Apply model_id filter (exact match) model_id = filter.get('model_id') if model_id: - query = query.filter( - Feedback.data['model_id'].as_string() == model_id - ) + query = query.filter(Feedback.data['model_id'].as_string() == model_id) order_by = filter.get('order_by') direction = filter.get('direction') diff --git a/backend/open_webui/routers/evaluations.py b/backend/open_webui/routers/evaluations.py index a743f8f9f..9805f2ece 100644 --- a/backend/open_webui/routers/evaluations.py +++ b/backend/open_webui/routers/evaluations.py @@ -321,10 +321,7 @@ async def export_all_feedbacks( ): feedbacks = Feedbacks.get_all_feedbacks(db=db) if model_id: - feedbacks = [ - f for f in feedbacks - if f.data and f.data.get('model_id') == model_id - ] + feedbacks = [f for f in feedbacks if f.data and f.data.get('model_id') == model_id] return feedbacks diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index 0cbe753b7..885b79afd 100644 --- a/backend/open_webui/utils/oauth.py +++ b/backend/open_webui/utils/oauth.py @@ -1357,9 +1357,8 @@ class OAuthManager: client = self.get_client(provider) if client is None: raise HTTPException(404) - redirect_uri = ( - (client.server_metadata or {}).get('redirect_uri') - or request.url_for('oauth_login_callback', provider=provider) + redirect_uri = (client.server_metadata or {}).get('redirect_uri') or request.url_for( + 'oauth_login_callback', provider=provider ) kwargs = {} diff --git a/backend/open_webui/utils/validate.py b/backend/open_webui/utils/validate.py index 5686f20ec..eec53317f 100644 --- a/backend/open_webui/utils/validate.py +++ b/backend/open_webui/utils/validate.py @@ -7,9 +7,7 @@ _ALLOWED_STATIC_PATHS = ( ) # External URL prefixes that are explicitly trusted for profile images -_ALLOWED_URL_PREFIXES = ( - 'https://www.gravatar.com/avatar/', -) +_ALLOWED_URL_PREFIXES = ('https://www.gravatar.com/avatar/',) def validate_profile_image_url(url: str) -> str: diff --git a/src/lib/apis/auths/index.ts b/src/lib/apis/auths/index.ts index f8e953f7c..c501a36ed 100644 --- a/src/lib/apis/auths/index.ts +++ b/src/lib/apis/auths/index.ts @@ -414,7 +414,7 @@ export const updateUserProfile = async (token: string, profile: object) => { console.error(err); error = err.detail; if (Array.isArray(error)) { - error = error.map((e: { msg?: string }) => e.msg).join("; "); + error = error.map((e: { msg?: string }) => e.msg).join('; '); } return null; }); diff --git a/src/lib/apis/evaluations/index.ts b/src/lib/apis/evaluations/index.ts index 925329511..bfb6955bc 100644 --- a/src/lib/apis/evaluations/index.ts +++ b/src/lib/apis/evaluations/index.ts @@ -189,7 +189,13 @@ export const getFeedbackModelIds = async (token: string = '') => { return res; }; -export const getFeedbackItems = async (token: string = '', orderBy, direction, page, modelId: string = '') => { +export const getFeedbackItems = async ( + token: string = '', + orderBy, + direction, + page, + modelId: string = '' +) => { let error = null; const searchParams = new URLSearchParams(); @@ -235,14 +241,17 @@ export const exportAllFeedbacks = async (token: string = '', modelId: string = ' const searchParams = new URLSearchParams(); if (modelId) searchParams.append('model_id', modelId); - const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`, { - method: 'GET', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - authorization: `Bearer ${token}` + const res = await fetch( + `${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`, + { + method: 'GET', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + authorization: `Bearer ${token}` + } } - }) + ) .then(async (res) => { if (!res.ok) throw await res.json(); return res.json(); diff --git a/src/lib/components/admin/Evaluations/Feedbacks.svelte b/src/lib/components/admin/Evaluations/Feedbacks.svelte index 6e11291d5..da7c8b579 100644 --- a/src/lib/components/admin/Evaluations/Feedbacks.svelte +++ b/src/lib/components/admin/Evaluations/Feedbacks.svelte @@ -176,10 +176,9 @@ : s; }; - return [ - headers.join(','), - ...rows.map((r) => headers.map((h) => escape(r[h])).join(',')) - ].join('\n'); + return [headers.join(','), ...rows.map((r) => headers.map((h) => escape(r[h])).join(','))].join( + '\n' + ); }; const exportHandler = async (format: 'json' | 'csv' = 'json') => { diff --git a/src/lib/components/chat/Messages/ContentRenderer.svelte b/src/lib/components/chat/Messages/ContentRenderer.svelte index 1a5709d43..37246c6de 100644 --- a/src/lib/components/chat/Messages/ContentRenderer.svelte +++ b/src/lib/components/chat/Messages/ContentRenderer.svelte @@ -42,7 +42,6 @@ let contentContainerElement; let floatingButtonsElement; - let sourceIds = []; $: getSourceIds(sources); diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index 8cc04272b..300d59a2a 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -497,7 +497,12 @@ > {#snippet child({ wrapperProps, props, open })} {#if open} -
+