Skip to content

Interface: UseAgentChatResult

content: string

Accumulated assistant text from response.output_text.delta events.


error: string | null

Last error message (cleared on next successful send()).


events: AgentChatEvent[]

Every parsed event, in order. Provided for components that need to render historical tool calls or replay state after a remount — lighter than re-deriving from message history. For one-off side effects prefer UseAgentChatOptions.onEvent.


isStreaming: boolean

True while an SSE stream is open.


reset: () => void

Discard accumulated content, events, and threadId. Aborts any in-flight stream. Use when switching agents or starting a fresh conversation.

void


send: (message, opts?) => Promise<void>

Send a user turn and stream the response. Aborts any in-flight stream. Resolves when the stream completes (success or error).

Pass opts.skill to force-load a skill for this turn, or prefix the message with /skill-name as sugar — the leading token is parsed off and sent as the skill only when it matches a name in options.skills (the rest becomes the message); otherwise the message is sent as-is. An explicit opts.skill always wins over a /-prefix.

string

string

Promise<void>


threadId: string | null

Thread id captured from the first appkit.metadata event of the stream. Subsequent send() calls automatically forward this so the server reuses the same thread.