Class CapiSessionOptions
WebSocket transport is the default for the CAPI Responses API whenever the
model advertises the ws:/responses endpoint. Setting
setEnableWebSocketResponses(Boolean) to false forces the
HTTP Responses transport instead, which is useful for users behind proxies
where WebSockets fail. This is equivalent to setting the
COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES environment variable.
These options are scoped under the capi namespace because a single
session can host multiple providers (for example, CAPI and BYOK), so
transport choice is provider-level rather than top-level session state. All
setter methods return this for method chaining.
- Since:
- 1.5.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the routing tier for theautomodel (Auto mode V2).Gets whether CAPI Responses API WebSocket transport is enabled.setAutoTier(AutoTier autoTier) Sets the routing tier, meaningful only with modelauto(Auto mode V2).setEnableWebSocketResponses(Boolean enableWebSocketResponses) Sets whether to use CAPI Responses API WebSocket transport.
-
Constructor Details
-
CapiSessionOptions
public CapiSessionOptions()
-
-
Method Details
-
getAutoTier
Gets the routing tier for theautomodel (Auto mode V2).- Returns:
- the explicit tier, or
nullto leave tier selection to the runtime
-
setAutoTier
Sets the routing tier, meaningful only with modelauto(Auto mode V2). Requires a runtime version that supportscapi.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. On resident resume, a different tier requests a safe switch that the runtime applies after the resume succeeds; it cannot change a turn that is already in flight.
- Parameters:
autoTier- the routing tier, ornullto omit it from the request- Returns:
- this config for method chaining
-
getEnableWebSocketResponses
Gets whether CAPI Responses API WebSocket transport is enabled.- Returns:
falseto force the HTTP Responses transport,trueto explicitly use WebSocket transport, ornullto use the default behavior
-
setEnableWebSocketResponses
Sets whether to use CAPI Responses API WebSocket transport.WebSocket transport is the default for the CAPI Responses API whenever the model advertises the
ws:/responsesendpoint. Set this tofalseto force the HTTP Responses transport instead, which is useful for users behind proxies where WebSockets fail. This is equivalent to setting theCOPILOT_CLI_DISABLE_WEBSOCKET_RESPONSESenvironment variable.- Parameters:
enableWebSocketResponses-falseto force the HTTP Responses transport- Returns:
- this config for method chaining
-