Skip to content

Interface: UseAgentChatOptions

agent: string

Agent name registered with the agents() plugin (e.g. "assistant", "helper"). Send-time payload includes this so the plugin routes the turn to the right AgentDefinition.


optional endpoint?: string

Override the chat endpoint. Default "/api/agents/chat" matches the route the agents plugin mounts under its prefix. Useful when the server mounts under a non-default base path or when proxying.


optional onEvent?: (event) => void

Called for every parsed SSE event before any state update. Use this to drive tool-call rows, approval cards, inspectors, or anything beyond the streaming text content. Errors thrown here are swallowed so a buggy handler can’t kill the stream.

AgentChatEvent

void