Class SessionModelApi

java.lang.Object
com.github.copilot.generated.rpc.SessionModelApi

@Generated("copilot-sdk-codegen") public final class SessionModelApi extends Object
API methods for the model namespace.
Since:
1.0.0
  • 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

      Switches the session to a model and optional reasoning configuration.

      Note: the sessionId field in the params record is overridden by the session-scoped wrapper; any value provided is ignored.

      Since:
      1.0.0
    • switchTo

      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

      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 sessionId field in the params record is overridden by the session-scoped wrapper; any value provided is ignored.

      Since:
      1.0.0
    • setAllowedModels

      Replaces or clears the host-supplied model allowlist for a running session.

      Note: the sessionId field in the params record is overridden by the session-scoped wrapper; any value provided is ignored.

      Since:
      1.0.0
    • setReasoningEffort

      Updates the session's reasoning effort without changing the selected model.

      Note: the sessionId field in the params record is overridden by the session-scoped wrapper; any value provided is ignored.

      Since:
      1.0.0
    • getReasoningSummaries

      Computes whether the session's current model shows reasoning summaries and how a host should present them: the default Ctrl+T visibility, reasoning headers, the hidden-summaries hint, and whether a persisted `showReasoning` setting is redundant. The runtime folds in the session's model catalog, selection and reasoning-summaries experiment assignment; the host supplies only its own persisted setting and current visibility. This method reads the session's resolved model catalog rather than resolving it, so call `session.model.list` first on a session that has not listed models or run a turn; until then the result is `ready: false`. A session that resolves models without a Copilot catalog, that is a BYOK registry or an alternate provider, never caches one and stays `ready: false`.

      Note: the sessionId field 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

      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 sessionId field in the params record is overridden by the session-scoped wrapper; any value provided is ignored.

      Since:
      1.0.0