MCPcopy Index your code
hub / github.com/github/copilot-sdk / add

Method add

python/copilot/generated/rpc.py:26145–26149  ·  view source on GitHub ↗

Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models

(self, params: ProviderAddRequest, *, timeout: float | None = None)

Source from the content-addressed store, hash-verified

26143 return ProviderEndpoint.from_dict(await self._client.request("session.provider.getEndpoint", params_dict, **_timeout_kwargs(timeout)))
26144
26145 async def add(self, params: ProviderAddRequest, *, timeout: float | None = None) -> ProviderAddResult:
26146 "Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards.\n\nArgs:\n params: BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.\n\nReturns:\n The selectable model entries synthesized for the models added by this call."
26147 params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None}
26148 params_dict["sessionId"] = self._session_id
26149 return ProviderAddResult.from_dict(await self._client.request("session.provider.add", params_dict, **_timeout_kwargs(timeout)))
26150
26151
26152# Experimental: this API group is experimental and may change or be removed.

Calls 4

_timeout_kwargsFunction · 0.85
to_dictMethod · 0.45
from_dictMethod · 0.45
requestMethod · 0.45