From 92763a14a9e164ca9dc0d7fa6a27489ca8c5cd40 Mon Sep 17 00:00:00 2001 From: Emerson Gomes Date: Tue, 16 Dec 2025 19:40:45 -0600 Subject: [PATCH] Update litellm/llms/azure_ai/rerank/transformation.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- litellm/llms/azure_ai/rerank/transformation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/litellm/llms/azure_ai/rerank/transformation.py b/litellm/llms/azure_ai/rerank/transformation.py index 085f36f74b8..376f4608260 100644 --- a/litellm/llms/azure_ai/rerank/transformation.py +++ b/litellm/llms/azure_ai/rerank/transformation.py @@ -38,8 +38,12 @@ class AzureAIRerankConfig(CohereRerankConfig): if normalized_path.endswith("/v1/rerank") or normalized_path.endswith("/v2/rerank"): return str(original_url.copy_with(path=normalized_path or "/")) - # If callers pass just the version path (e.g. ".../v2"), append "/rerank" - if normalized_path.endswith("/v1") or normalized_path.endswith("/v2"): + # If callers pass just the version path (e.g. ".../v2" or ".../providers/cohere/v2"), append "/rerank" + if ( + normalized_path.endswith("/v1") + or normalized_path.endswith("/v2") + or normalized_path.endswith("/providers/cohere/v2") + ): return _add_path_to_api_base( api_base=str(original_url.copy_with(path=normalized_path or "/")), ending_path="/rerank",