MCPcopy Create free account
hub / github.com/langchain-ai/deepagents / _normalize_endpoint

Function _normalize_endpoint

libs/cli/deepagents_cli/deploy/api_client.py:52–66  ·  view source on GitHub ↗
(endpoint: str)

Source from the content-addressed store, hash-verified

50
51
52def _normalize_endpoint(endpoint: str) -> str:
53 endpoint = endpoint.strip().rstrip("/")
54 parsed = urlsplit(endpoint)
55 if parsed.scheme != "https" or not parsed.netloc:
56 msg = "Error: LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT must be an HTTPS URL.\n"
57 sys.stderr.write(msg)
58 raise SystemExit(1)
59 if parsed.username or parsed.password:
60 msg = (
61 "Error: LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT must not include "
62 "userinfo.\n"
63 )
64 sys.stderr.write(msg)
65 raise SystemExit(1)
66 return endpoint
67
68
69class ApiClient:

Callers 1

from_envMethod · 0.85

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected