The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(tests): type the model router spend log kwargs helper
milan57b367c78e6f
diff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.pyindex b1a45fb84a3..9c97b2683b2 100644--- a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py+++ b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py@@ -6,6 +6,8 @@ import sysfrom datetime import timezonefrom typing import Any, Final, cast+from typing_extensions import ReadOnly, TypedDict+import pytestfrom fastapi.testclient import TestClient@@ -3243,7 +3245,13 @@ def test_get_logging_payload_failed_request_without_standard_logging_payload_leaassert payload["custom_llm_provider"] == ""-def _model_router_spend_log_kwargs(slp_model: str | None) -> dict[str, Any]:+class _ModelRouterSpendLogKwargs(TypedDict):+ model: ReadOnly[str]+ litellm_params: ReadOnly[dict[str, dict[str, str]]]+ standard_logging_object: ReadOnly[StandardLoggingPayload]+++def _model_router_spend_log_kwargs(slp_model: str | None) -> _ModelRouterSpendLogKwargs:standard_logging_payload: Final = cast(StandardLoggingPayload,{