MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _check_provider

Function _check_provider

uncommon_route/cli.py:798–812  ·  view source on GitHub ↗

Lightweight connectivity check for a provider endpoint.

(base_url: str, api_key: str)

Source from the content-addressed store, hash-verified

796
797
798async def _check_provider(base_url: str, api_key: str) -> bool:
799 """Lightweight connectivity check for a provider endpoint."""
800 import httpx
801 try:
802 async with httpx.AsyncClient(timeout=httpx.Timeout(5.0, connect=3.0)) as client:
803 resp = await client.get(
804 f"{base_url.rstrip('/')}/models",
805 headers={
806 "authorization": f"Bearer {api_key}",
807 "user-agent": "uncommon-route/provider-check",
808 },
809 )
810 return resp.status_code == 200
811 except Exception: # noqa: BLE001
812 return False
813
814
815def _cmd_logs(args: list[str]) -> None:

Callers 1

_cmd_doctorFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected