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

Method switch_to

python/copilot/generated/rpc.py:25668–25672  ·  view source on GitHub ↗

Switches the session to a model and optional reasoning configuration.\n\nArgs:\n params: Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.\n\nReturns:\n The model identifier active on the session after the switch.

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

Source from the content-addressed store, hash-verified

25666 return CurrentModel.from_dict(await self._client.request("session.model.getCurrent", {"sessionId": self._session_id}, **_timeout_kwargs(timeout)))
25667
25668 async def switch_to(self, params: ModelSwitchToRequest, *, timeout: float | None = None) -> ModelSwitchToResult:
25669 "Switches the session to a model and optional reasoning configuration.\n\nArgs:\n params: Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.\n\nReturns:\n The model identifier active on the session after the switch."
25670 params_dict: dict[str, Any] = {k: v for k, v in params.to_dict().items() if v is not None}
25671 params_dict["sessionId"] = self._session_id
25672 return ModelSwitchToResult.from_dict(await self._client.request("session.model.switchTo", params_dict, **_timeout_kwargs(timeout)))
25673
25674 async def set_reasoning_effort(self, params: ModelSetReasoningEffortRequest, *, timeout: float | None = None) -> ModelSetReasoningEffortResult:
25675 "Updates the session's reasoning effort without changing the selected model.\n\nArgs:\n params: Reasoning effort level to apply to the currently selected model.\n\nReturns:\n Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns."

Calls 4

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