mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Merge 71007e0f0e into 30ff3723b2
This commit is contained in:
commit
3cb363d4cc
2 changed files with 13 additions and 1 deletions
|
|
@ -218,7 +218,7 @@ def get_llm_provider(
|
|||
dynamic_api_key=dynamic_api_key,
|
||||
litellm_params=litellm_params,
|
||||
)
|
||||
elif model.split("/", 1)[0] in litellm.provider_list:
|
||||
elif model.split("/", 1)[0] in litellm.provider_list and len(model.split("/")) > 1:
|
||||
custom_llm_provider = model.split("/", 1)[0]
|
||||
model = model.split("/", 1)[1]
|
||||
if api_base is not None and not isinstance(api_base, str):
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
import pytest
|
||||
|
||||
import litellm
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", ["mistral", "openai", "anthropic", "groq", "deepseek"])
|
||||
def test_get_llm_provider_bare_provider_name_raises_helpful_error(model):
|
||||
with pytest.raises(litellm.BadRequestError) as exc_info:
|
||||
litellm.get_llm_provider(model=model)
|
||||
message = str(exc_info.value)
|
||||
assert "LLM Provider NOT provided" in message
|
||||
assert "list index out of range" not in message
|
||||
Loading…
Add table
Reference in a new issue