refac: modernize type annotations (PEP 604 / PEP 585)

This commit is contained in:
Timothy Jaeryang Baek
2026-05-12 17:10:15 +09:00
parent a59c967d7e
commit 6d0295588e
197 changed files with 3265 additions and 3488 deletions
@@ -1,16 +1,15 @@
import json
from typing import Any
from open_webui.models.users import UserModel
from open_webui.models.groups import Groups
from open_webui.config import DEFAULT_USER_PERMISSIONS
from open_webui.models.access_grants import (
has_public_read_access_grant,
has_public_write_access_grant,
has_user_access_grant,
strip_user_access_grants,
)
from open_webui.config import DEFAULT_USER_PERMISSIONS
from open_webui.models.groups import Groups
from open_webui.models.users import UserModel
from sqlalchemy.ext.asyncio import AsyncSession
@@ -272,8 +271,8 @@ async def has_base_model_access(
provider model that has no per-model ACL). Returns ``False`` the
moment a registered base model denies access.
"""
from open_webui.models.models import Models
from open_webui.models.access_grants import AccessGrants
from open_webui.models.models import Models
base_model_id = getattr(model_info, 'base_model_id', None)
seen = {model_info.id}
@@ -1,14 +1,13 @@
import logging
from open_webui.models.users import UserModel
from open_webui.models.files import Files
from open_webui.models.knowledge import Knowledges
from open_webui.models.access_grants import AccessGrants
from open_webui.models.channels import Channels
from open_webui.models.chats import Chats
from open_webui.models.files import Files
from open_webui.models.groups import Groups
from open_webui.models.knowledge import Knowledges
from open_webui.models.models import Models
from open_webui.models.access_grants import AccessGrants
from open_webui.models.users import UserModel
from sqlalchemy.ext.asyncio import AsyncSession
log = logging.getLogger(__name__)