Class SessionModelSwitchToRequest

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

@CopilotExperimental @Generated("copilot-sdk-codegen") public final class SessionModelSwitchToRequest extends Object
Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.

Required inputs are constructor arguments. Optional inputs have fluent setters.

Since:
1.0.0
  • Constructor Details

    • SessionModelSwitchToRequest

      public SessionModelSwitchToRequest(String modelId)
      Creates a request with its required inputs.
      Parameters:
      modelId - Model id to switch to, as returned by `list`. Include providerId to select an exact catalog entry when providers share the id. Without providerId, a bare id retains incumbent selection behavior; a registry-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a BYOK model.
  • Method Details

    • getModelId

      public String getModelId()
      Returns the modelId property.
      Returns:
      Model id to switch to, as returned by `list`. Include providerId to select an exact catalog entry when providers share the id. Without providerId, a bare id retains incumbent selection behavior; a registry-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a BYOK model.
    • getAutoTier

      public AutoTier getAutoTier()
      Returns the autoTier property.
      Returns:
      Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`.
    • getReasoningEffort

      public String getReasoningEffort()
      Returns the reasoningEffort property.
      Returns:
      Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. Pass null to clear any session effort override and fall back to the model's default. When omitted, the session's current effort is kept.
    • getReasoningSummary

      public ReasoningSummary getReasoningSummary()
      Returns the reasoningSummary property.
      Returns:
      Reasoning summary mode to request for supported model clients
    • getVerbosity

      public Verbosity getVerbosity()
      Returns the verbosity property.
      Returns:
      Output verbosity level to request for supported models
    • getModelCapabilities

      public ModelCapabilitiesOverride getModelCapabilities()
      Returns the modelCapabilities property.
      Returns:
      Override individual model capabilities resolved by the runtime
    • getContextTier

      public ContextTier getContextTier()
      Returns the contextTier property.
      Returns:
      Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier.
    • getSource

      public ModelChangeSource getSource()
      Returns the source property.
      Returns:
      Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value.
    • getDeferIfModelChangeQueued

      public Boolean getDeferIfModelChangeQueued()
      Returns the deferIfModelChangeQueued property.
      Returns:
      When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active).
    • getCompactionDecision

      public String getCompactionDecision()
      Returns the compactionDecision property.
      Returns:
      Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary.
    • getRunCompactionPreflight

      public Boolean getRunCompactionPreflight()
      Returns the runCompactionPreflight property.
      Returns:
      When true, evaluate context-window compaction policy before applying the switch.
    • getRepoScope

      public String getRepoScope()
      Returns the repoScope property.
      Returns:
      Optional repository settings scope to persist after the switch commits.
    • getModelChangeScope

      public String getModelChangeScope()
      Returns the modelChangeScope property.
      Returns:
      Settings scope used when persisting the selected model.
    • getRequireAvailable

      public Boolean getRequireAvailable()
      Returns the requireAvailable property.
      Returns:
      Require the target to be currently available and enabled before applying the switch.
    • getPickerPersistence

      public ModelPickerPersistenceRequest getPickerPersistence()
      Returns the pickerPersistence property.
      Returns:
      Optional settings context and explicit-override flags used to persist a picker selection.
    • getProviderId

      public String getProviderId()
      Returns the providerId property.
      Returns:
      Provider id from the selected list entry's provider reference. Selects this exact provider/model pair; an unavailable pair fails rather than using another provider. Omit for deterministic legacy bare-model selection.
    • setAutoTier

      public SessionModelSwitchToRequest setAutoTier(AutoTier value)
      Sets the autoTier property.
      Parameters:
      value - Optional Auto routing preference to stage atomically with selecting `auto`. Pass null to return to provider-default Auto routing. This field is rejected when `modelId` is not `auto`.
      Returns:
      this request
    • setReasoningEffort

      public SessionModelSwitchToRequest setReasoningEffort(String value)
      Sets the reasoningEffort property.
      Parameters:
      value - Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. "none" disables reasoning. Pass null to clear any session effort override and fall back to the model's default. When omitted, the session's current effort is kept.
      Returns:
      this request
    • setReasoningSummary

      public SessionModelSwitchToRequest setReasoningSummary(ReasoningSummary value)
      Sets the reasoningSummary property.
      Parameters:
      value - Reasoning summary mode to request for supported model clients
      Returns:
      this request
    • setVerbosity

      public SessionModelSwitchToRequest setVerbosity(Verbosity value)
      Sets the verbosity property.
      Parameters:
      value - Output verbosity level to request for supported models
      Returns:
      this request
    • setModelCapabilities

      public SessionModelSwitchToRequest setModelCapabilities(ModelCapabilitiesOverride value)
      Sets the modelCapabilities property.
      Parameters:
      value - Override individual model capabilities resolved by the runtime
      Returns:
      this request
    • setContextTier

      public SessionModelSwitchToRequest setContextTier(ContextTier value)
      Sets the contextTier property.
      Parameters:
      value - Explicit context tier for the selected model. `"default"` / `"long_context"` apply the requested tier; omit this field to use normal model behavior with no explicit tier.
      Returns:
      this request
    • setSource

      Sets the source property.
      Parameters:
      value - Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value.
      Returns:
      this request
    • setDeferIfModelChangeQueued

      public SessionModelSwitchToRequest setDeferIfModelChangeQueued(Boolean value)
      Sets the deferIfModelChangeQueued property.
      Parameters:
      value - When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active).
      Returns:
      this request
    • setCompactionDecision

      public SessionModelSwitchToRequest setCompactionDecision(String value)
      Sets the compactionDecision property.
      Parameters:
      value - Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary.
      Returns:
      this request
    • setRunCompactionPreflight

      public SessionModelSwitchToRequest setRunCompactionPreflight(Boolean value)
      Sets the runCompactionPreflight property.
      Parameters:
      value - When true, evaluate context-window compaction policy before applying the switch.
      Returns:
      this request
    • setRepoScope

      public SessionModelSwitchToRequest setRepoScope(String value)
      Sets the repoScope property.
      Parameters:
      value - Optional repository settings scope to persist after the switch commits.
      Returns:
      this request
    • setModelChangeScope

      public SessionModelSwitchToRequest setModelChangeScope(String value)
      Sets the modelChangeScope property.
      Parameters:
      value - Settings scope used when persisting the selected model.
      Returns:
      this request
    • setRequireAvailable

      public SessionModelSwitchToRequest setRequireAvailable(Boolean value)
      Sets the requireAvailable property.
      Parameters:
      value - Require the target to be currently available and enabled before applying the switch.
      Returns:
      this request
    • setPickerPersistence

      public SessionModelSwitchToRequest setPickerPersistence(ModelPickerPersistenceRequest value)
      Sets the pickerPersistence property.
      Parameters:
      value - Optional settings context and explicit-override flags used to persist a picker selection.
      Returns:
      this request
    • setProviderId

      public SessionModelSwitchToRequest setProviderId(String value)
      Sets the providerId property.
      Parameters:
      value - Provider id from the selected list entry's provider reference. Selects this exact provider/model pair; an unavailable pair fails rather than using another provider. Omit for deterministic legacy bare-model selection.
      Returns:
      this request