mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Merge ffff38a342 into 7bc80994b7
This commit is contained in:
commit
fc17f5d034
4 changed files with 21 additions and 0 deletions
|
|
@ -10890,6 +10890,7 @@ class Router:
|
|||
"allowed_fails",
|
||||
"cooldown_time",
|
||||
"num_retries",
|
||||
"max_fallbacks",
|
||||
"timeout",
|
||||
"max_retries",
|
||||
"retry_after",
|
||||
|
|
@ -10928,6 +10929,7 @@ class Router:
|
|||
"allowed_fails",
|
||||
"cooldown_time",
|
||||
"num_retries",
|
||||
"max_fallbacks",
|
||||
"timeout",
|
||||
"max_retries",
|
||||
"retry_after",
|
||||
|
|
@ -10944,6 +10946,7 @@ class Router:
|
|||
_int_settings: Final = [
|
||||
"timeout",
|
||||
"num_retries",
|
||||
"max_fallbacks",
|
||||
"retry_after",
|
||||
"allowed_fails",
|
||||
"cooldown_time",
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ class UpdateRouterConfig(BaseModel):
|
|||
allowed_fails: int | None = None
|
||||
cooldown_time: float | None = None
|
||||
num_retries: int | None = None
|
||||
max_fallbacks: int | None = None
|
||||
timeout: float | None = None
|
||||
max_retries: int | None = None
|
||||
retry_after: float | None = None
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ def test_update_router_config_exposes_retry_policy_field():
|
|||
assert "retry_policy" in UpdateRouterConfig.model_fields
|
||||
|
||||
|
||||
def test_update_router_config_preserves_max_fallbacks():
|
||||
value = 10
|
||||
config = UpdateRouterConfig(max_fallbacks=value)
|
||||
|
||||
assert config.model_dump(exclude_none=True)["max_fallbacks"] == value
|
||||
|
||||
|
||||
def test_update_router_config_accepts_retry_policy_payload():
|
||||
"""The exact payload the Admin UI Model Retry Settings tab sends must
|
||||
round-trip through the schema's ``dict(exclude_none=True)`` form, since
|
||||
|
|
@ -122,6 +129,14 @@ def test_update_settings_persists_retry_policy_dict():
|
|||
assert router.retry_policy.TimeoutErrorRetries == 3
|
||||
|
||||
|
||||
def test_update_settings_applies_max_fallbacks():
|
||||
router = _build_router()
|
||||
|
||||
router.update_settings(max_fallbacks=10)
|
||||
|
||||
assert router.max_fallbacks == 10
|
||||
|
||||
|
||||
def test_update_settings_accepts_retry_policy_object_unchanged():
|
||||
"""A pre-built ``RetryPolicy`` instance must pass through verbatim so
|
||||
callers that already constructed one (e.g. tests or programmatic
|
||||
|
|
|
|||
2
ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
2
ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
|
|
@ -35338,6 +35338,8 @@ export interface components {
|
|||
fallbacks?: {
|
||||
[key: string]: unknown;
|
||||
}[] | null;
|
||||
/** Max Fallbacks */
|
||||
max_fallbacks?: number | null;
|
||||
/** Max Retries */
|
||||
max_retries?: number | null;
|
||||
/** Model Group Affinity Config */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue