mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
Update litellm/llms/azure_ai/rerank/transformation.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
c4dd22c079
commit
92763a14a9
1 changed files with 6 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue