Skip to content

Commit

Permalink
add reranker test case and url
Browse files Browse the repository at this point in the history
  • Loading branch information
raspawar committed Aug 27, 2024
1 parent 8ea0de7 commit d315b11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/ai-endpoints/langchain_nvidia_ai_endpoints/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def _preprocess_args(cls, values: Dict[str, Any]) -> Dict[str, Any]:
f"Invalid base_url format. {expected_format} Got: {base_url}"
)

if base_url.endswith(("/embeddings", "/completions", "/rankings")):
if base_url.endswith(
("/embeddings", "/completions", "/rankings", "/reranking")
):
warnings.warn(f"Using {base_url}, ignoring the rest")

values["base_url"] = base_url
Expand Down
1 change: 1 addition & 0 deletions libs/ai-endpoints/tests/unit_tests/test_base_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def test_param_base_url_hosted(public_class: type, base_url: str) -> None:
"http://localhost:8888",
"http://0.0.0.0:8888/v1",
"http://0.0.0.0:8888/v1/",
"http://blah/some/other/path/v1",
],
)
def test_param_base_url_not_hosted(public_class: type, base_url: str) -> None:
Expand Down

0 comments on commit d315b11

Please sign in to comment.