chore: ruff format and import order

This commit is contained in:
Paolo Antinori 2026-09-18 17:19:38 +02:00
parent bde1fb662c
commit f9a1359ca2
No known key found for this signature in database
3 changed files with 5 additions and 14 deletions

View file

@ -62,7 +62,6 @@ from litellm.types.llms.openai import (
ChatCompletionToolCallChunk,
ChatCompletionToolCallFunctionChunk,
ChatCompletionToolParam,
OpenAIChatCompletionFinishReason,
OpenAIMcpServerTool,
OpenAIWebSearchOptions,
)
@ -74,9 +73,9 @@ from litellm.types.responses.main import (
from litellm.types.utils import (
CacheCreationTokenDetails,
CompletionTokensDetailsWrapper,
map_finish_reason_and_stash_native,
PromptTokensDetailsWrapper,
ServerToolUse,
map_finish_reason_and_stash_native,
)
from litellm.types.utils import Message as LitellmMessage
from litellm.utils import (

View file

@ -8731,9 +8731,7 @@ class Router:
model_info if isinstance(model_info, dict) else None, litellm_params, key="cooldown_time"
)
time_to_cooldown: Final = (
deployment_cooldown
if deployment_cooldown is not None and deployment_cooldown >= 0
else self.cooldown_time
deployment_cooldown if deployment_cooldown is not None and deployment_cooldown >= 0 else self.cooldown_time
)
exception: Final = self._finish_reason_failure_error(model=model, reason=reason)
increment_deployment_failures_for_current_minute(

View file

@ -100,9 +100,7 @@ async def test_chat_completion_mapped_reason_falls_back_and_cools_down(monkeypat
)
fake.install(monkeypatch)
response = await router.acompletion(
model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}]
)
response = await router.acompletion(model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}])
assert response.model == "claude-opus-5"
assert len(fake.calls) == 2
@ -148,9 +146,7 @@ async def test_mapped_reason_without_fallback_returns_response_and_counts_failur
)
fake.install(monkeypatch)
response = await router.acompletion(
model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}]
)
response = await router.acompletion(model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}])
assert response.model == "claude-fable-5"
assert len(fake.calls) == 1
@ -166,9 +162,7 @@ async def test_knob_unset_ignores_terminal_stop_reason(monkeypatch: MonkeyPatch)
router = Router(model_list=[FABLE_TIER], num_retries=0)
fake.install(monkeypatch)
response = await router.acompletion(
model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}]
)
response = await router.acompletion(model="fable-tier", max_tokens=16, messages=[{"role": "user", "content": "hi"}])
assert response.model == "claude-fable-5"
assert len(fake.calls) == 1