#[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 preserves the persisted or current tier on resume. An explicit tier overrides the persisted tier on cold resume; the runtime rejects a conflicting tier when resuming a session already resident in memory.
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