Interface: UseAgentChatOptions
Properties
Section titled “Properties”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.
endpoint?
Section titled “endpoint?”
optionalendpoint?: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.
onEvent?
Section titled “onEvent?”
optionalonEvent?: (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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void