Fetch messages from the backend. Pass false or omit to reload from
the beginning, true to load the next page of older messages.
Optionalcontinuation: booleanReturn the current list of messages.
Subscribe to chat state changes. Returns an unsubscribe function. No-op on a by-ID chat — subscribe before calling sendMessage and read getMessages() after the returned Promise resolves instead.
Send a message and receive a reply.
Run the local tool for the last assistant action and send its observation. Throws if the last message does not contain an action.
Send a message and automatically resolve tool actions until the response is complete.
Register a tool for this chat. Returns a function that removes this registration.
Public interface for interacting with a chat session.