Class SessionModelApi
model namespace.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionGets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.list()Lists models available to this session using its own auth and integration context.list(SessionModelListParams params) Lists models available to this session using its own auth and integration context.Replaces or clears the host-supplied model allowlist for a running session.Updates the session's reasoning effort without changing the selected model.Requests an Auto preference change without changing the session's selected model.switchTo(SessionModelSwitchToParams params) Switches the session to a model and optional reasoning configuration.switchTo(SessionModelSwitchToRequest request) Switches the session to a model and optional reasoning configuration.
-
Method Details
-
getCurrent
Gets the session's authoritative model snapshot, including the committed Auto preference and any newer unclaimed Auto preference waiting for a future user turn.- Since:
- 1.0.0
-
switchTo
@CopilotExperimental public CompletableFuture<SessionModelSwitchToResult> switchTo(SessionModelSwitchToParams params) Switches the session to a model and optional reasoning configuration.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
switchTo
@CopilotExperimental public CompletableFuture<SessionModelSwitchToResult> switchTo(SessionModelSwitchToRequest request) Switches the session to a model and optional reasoning configuration.Accepts the extensible request, including inputs added after the params record.
- Since:
- 1.0.0
-
switchAutoTier
@CopilotExperimental public CompletableFuture<SessionModelSwitchAutoTierResult> switchAutoTier(SessionModelSwitchAutoTierParams params) Requests an Auto preference change without changing the session's selected model. The latest unclaimed request wins; the runtime commits it only after a later prompt using the `auto` model mints a usable model and token pair. A `pending` response confirms that the request was accepted, not that it committed. Observe eventual success through `session.model_change`, failure through the ephemeral `session.auto_tier_switch_failed` event, or current unclaimed state through `session.model.getCurrent`.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setAllowedModels
@CopilotExperimental public CompletableFuture<SessionModelSetAllowedModelsResult> setAllowedModels(SessionModelSetAllowedModelsParams params) Replaces or clears the host-supplied model allowlist for a running session.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
setReasoningEffort
@CopilotExperimental public CompletableFuture<SessionModelSetReasoningEffortResult> setReasoningEffort(SessionModelSetReasoningEffortParams params) Updates the session's reasoning effort without changing the selected model.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-
list
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.Invokes the method with no params, applying the runtime defaults.
- Since:
- 1.0.0
-
list
@CopilotExperimental public CompletableFuture<SessionModelListResult> list(SessionModelListParams params) 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.Note: the
sessionIdfield in the params record is overridden by the session-scoped wrapper; any value provided is ignored.- Since:
- 1.0.0
-