pub struct SessionRpcModel<'a> { /* private fields */ }Expand description
session.model.* RPCs.
Implementations§
Source§impl<'a> SessionRpcModel<'a>
impl<'a> SessionRpcModel<'a>
Sourcepub async fn get_current(&self) -> Result<CurrentModel, Error>
pub async fn get_current(&self) -> Result<CurrentModel, Error>
Gets the currently selected model for the session.
Wire method: session.model.getCurrent.
§Returns
The currently selected model, reasoning effort, and context tier for the session. The context tier reflects Session.getContextTier(), restored from the session journal on resume.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn switch_to(
&self,
params: ModelSwitchToRequest,
) -> Result<ModelSwitchToResult, Error>
pub async fn switch_to( &self, params: ModelSwitchToRequest, ) -> Result<ModelSwitchToResult, Error>
Switches the session to a model and optional reasoning configuration.
Wire method: session.model.switchTo.
§Parameters
params- Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
§Returns
The model identifier active on the session after the switch.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn set_reasoning_effort(
&self,
params: ModelSetReasoningEffortRequest,
) -> Result<ModelSetReasoningEffortResult, Error>
pub async fn set_reasoning_effort( &self, params: ModelSetReasoningEffortRequest, ) -> Result<ModelSetReasoningEffortResult, Error>
Updates the session’s reasoning effort without changing the selected model.
Wire method: session.model.setReasoningEffort.
§Parameters
params- Reasoning effort level to apply to the currently selected model.
§Returns
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.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn list(&self) -> Result<SessionModelList, Error>
pub async fn list(&self) -> Result<SessionModelList, Error>
Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI’s available models rather than the caller’s.
Wire method: session.model.list.
§Returns
The list of models available to this session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn list_with_params(
&self,
params: ModelListRequest,
) -> Result<SessionModelList, Error>
pub async fn list_with_params( &self, params: ModelListRequest, ) -> Result<SessionModelList, Error>
Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI’s available models rather than the caller’s.
Wire method: session.model.list.
§Parameters
params- Optional listing options.
§Returns
The list of models available to this session.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcModel<'a>
impl<'a> Clone for SessionRpcModel<'a>
Source§fn clone(&self) -> SessionRpcModel<'a>
fn clone(&self) -> SessionRpcModel<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more