#[non_exhaustive]pub struct CapiSessionOptions {
pub auto_tier: Option<AutoTier>,
pub enable_web_socket_responses: Option<bool>,
}Expand description
Provider-scoped Copilot API (CAPI) session options.
WebSocket transport is the default for the CAPI Responses API whenever
the model advertises the ws:/responses endpoint. Set
enable_web_socket_responses to
false to force the HTTP Responses transport instead, which is useful
for users behind proxies where WebSockets fail.
Setting it to false is equivalent to setting the
COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES environment variable. The option
is scoped under the capi namespace because a single session can host
multiple providers, so transport choice is provider-level.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.auto_tier: Option<AutoTier>Routing tier, meaningful only with model auto (Auto mode V2).
Requires a runtime version that supports capi.autoTier.
When omitted, the runtime chooses its default on create and restores the last committed tier on cold resume. On resident resume, a different tier requests a safe switch that takes effect after resume succeeds and never disturbs a turn that is already running.
To change the preference on a live session, use
Session::set_auto_tier.
enable_web_socket_responses: Option<bool>Whether to use WebSocket transport for CAPI Responses API calls.
When Some(false), the runtime uses HTTP Responses transport even if
the selected model advertises ws:/responses. When unset, the runtime
default applies (WebSocket transport when advertised).
Implementations§
Source§impl CapiSessionOptions
impl CapiSessionOptions
Sourcepub fn with_auto_tier(self, auto_tier: AutoTier) -> Self
pub fn with_auto_tier(self, auto_tier: AutoTier) -> Self
Set the routing tier for the auto model (Auto mode V2).
Sourcepub fn with_enable_web_socket_responses(self, enable: bool) -> Self
pub fn with_enable_web_socket_responses(self, enable: bool) -> Self
Set whether to use WebSocket transport for CAPI Responses API calls.
Trait Implementations§
Source§impl Clone for CapiSessionOptions
impl Clone for CapiSessionOptions
Source§fn clone(&self) -> CapiSessionOptions
fn clone(&self) -> CapiSessionOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more