SessionsWebSocket class
WebSocket client for connecting to CCR sessions.
Protocol:
- Connect to
wss://api.anthropic.com/v1/sessions/ws/{sessionId}/subscribe - Authenticate via Bearer token in headers
- Receive SessionsMessage stream from the session
- Send control responses / requests back through the same connection
Constructors
- SessionsWebSocket(String _sessionId, String _orgUuid, String _getAccessToken(), SessionsWebSocketCallbacks _callbacks, {String baseWsUrl = 'wss://api.anthropic.com'})
- Create a new SessionsWebSocket.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Close the WebSocket connection permanently.
-
connect(
) → Future< void> - Connect to the sessions WebSocket endpoint.
-
isConnected(
) → bool - Whether the WebSocket is currently connected.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reconnect(
) → void - Force reconnect -- closes the existing connection and starts a new one.
-
sendControlRequest(
Map< String, dynamic> requestInner) → void - Send a control request to the session (e.g. interrupt).
-
sendControlResponse(
Map< String, dynamic> response) → void - Send a control response back to the session.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited