Skip to content

Commit

Permalink
Switch to api (#50)
Browse files Browse the repository at this point in the history
Supposedly the cloud armor rule will be removed as well but keeping the
placeholder for now
  • Loading branch information
hinthornw authored Nov 21, 2023
1 parent b59722e commit dfc6c57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions langchain_benchmarks/utils/_langsmith.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from langsmith.utils import LangSmithNotFoundError
from tqdm import auto

WEB_API_URL = "https://web.smith.langchain.com/"
API_URL = "https://api.smith.langchain.com/"


def _parse_token_or_url(url_or_token: str, api_url: str) -> Tuple[str, Optional[str]]:
Expand All @@ -25,7 +25,7 @@ def _parse_token_or_url(url_or_token: str, api_url: str) -> Tuple[str, Optional[
# Extract the UUID from the path
path_parts = parsed_url.path.split("/")
uuid = path_parts[-2] if len(path_parts) >= 2 else None
return WEB_API_URL, uuid
return API_URL, uuid


# PUBLIC API
Expand All @@ -35,7 +35,7 @@ def clone_public_dataset(
token_or_url: str,
*,
dataset_name: Optional[str] = None,
source_api_url: str = WEB_API_URL,
source_api_url: str = API_URL,
) -> None:
"""Clone a public dataset to your own langsmith tenant.
Expand Down Expand Up @@ -98,7 +98,7 @@ def download_public_dataset(
token_or_url: str,
*,
path: Optional[Union[str, Path]] = None,
api_url: str = WEB_API_URL,
api_url: str = API_URL,
) -> None:
"""Download a public dataset."""
api_url, uuid = _parse_token_or_url(token_or_url, api_url)
Expand Down

0 comments on commit dfc6c57

Please sign in to comment.