UseAIAgentsWebSocketOptions
Agent Runtimes / hooks/useAIAgentsWebSocket / UseAIAgentsWebSocketOptions
Interface: UseAIAgentsWebSocketOptions
Defined in: hooks/useAIAgentsWebSocket.ts:64
Options for the WebSocket hook.
Properties
autoReconnect?
optionalautoReconnect?:boolean
Defined in: hooks/useAIAgentsWebSocket.ts:74
Auto-reconnect on unexpected disconnects.
baseUrl?
optionalbaseUrl?:string
Defined in: hooks/useAIAgentsWebSocket.ts:68
Override the service base URL (defaults to aiagentsRunUrl).
channels?
optionalchannels?:string[]
Defined in: hooks/useAIAgentsWebSocket.ts:80
Additional channels to subscribe to beyond the auto-subscribed user channel.
enabled?
optionalenabled?:boolean
Defined in: hooks/useAIAgentsWebSocket.ts:66
Enable/disable the socket lifecycle.
maxReconnectAttempts?
optionalmaxReconnectAttempts?:number
Defined in: hooks/useAIAgentsWebSocket.ts:76
Max reconnect attempts before giving up (unbounded by default).
onClose?
optionalonClose?: (info) =>void
Defined in: hooks/useAIAgentsWebSocket.ts:86
Called when the socket closes.
Parameters
info
Returns
void
onMessage?
optionalonMessage?: (msg) =>void
Defined in: hooks/useAIAgentsWebSocket.ts:84
Called for every incoming message (optional).
Parameters
msg
WSMessage
Returns
void
onOpen?
optionalonOpen?: () =>void
Defined in: hooks/useAIAgentsWebSocket.ts:82
Called when the socket opens.
Returns
void
path?
optionalpath?:string
Defined in: hooks/useAIAgentsWebSocket.ts:70
WebSocket path (or full http/https URL) for the stream endpoint.
queryParams?
optionalqueryParams?:Record<string,string|number|boolean|null|undefined>
Defined in: hooks/useAIAgentsWebSocket.ts:72
Query string parameters to append to the WebSocket URL.
reconnectDelayMs?
optionalreconnectDelayMs?:number| ((attempt) =>number)
Defined in: hooks/useAIAgentsWebSocket.ts:78
Reconnect delay strategy (ms) or static delay in ms.