mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
chore: ruff format and import order
This commit is contained in:
parent
bde1fb662c
commit
f9a1359ca2
3 changed files with 5 additions and 14 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue