The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: cohere generate api is deprecated
Ishaan Jaffer09d63a00e2ff
diff --git a/litellm/litellm_core_utils/get_supported_openai_params.py b/litellm/litellm_core_utils/get_supported_openai_params.pyindex 86535943762..d77f53bd798 100644--- a/litellm/litellm_core_utils/get_supported_openai_params.py+++ b/litellm/litellm_core_utils/get_supported_openai_params.py@@ -94,9 +94,7 @@ def get_supported_openai_params( # noqa: PLR0915return litellm.VLLMConfig().get_supported_openai_params(model=model)elif custom_llm_provider == "deepseek":return litellm.DeepSeekChatConfig().get_supported_openai_params(model=model)- elif custom_llm_provider == "cohere":- return litellm.CohereConfig().get_supported_openai_params(model=model)- elif custom_llm_provider == "cohere_chat":+ elif custom_llm_provider == "cohere_chat" or custom_llm_provider == "cohere":return litellm.CohereChatConfig().get_supported_openai_params(model=model)elif custom_llm_provider == "maritalk":return litellm.MaritalkConfig().get_supported_openai_params(model=model)diff --git a/litellm/utils.py b/litellm/utils.pyindex 4456efc20d6..c37f3814b25 100644--- a/litellm/utils.py+++ b/litellm/utils.py@@ -524,8 +524,6 @@ def get_dynamic_callbacks(from litellm.litellm_core_utils.coroutine_checker import coroutine_checker--def function_setup( # noqa: PLR0915original_function: str, rules_obj, start_time, *args, **kwargs): # just run once to check if user wants to send their data anywhere - PostHog/Sentry/Slack/etc.@@ -3465,20 +3463,7 @@ def get_optional_params( # noqa: PLR0915),)- elif custom_llm_provider == "cohere":- ## check if unsupported param passed in- # handle cohere params- optional_params = litellm.CohereConfig().map_openai_params(- non_default_params=non_default_params,- optional_params=optional_params,- model=model,- drop_params=(- drop_params- if drop_params is not None and isinstance(drop_params, bool)- else False- ),- )- elif custom_llm_provider == "cohere_chat":+ elif custom_llm_provider == "cohere_chat" or custom_llm_provider == "cohere":# handle cohere paramsoptional_params = litellm.CohereChatConfig().map_openai_params(non_default_params=non_default_params,@@ -6903,10 +6888,8 @@ class ProviderConfigManager:return litellm.LlamaAPIConfig()elif litellm.LlmProviders.TEXT_COMPLETION_OPENAI == provider:return litellm.OpenAITextCompletionConfig()- elif litellm.LlmProviders.COHERE_CHAT == provider:+ elif litellm.LlmProviders.COHERE_CHAT == provider or litellm.LlmProviders.COHERE == provider:return litellm.CohereChatConfig()- elif litellm.LlmProviders.COHERE == provider:- return litellm.CohereConfig()elif litellm.LlmProviders.SNOWFLAKE == provider:return litellm.SnowflakeConfig()elif litellm.LlmProviders.CLARIFAI == provider: