Skip to content

Commit

Permalink
Merge pull request #97 from langchain-ai/raspawar/fix_failing_tests
Browse files Browse the repository at this point in the history
fix failing test cases for base url
  • Loading branch information
raspawar authored Aug 29, 2024
2 parents af64b4c + fc6b913 commit 7427e0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Tuple,
Union,
)
from urllib.parse import urlparse
from urllib.parse import urlparse, urlunparse

import requests
from langchain_core.pydantic_v1 import (
Expand Down Expand Up @@ -138,7 +138,9 @@ def _preprocess_args(cls, values: Dict[str, Any]) -> Dict[str, Any]:
):
warnings.warn(f"Using {base_url}, ignoring the rest")

values["base_url"] = base_url
values["base_url"] = base_url = urlunparse(
(parsed.scheme, parsed.netloc, "v1", None, None, None)
)
values["infer_path"] = values["infer_path"].format(base_url=base_url)

return values
Expand Down

0 comments on commit 7427e0b

Please sign in to comment.