fix get llm provider logic

This commit is contained in:
Ishaan Jaff 2024-09-04 09:28:23 -07:00
parent 9ed4dad5ac
commit 4599a0ffd3

View file

@ -55,13 +55,15 @@ def handle_cohere_chat_model_custom_llm_provider(
if custom_llm_provider == "cohere" and model in litellm.cohere_chat_models:
return model, "cohere_chat"
_custom_llm_provider, _model = model.split("/", 1)
if (
_custom_llm_provider
and _custom_llm_provider == "cohere"
and _model in litellm.cohere_chat_models
):
return _model, "cohere_chat"
if "/" in model:
_custom_llm_provider, _model = model.split("/", 1)
if (
_custom_llm_provider
and _custom_llm_provider == "cohere"
and _model in litellm.cohere_chat_models
):
return _model, "cohere_chat"
return model, custom_llm_provider