mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-11 03:38:02 +00:00
chore: format
This commit is contained in:
parent
bf5866ee23
commit
fea827bc2e
11 changed files with 61 additions and 44 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -276,7 +276,6 @@
|
|||
</div>
|
||||
</AdminSettingSection>
|
||||
|
||||
|
||||
<AdminSettingSection title={$i18n.t('settings.admin.general.sections.features.title')}>
|
||||
<AdminSettingRow
|
||||
label={$i18n.t('settings.admin.general.communitySharing.label')}
|
||||
|
|
|
|||
|
|
@ -14,10 +14,6 @@
|
|||
stroke-linejoin="round"
|
||||
class={className}
|
||||
>
|
||||
<path
|
||||
d="M9 4.5C3 4.5 10 9.5 5.5 12C10 14.5 3 19.5 9 19.5"
|
||||
/>
|
||||
<path
|
||||
d="M15 4.5C21 4.5 14 9.5 18.5 12C14 14.5 21 19.5 15 19.5"
|
||||
/>
|
||||
<path d="M9 4.5C3 4.5 10 9.5 5.5 12C10 14.5 3 19.5 9 19.5" />
|
||||
<path d="M15 4.5C21 4.5 14 9.5 18.5 12C14 14.5 21 19.5 15 19.5" />
|
||||
</svg>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@
|
|||
>
|
||||
<ModelSettingsLabel
|
||||
label={$i18n.t('Default terminal')}
|
||||
description={$i18n.t('Choose the terminal server selected by default for chats with this model.')}
|
||||
description={$i18n.t(
|
||||
'Choose the terminal server selected by default for chats with this model.'
|
||||
)}
|
||||
/>
|
||||
<select
|
||||
class="min-w-0 max-w-[60%] cursor-pointer bg-transparent py-0 text-xs font-normal text-gray-900 outline-hidden dark:text-gray-100"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue