Skip to content

Commit a71d927

Browse files
committed
chore: format
1 parent 640dbb6 commit a71d927

69 files changed

Lines changed: 153 additions & 37 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/models/chats.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,7 @@ def get_chat_list_by_user_id(
827827
else:
828828
query = query.order_by(Chat.updated_at.desc(), Chat.id)
829829

830-
query = query.with_entities(
831-
Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at
832-
)
830+
query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at)
833831

834832
if skip:
835833
query = query.offset(skip)
@@ -1263,9 +1261,7 @@ def get_chats_by_folder_id_and_user_id(
12631261

12641262
query = query.order_by(Chat.updated_at.desc(), Chat.id)
12651263

1266-
query = query.with_entities(
1267-
Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at
1268-
)
1264+
query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at)
12691265

12701266
if skip:
12711267
query = query.offset(skip)
@@ -1348,9 +1344,7 @@ def get_chat_list_by_user_id_and_tag_name(
13481344

13491345
query = query.order_by(Chat.updated_at.desc(), Chat.id)
13501346

1351-
query = query.with_entities(
1352-
Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at
1353-
)
1347+
query = query.with_entities(Chat.id, Chat.title, Chat.updated_at, Chat.created_at, Chat.last_read_at)
13541348

13551349
if skip:
13561350
query = query.offset(skip)

backend/open_webui/models/feedbacks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,7 @@ def get_feedback_items(
218218
# Apply model_id filter (exact match)
219219
model_id = filter.get('model_id')
220220
if model_id:
221-
query = query.filter(
222-
Feedback.data['model_id'].as_string() == model_id
223-
)
221+
query = query.filter(Feedback.data['model_id'].as_string() == model_id)
224222

225223
order_by = filter.get('order_by')
226224
direction = filter.get('direction')

backend/open_webui/routers/evaluations.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,7 @@ async def export_all_feedbacks(
321321
):
322322
feedbacks = Feedbacks.get_all_feedbacks(db=db)
323323
if model_id:
324-
feedbacks = [
325-
f for f in feedbacks
326-
if f.data and f.data.get('model_id') == model_id
327-
]
324+
feedbacks = [f for f in feedbacks if f.data and f.data.get('model_id') == model_id]
328325
return feedbacks
329326

330327

backend/open_webui/utils/oauth.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,9 +1357,8 @@ async def handle_login(self, request, provider):
13571357
client = self.get_client(provider)
13581358
if client is None:
13591359
raise HTTPException(404)
1360-
redirect_uri = (
1361-
(client.server_metadata or {}).get('redirect_uri')
1362-
or request.url_for('oauth_login_callback', provider=provider)
1360+
redirect_uri = (client.server_metadata or {}).get('redirect_uri') or request.url_for(
1361+
'oauth_login_callback', provider=provider
13631362
)
13641363

13651364
kwargs = {}

backend/open_webui/utils/validate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
)
88

99
# External URL prefixes that are explicitly trusted for profile images
10-
_ALLOWED_URL_PREFIXES = (
11-
'https://www.gravatar.com/avatar/',
12-
)
10+
_ALLOWED_URL_PREFIXES = ('https://www.gravatar.com/avatar/',)
1311

1412

1513
def validate_profile_image_url(url: str) -> str:

src/lib/apis/auths/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export const updateUserProfile = async (token: string, profile: object) => {
414414
console.error(err);
415415
error = err.detail;
416416
if (Array.isArray(error)) {
417-
error = error.map((e: { msg?: string }) => e.msg).join("; ");
417+
error = error.map((e: { msg?: string }) => e.msg).join('; ');
418418
}
419419
return null;
420420
});

src/lib/apis/evaluations/index.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ export const getFeedbackModelIds = async (token: string = '') => {
189189
return res;
190190
};
191191

192-
export const getFeedbackItems = async (token: string = '', orderBy, direction, page, modelId: string = '') => {
192+
export const getFeedbackItems = async (
193+
token: string = '',
194+
orderBy,
195+
direction,
196+
page,
197+
modelId: string = ''
198+
) => {
193199
let error = null;
194200

195201
const searchParams = new URLSearchParams();
@@ -235,14 +241,17 @@ export const exportAllFeedbacks = async (token: string = '', modelId: string = '
235241
const searchParams = new URLSearchParams();
236242
if (modelId) searchParams.append('model_id', modelId);
237243

238-
const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`, {
239-
method: 'GET',
240-
headers: {
241-
Accept: 'application/json',
242-
'Content-Type': 'application/json',
243-
authorization: `Bearer ${token}`
244+
const res = await fetch(
245+
`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all/export?${searchParams.toString()}`,
246+
{
247+
method: 'GET',
248+
headers: {
249+
Accept: 'application/json',
250+
'Content-Type': 'application/json',
251+
authorization: `Bearer ${token}`
252+
}
244253
}
245-
})
254+
)
246255
.then(async (res) => {
247256
if (!res.ok) throw await res.json();
248257
return res.json();

src/lib/components/admin/Evaluations/Feedbacks.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@
176176
: s;
177177
};
178178
179-
return [
180-
headers.join(','),
181-
...rows.map((r) => headers.map((h) => escape(r[h])).join(','))
182-
].join('\n');
179+
return [headers.join(','), ...rows.map((r) => headers.map((h) => escape(r[h])).join(','))].join(
180+
'\n'
181+
);
183182
};
184183
185184
const exportHandler = async (format: 'json' | 'csv' = 'json') => {

src/lib/components/chat/Messages/ContentRenderer.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
let contentContainerElement;
4343
let floatingButtonsElement;
4444
45-
4645
let sourceIds = [];
4746
$: getSourceIds(sources);
4847

src/lib/components/chat/ModelSelector/Selector.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,12 @@
497497
>
498498
{#snippet child({ wrapperProps, props, open })}
499499
{#if open}
500-
<div {...wrapperProps} style="{wrapperProps.style ?? ''}{$mobile ? '; left: 0.5rem !important; width: calc(100vw - 1rem) !important;' : ''}">
500+
<div
501+
{...wrapperProps}
502+
style="{wrapperProps.style ?? ''}{$mobile
503+
? '; left: 0.5rem !important; width: calc(100vw - 1rem) !important;'
504+
: ''}"
505+
>
501506
<div
502507
{...props}
503508
class="{props.class} z-40 {$mobile

0 commit comments

Comments
 (0)