mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(mypy): resolve type errors in public_endpoints, user_api_key_auth, common_utils, transformation
- public_endpoints.py: fix _cached_endpoints type annotation - user_api_key_auth.py: accept Optional[str] for end_user_id parameter - common_utils.py: add NewProjectRequest/UpdateProjectRequest to Union type - transformation.py: add ChatCompletionRedactedThinkingBlock and list[Any] to content type Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
This commit is contained in:
parent
fa54c08372
commit
717a32c9c9
4 changed files with 8 additions and 3 deletions
|
|
@ -49,6 +49,7 @@ if TYPE_CHECKING:
|
|||
ALL_RESPONSES_API_TOOL_PARAMS,
|
||||
AllMessageValues,
|
||||
ChatCompletionImageObject,
|
||||
ChatCompletionRedactedThinkingBlock,
|
||||
ChatCompletionThinkingBlock,
|
||||
OpenAIMessageContentListBlock,
|
||||
)
|
||||
|
|
@ -579,7 +580,8 @@ class LiteLLMResponsesTransformationHandler(CompletionTransformationBridge):
|
|||
content: Optional[
|
||||
Union[
|
||||
str,
|
||||
Iterable[Union["OpenAIMessageContentListBlock", "ChatCompletionThinkingBlock"]],
|
||||
List[Any],
|
||||
Iterable[Union["OpenAIMessageContentListBlock", "ChatCompletionThinkingBlock", "ChatCompletionRedactedThinkingBlock"]],
|
||||
]
|
||||
],
|
||||
role: str,
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ def _get_bearer_token(
|
|||
def _apply_budget_limits_to_end_user_params(
|
||||
end_user_params: dict,
|
||||
budget_info: LiteLLM_BudgetTable,
|
||||
end_user_id: str,
|
||||
end_user_id: Optional[str],
|
||||
) -> None:
|
||||
"""
|
||||
Helper function to apply budget limits to end user parameters.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ from litellm.proxy._types import (
|
|||
from litellm.proxy.utils import _premium_user_check
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from litellm.proxy._types import NewProjectRequest, UpdateProjectRequest
|
||||
from litellm.proxy.utils import PrismaClient, ProxyLogging
|
||||
|
||||
|
||||
|
|
@ -283,6 +284,8 @@ def _set_object_metadata_field(
|
|||
KeyRequestBase,
|
||||
LiteLLM_OrganizationTable,
|
||||
LiteLLM_ProjectTable,
|
||||
"NewProjectRequest",
|
||||
"UpdateProjectRequest",
|
||||
],
|
||||
field_name: str,
|
||||
value: Any,
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ _ENDPOINT_METADATA: Dict[str, Dict[str, str]] = {
|
|||
_SLUG_SUFFIX_RE = re.compile(r"\s*\(`[^`]+`\)\s*$")
|
||||
|
||||
# Loaded once on first request; never invalidated (local file, no TTL needed).
|
||||
_cached_endpoints: Optional[List[Dict[str, Any]]] = None
|
||||
_cached_endpoints: Optional[SupportedEndpointsResponse] = None
|
||||
|
||||
|
||||
def _clean_display_name(raw: str) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue