mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +00:00
test(together_ai): assert fail-open supported params for models missing from the registry
This commit is contained in:
parent
cd63c7e5a7
commit
bcb6a0a998
1 changed files with 6 additions and 14 deletions
|
|
@ -23,26 +23,18 @@ class TestTogetherAI(BaseLLMChatTest):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"model, expected_bool",
|
"model",
|
||||||
[
|
[
|
||||||
("meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo", True),
|
"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
|
||||||
("nvidia/Llama-3.1-Nemotron-70B-Instruct-HF", False),
|
"nvidia/Llama-3.1-Nemotron-70B-Instruct-HF",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_get_supported_response_format_together_ai(
|
def test_get_supported_response_format_together_ai(self, model: str) -> None:
|
||||||
self, model: str, expected_bool: bool
|
|
||||||
) -> None:
|
|
||||||
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
|
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
|
||||||
litellm.model_cost = litellm.get_model_cost_map(url="")
|
litellm.model_cost = litellm.get_model_cost_map(url="")
|
||||||
optional_params = litellm.get_supported_openai_params(
|
optional_params = litellm.get_supported_openai_params(
|
||||||
model, custom_llm_provider="together_ai"
|
model, custom_llm_provider="together_ai"
|
||||||
)
|
)
|
||||||
# Mapped provider
|
|
||||||
assert isinstance(optional_params, list)
|
assert isinstance(optional_params, list)
|
||||||
|
assert "response_format" in optional_params
|
||||||
if expected_bool:
|
assert "tools" in optional_params
|
||||||
assert "response_format" in optional_params
|
|
||||||
assert "tools" in optional_params
|
|
||||||
else:
|
|
||||||
assert "response_format" not in optional_params
|
|
||||||
assert "tools" not in optional_params
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue