mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
test_router_content_policy_fallbacks
This commit is contained in:
parent
cb35d5a844
commit
901cbf8adc
1 changed files with 6 additions and 6 deletions
|
|
@ -1139,9 +1139,9 @@ async def test_router_content_policy_fallbacks(
|
|||
router = Router(
|
||||
model_list=[
|
||||
{
|
||||
"model_name": "claude-2.1",
|
||||
"model_name": "claude-3-5-sonnet-latest",
|
||||
"litellm_params": {
|
||||
"model": "claude-2.1",
|
||||
"model": "anthropic/claude-3-5-sonnet-latest",
|
||||
"api_key": "",
|
||||
"mock_response": mock_response,
|
||||
},
|
||||
|
|
@ -1173,14 +1173,14 @@ async def test_router_content_policy_fallbacks(
|
|||
{
|
||||
"model_name": "my-context-window-model",
|
||||
"litellm_params": {
|
||||
"model": "claude-2.1",
|
||||
"model": "anthropic/claude-3-5-sonnet-latest",
|
||||
"api_key": "",
|
||||
"mock_response": Exception("Should not have called this."),
|
||||
},
|
||||
},
|
||||
],
|
||||
content_policy_fallbacks=(
|
||||
[{"claude-2.1": ["my-fallback-model"]}]
|
||||
[{"claude-3-5-sonnet-latest": ["my-fallback-model"]}]
|
||||
if fallback_type == "model-specific"
|
||||
else None
|
||||
),
|
||||
|
|
@ -1191,12 +1191,12 @@ async def test_router_content_policy_fallbacks(
|
|||
|
||||
if sync_mode is True:
|
||||
response = router.completion(
|
||||
model="claude-2.1",
|
||||
model="claude-3-5-sonnet-latest",
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}],
|
||||
)
|
||||
else:
|
||||
response = await router.acompletion(
|
||||
model="claude-2.1",
|
||||
model="claude-3-5-sonnet-latest",
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}],
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue