mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
fix(router): count only a boolean true supports_continuation when building a model group
This commit is contained in:
parent
6f61f99c85
commit
f6bd08f17c
2 changed files with 16 additions and 0 deletions
|
|
@ -13202,6 +13202,7 @@ class PythonCore(DeprecatedRouterMembers):
|
|||
"providers": [llm_provider],
|
||||
"description": model_group_description,
|
||||
**model_info,
|
||||
"supports_continuation": model_info.get("supports_continuation") is True,
|
||||
"supports_fast_mode": True,
|
||||
"supported_reasoning_efforts": None,
|
||||
"supported_endpoints": None,
|
||||
|
|
|
|||
|
|
@ -1527,6 +1527,21 @@ def test_set_model_group_info_reports_supports_continuation_when_any_deployment_
|
|||
assert plain is not None and plain.supports_continuation is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("value", ["maybe", "", ["x"], "true", 1])
|
||||
def test_set_model_group_info_counts_only_a_boolean_true_supports_continuation(value: object) -> None:
|
||||
router: Final = Router(
|
||||
model_list=[
|
||||
{
|
||||
"model_name": "long-decode",
|
||||
"litellm_params": {"model": "openai/gpt-4.1", "api_key": "fake"},
|
||||
"model_info": {"supports_continuation": value},
|
||||
},
|
||||
]
|
||||
)
|
||||
group: Final = router._set_model_group_info(model_group="long-decode", user_facing_model_group_name="long-decode")
|
||||
assert group is not None and group.supports_continuation is False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_response_headers(model_list):
|
||||
"""Test if the 'set_response_headers' function is working correctly"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue