diff --git a/backend/open_webui/models/knowledge.py b/backend/open_webui/models/knowledge.py index 27415b43e9..d2b8c58b8d 100644 --- a/backend/open_webui/models/knowledge.py +++ b/backend/open_webui/models/knowledge.py @@ -606,7 +606,9 @@ class KnowledgeTable: result = await db.execute(stmt) items = result.all() - directories = {directory.id: directory for directory in await self.get_all_directories(knowledge_id, db=db)} + directories = { + directory.id: directory for directory in await self.get_all_directories(knowledge_id, db=db) + } paths = {} def directory_path(directory_id): diff --git a/backend/open_webui/routers/audio/realtime.py b/backend/open_webui/routers/audio/realtime.py index 807eaf0eac..bddef830fd 100644 --- a/backend/open_webui/routers/audio/realtime.py +++ b/backend/open_webui/routers/audio/realtime.py @@ -214,21 +214,23 @@ class CallProtocol: 'item': { 'type': 'function_call_output', 'call_id': event['call_id'], - 'output': JSONCodec.dumps({ - 'status': status, - 'effect': { - 'started': 'The requested gesture has started and is visible to the user.', - 'busy': ( - 'An earlier gesture is still being performed. This additional request was skipped ' - 'to avoid overlap. This is not a playback failure and does not cancel the earlier gesture.' - ), - 'unavailable': ( - 'This request could not start. This result does not change the outcome ' - 'of any earlier gesture that already started.' - ), - 'cancelled': 'This request was skipped because its response was interrupted.', - }[status], - }), + 'output': JSONCodec.dumps( + { + 'status': status, + 'effect': { + 'started': 'The requested gesture has started and is visible to the user.', + 'busy': ( + 'An earlier gesture is still being performed. This additional request was skipped ' + 'to avoid overlap. This is not a playback failure and does not cancel the earlier gesture.' + ), + 'unavailable': ( + 'This request could not start. This result does not change the outcome ' + 'of any earlier gesture that already started.' + ), + 'cancelled': 'This request was skipped because its response was interrupted.', + }[status], + } + ), }, } if kind == 'bridge.animation.respond' and set(event) == {'type', 'response_id'}: @@ -291,11 +293,17 @@ class CallProtocol: 'response': { 'tools': [] if failed else self.animation_tools, 'tool_choice': 'auto' if self.animation_tools and not failed else 'none', - **({'instructions': ( - 'Briefly tell the user the request failed, in their language. No retry is running. ' - 'Tell them they can ask you to retry, then stop. Do not claim work is continuing ' - 'or invent a cause.' - )} if failed else {}), + **( + { + 'instructions': ( + 'Briefly tell the user the request failed, in their language. No retry is running. ' + 'Tell them they can ask you to retry, then stop. Do not claim work is continuing ' + 'or invent a cause.' + ) + } + if failed + else {} + ), 'metadata': {'call_id': call_id}, }, } diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index c94de3cda3..9d24ca9aac 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -749,7 +749,9 @@ async def update_file_data_content_by_id( except Exception as e: log.exception(e) log.error(f'Error processing file: {id}') - raise HTTPException(status_code=500, detail='Failed to process indexed text. Your changes were not fully indexed.') from e + raise HTTPException( + status_code=500, detail='Failed to process indexed text. Your changes were not fully indexed.' + ) from e # Propagate content change to all knowledge collections referencing # this file. Without this the old embeddings remain in the knowledge diff --git a/backend/open_webui/socket/redis_room_channels.py b/backend/open_webui/socket/redis_room_channels.py index f5959624a6..73ac602ae8 100644 --- a/backend/open_webui/socket/redis_room_channels.py +++ b/backend/open_webui/socket/redis_room_channels.py @@ -44,7 +44,9 @@ class AsyncRedisRoomChannelManager(AsyncRedisManager): 'Redis denied publishing: %s. Check PUBLISH permission and channel ACLs ' '(&%s and &%s#*). To disable room channels, set ' 'WEBSOCKET_REDIS_ROOM_CHANNELS=False on every instance and fully restart the fleet.', - exc, self.channel, self.channel, + exc, + self.channel, + self.channel, ) if retries_left > 0: self._get_logger().error('Cannot publish to redis... retrying', extra={'redis_exception': str(exc)}) @@ -74,7 +76,9 @@ class AsyncRedisRoomChannelManager(AsyncRedisManager): 'Redis denied subscribing: %s. Check SUBSCRIBE/PSUBSCRIBE permissions and channel ACLs ' '(&%s and &%s#*). To disable room channels, set ' 'WEBSOCKET_REDIS_ROOM_CHANNELS=False on every instance and fully restart the fleet.', - exc, self.channel, self.channel, + exc, + self.channel, + self.channel, ) self._get_logger().error( f'Cannot receive from redis... retrying in {retry_sleep} secs', diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index bc251652ae..6aa8598302 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -2800,11 +2800,15 @@ async def process_chat_payload(request, form_data, user, metadata, model): ) skill_authoring_allowed = can_author_skills and has_prior_user_message(form_data.get('messages', [])) skill_create_denial_reason = 'empty_chat' if can_author_skills else 'disabled' - if apply_skills_create_prompt( - form_data.get('messages', []), - allowed=skill_authoring_allowed, - denial_reason=skill_create_denial_reason, - ) and is_saved_chat_id(chat_id) and user_message_id: + if ( + apply_skills_create_prompt( + form_data.get('messages', []), + allowed=skill_authoring_allowed, + denial_reason=skill_create_denial_reason, + ) + and is_saved_chat_id(chat_id) + and user_message_id + ): stored_message = await Chats.get_message_by_id_and_message_id(chat_id, user_message_id) or {} await Chats.upsert_message_to_chat_by_id_and_message_id( chat_id, diff --git a/backend/open_webui/utils/models.py b/backend/open_webui/utils/models.py index bf4585f555..19ada49fc6 100644 --- a/backend/open_webui/utils/models.py +++ b/backend/open_webui/utils/models.py @@ -38,7 +38,11 @@ def public_model_params(params): { 'model_controls': { key: { - **{field: control[field] for field in ('label', 'description', 'default', 'display') if field in control}, + **{ + field: control[field] + for field in ('label', 'description', 'default', 'display') + if field in control + }, 'options': {key: {'label': option['label']} for key, option in control['options'].items()}, } for key, control in controls.items() diff --git a/backend/open_webui/utils/tool_approval.py b/backend/open_webui/utils/tool_approval.py index 52d8d822c9..698c999862 100644 --- a/backend/open_webui/utils/tool_approval.py +++ b/backend/open_webui/utils/tool_approval.py @@ -244,9 +244,7 @@ async def build_tool_approval_resume_payload(chat_id: str, message_id: str, chat 'tool_servers': message_meta.get('tool_servers') or None, 'features': message_meta.get('features') or {}, 'variables': message_meta.get('variables') or {}, - 'chat_variables': chat.variables - if (assistant_message.get('user_id') or chat.user_id) == chat.user_id - else {}, + 'chat_variables': chat.variables if (assistant_message.get('user_id') or chat.user_id) == chat.user_id else {}, 'session_id': message_meta.get('session_id'), 'chat_id': chat_id, 'id': message_id, diff --git a/backend/open_webui/utils/voice_avatar.py b/backend/open_webui/utils/voice_avatar.py index 0d55b11e31..ff78dbfb13 100644 --- a/backend/open_webui/utils/voice_avatar.py +++ b/backend/open_webui/utils/voice_avatar.py @@ -203,9 +203,7 @@ def validate_voice_animation(data: bytes) -> None: interpolation = sampler.get('interpolation', 'LINEAR') if interpolation not in ('LINEAR', 'STEP'): raise ValueError('Export baked animation with linear or stepped keyframes.') - if len(outputs) != len(times) or len(outputs[0]) != ( - 4 if target['path'] == 'rotation' else 3 - ): + if len(outputs) != len(times) or len(outputs[0]) != (4 if target['path'] == 'rotation' else 3): raise ValueError('Invalid animation output.') duration = max(duration, times[-1][0]) if not body or not 0 < duration <= 60: diff --git a/src/lib/components/admin/Settings/General.svelte b/src/lib/components/admin/Settings/General.svelte index 541448db03..6bdbb47c00 100644 --- a/src/lib/components/admin/Settings/General.svelte +++ b/src/lib/components/admin/Settings/General.svelte @@ -276,7 +276,6 @@ - - - + + diff --git a/src/lib/components/workspace/Models/TerminalSelector.svelte b/src/lib/components/workspace/Models/TerminalSelector.svelte index c27e9f5c11..af0a98134f 100644 --- a/src/lib/components/workspace/Models/TerminalSelector.svelte +++ b/src/lib/components/workspace/Models/TerminalSelector.svelte @@ -20,7 +20,9 @@ >