refactor(types): move MemberDeleteRequest into litellm.types.proxy.management_endpoints.team_endpoints (#45814)

* refactor(types): move LitellmUserRoles and KeyManagementRoutes into litellm.types.proxy.auth.user_roles

Part of LIT-9423

* refactor(types): annotate GenerateRequestBase containers and check_max_budget

Part of LIT-9423

* refactor(types): move GenerateRequestBase and LiteLLM_ObjectPermissionBase into litellm.types.proxy.management_endpoints.request_base

Part of LIT-9423

* refactor(types): annotate user request metadata and check_user_info validators

Part of LIT-9423

* refactor(types): move user request models into litellm.types.proxy.management_endpoints.user_requests

Part of LIT-9423

* refactor(types): move MemberDeleteRequest into litellm.types.proxy.management_endpoints.team_endpoints

Part of LIT-9423

* fix(types): restore main's _types.py content alongside the request_base move

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* fix(sdk): resolve litellm.proxy lazily on attribute access

The layer cleanup stopped import litellm from loading any proxy module, so litellm.proxy was no longer bound and litellm.proxy._types.X raised AttributeError. The module __getattr__ now imports litellm.proxy on first access, which keeps import litellm free of proxy._types and fixes the docs and code-quality checks on main

* style(types): merge request_base re-exports into one import block

Part of LIT-9423

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
nate-berri 2026-10-10 13:58:46 -07:00 • committed by GitHub
parent 513e7a89ac
commit 2011004d0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 14 deletions

View file

@ -4370,16 +4370,9 @@ class OrganizationAddMemberResponse(LiteLLMPydanticObjectBase):
updated_organization_memberships: list[LiteLLM_OrganizationMembershipTable]
class MemberDeleteRequest(LiteLLMPydanticObjectBase):
user_id: str | None = None
user_email: str | None = None
@model_validator(mode="before")
@classmethod
def check_user_info(cls, values: Mapping[str, object]) -> Mapping[str, object]:
if values.get("user_id") is None and values.get("user_email") is None:
raise ValueError("Either user id or user email must be provided")
return values
from litellm.types.proxy.management_endpoints.team_endpoints import ( # noqa: E402 # re-export after the definitions above
MemberDeleteRequest as MemberDeleteRequest, # noqa: PLC0414 # public re-export
)
class MemberUpdateResponse(LiteLLMPydanticObjectBase):

View file

@ -1,16 +1,15 @@
from collections.abc import Mapping
from typing import Any, Final, Literal
from pydantic import ConfigDict, Field, field_validator, model_validator
from litellm.models.team import LiteLLM_DeletedTeamTable, LiteLLM_TeamTable, Member
from litellm.models.team_membership import LiteLLM_TeamMembership
from litellm.proxy._types import (
KeyManagementRoutes,
MemberDeleteRequest,
)
from litellm.proxy.common_utils.timezone_utils import budget_duration_error
from litellm.types.llms.base import LiteLLMBaseModel
from litellm.types.proxy.auth.user_roles import KeyManagementRoutes
from litellm.types.proxy.management_endpoints.management_v1 import ResourceResponse
from litellm.types.utils import LiteLLMPydanticObjectBase
TeamIdSearchMatch = Literal["exact", "prefix"]
@ -19,6 +18,18 @@ MAX_BULK_TEAM_MEMBER_DELETES: Final = 500
MAX_BULK_TEAM_MEMBER_BUDGET_UPDATES: Final = 500
class MemberDeleteRequest(LiteLLMPydanticObjectBase):
user_id: str | None = None
user_email: str | None = None
@model_validator(mode="before")
@classmethod
def check_user_info(cls, values: Mapping[str, object]) -> Mapping[str, object]:
if values.get("user_id") is None and values.get("user_email") is None:
raise ValueError("Either user id or user email must be provided")
return values
class GetTeamMemberPermissionsRequest(LiteLLMBaseModel):
"""Request to get the team member permissions for a team"""