diff --git a/litellm/proxy/management_endpoints/cost_tracking_settings.py b/litellm/proxy/management_endpoints/cost_tracking_settings.py index c17d93f3b9..4418d934c8 100644 --- a/litellm/proxy/management_endpoints/cost_tracking_settings.py +++ b/litellm/proxy/management_endpoints/cost_tracking_settings.py @@ -10,7 +10,7 @@ PATCH /config/cost_margin_config - Update cost margin configuration POST /cost/estimate - Estimate cost for a given model and token counts """ -from typing import Dict, Optional, Tuple, Union, cast +from typing import Dict, Optional, Tuple, Union from fastapi import APIRouter, Depends, HTTPException @@ -66,8 +66,8 @@ def _resolve_model_for_cost_lookup(model: str) -> Tuple[str, Optional[str]]: verbose_proxy_logger.debug( f"Resolved model '{model}' to base_model '{base_model}' from router" ) - custom_llm_provider = cast(Optional[str], litellm_params.get("custom_llm_provider")) - return cast(str, base_model), custom_llm_provider + custom_llm_provider = litellm_params.get("custom_llm_provider") + return str(base_model), str(custom_llm_provider) if custom_llm_provider is not None else None resolved_model = litellm_params.get("model") @@ -75,8 +75,8 @@ def _resolve_model_for_cost_lookup(model: str) -> Tuple[str, Optional[str]]: verbose_proxy_logger.debug( f"Resolved model '{model}' to '{resolved_model}' from router" ) - custom_llm_provider = cast(Optional[str], litellm_params.get("custom_llm_provider")) - return cast(str, resolved_model), custom_llm_provider + custom_llm_provider = litellm_params.get("custom_llm_provider") + return str(resolved_model), str(custom_llm_provider) if custom_llm_provider is not None else None except Exception as e: verbose_proxy_logger.debug( f"Could not resolve model '{model}' from router: {e}" diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py index c5d610e639..8a2c5efc26 100644 --- a/litellm/types/llms/openai.py +++ b/litellm/types/llms/openai.py @@ -424,7 +424,7 @@ class CreateBatchRequest(TypedDict, total=False): endpoint: Literal["/v1/chat/completions", "/v1/embeddings", "/v1/completions"] input_file_id: str metadata: Optional[Dict[str, str]] - output_expires_after: Optional[FileExpiresAfter] + output_expires_after: FileExpiresAfter extra_headers: Optional[Dict[str, str]] extra_body: Optional[Dict[str, str]] timeout: Optional[float]