mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 06:42:22 +02:00
chore: format
This commit is contained in:
@@ -1706,7 +1706,9 @@ class OAuthManager:
|
||||
redirect_url = f"{redirect_base_url}/auth"
|
||||
|
||||
if error_message:
|
||||
redirect_url = f"{redirect_url}?error={urllib.parse.quote_plus(error_message)}"
|
||||
redirect_url = (
|
||||
f"{redirect_url}?error={urllib.parse.quote_plus(error_message)}"
|
||||
)
|
||||
return RedirectResponse(url=redirect_url, headers=response.headers)
|
||||
|
||||
response = RedirectResponse(url=redirect_url, headers=response.headers)
|
||||
|
||||
@@ -162,9 +162,7 @@ def truncate_content(content: str, max_chars: int, mode: str = "middletruncate")
|
||||
return f"{content[:half]}...{content[-(max_chars - half):]}"
|
||||
|
||||
|
||||
def apply_content_filter(
|
||||
messages: list[dict], filter_str: str
|
||||
) -> list[dict]:
|
||||
def apply_content_filter(messages: list[dict], filter_str: str) -> list[dict]:
|
||||
"""Apply a content filter to each message's content.
|
||||
|
||||
filter_str is like 'middletruncate:500', 'start:200', or 'end:200'.
|
||||
@@ -238,9 +236,7 @@ def replace_messages_variable(
|
||||
else:
|
||||
half = mid // 2
|
||||
start_msgs = messages[:half]
|
||||
end_msgs = (
|
||||
messages[-half:] if mid % 2 == 0 else messages[-(half + 1) :]
|
||||
)
|
||||
end_msgs = messages[-half:] if mid % 2 == 0 else messages[-(half + 1) :]
|
||||
selected = start_msgs + end_msgs
|
||||
content_filter = middle_filter
|
||||
else:
|
||||
|
||||
@@ -32,8 +32,7 @@ async def post_webhook(name: str, url: str, message: str, event_data: dict) -> b
|
||||
else:
|
||||
user_dict = json.loads(user_data)
|
||||
facts = [
|
||||
{"name": name, "value": value}
|
||||
for name, value in user_dict.items()
|
||||
{"name": name, "value": value} for name, value in user_dict.items()
|
||||
]
|
||||
payload = {
|
||||
"@type": "MessageCard",
|
||||
|
||||
Reference in New Issue
Block a user