MCPcopy Create free account
hub / github.com/BitterSecurity/Decepticon / _api_base

Function _api_base

config/copilot_handler.py:254–266  ·  view source on GitHub ↗

Resolve the Copilot chat API base URL. The mint response sometimes carries an ``endpoints.api`` override (e.g. enterprise tenants on a custom endpoint). Honor it when present; otherwise default to the public api.githubcopilot.com.

()

Source from the content-addressed store, hash-verified

252
253
254def _api_base() -> str:
255 """Resolve the Copilot chat API base URL.
256
257 The mint response sometimes carries an ``endpoints.api`` override
258 (e.g. enterprise tenants on a custom endpoint). Honor it when
259 present; otherwise default to the public api.githubcopilot.com.
260 """
261 endpoints = _token_cache.get("endpoints") or {}
262 if isinstance(endpoints, dict):
263 url = endpoints.get("api") or ""
264 if isinstance(url, str) and url.strip():
265 return url.strip()
266 return GITHUB_COPILOT_API_BASE
267
268
269def _upstream_model_slug(model: str) -> str:

Callers 1

_sendMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected