Skip to content

@sqlrooms/ai-core / useSessionChat

Function: useSessionChat() ​

useSessionChat(sessionId): UseSessionChatResult

Subscribe to the AI SDK chat owned by a session runtime.

The AI slice owns the runtime lifecycle, so a session can keep running without a mounted React component. This hook only bridges its chat into React.

Parameters ​

ParameterTypeDescription
sessionIdstringThe ID of the session to observe.

Returns ​

UseSessionChatResult

Messages and imperative chat methods for the session.