A reference to the structured chat resource.
API
interface StructuredChatResourceRef<Output, Tools extends Chat.AnyTool, State = unknown> extends Resource<Chat.Message<Output, Tools>[]> {generatingError: Signal <
Error | undefined
>;getRecoveryConfiguration(): ConversationRecoveryConfiguration;isGenerating: Signal <boolean>;isLoading: Signal <boolean>;isReceiving: Signal <boolean>;readonly isResuming: Signal<boolean>;isRunningToolCalls: Signal <boolean>;isSending: Signal <boolean>;lastAssistantMessage: Signal <
Chat.AssistantMessage <Output, Tools> | undefined
>;lastRunFinishReason: Signal <
FinishReason | undefined
>;lastRunResult: Signal <
JsonValue | undefined
>;lastRunUsage: Signal <
readonly TokenUsage [] | undefined
>;readonly pendingConversationRecovery: Signal<PendingConversationRecovery | undefined>;readonly pendingInterrupts: Signal<PendingInterruptBatch | undefined>;readonly recovery: Signal<ConversationRecoveryState>;reload: () => boolean;resendMessages: () => void;restoreConversation(snapshot: ConversationSnapshot<State>, options: ConversationRestoreOptions): void;resume(options: ResumeOptions): void;resumeConversationRecovery(options: ResumeConversationRecoveryOptions): void;sendingError: Signal <
Error | undefined
>;sendMessage: (message: Chat.UserMessageInput) => void;setMessages: (messages: Chat.MessageInput<Output, Tools>[]) => void;setState(state: State): void;readonly state: Signal<State | undefined>;stop: (clearStreamingMessage?: boolean) => void;readonly subagents: Signal<readonly SubagentRun$1[]>;}@typeOutput@typeToolsChat.AnyTool@typeStateSignal<Error | undefined>Error emitted during generation events.
Signal<boolean>Indicates whether the chat is generating assistant output.
Signal<boolean>Aggregate loading flag across transport, generation, and tool calls.
Signal<boolean>Whether the resource is currently receiving a response from the model.
Signal<boolean>Whether the resumed interaction is still running.
Signal<boolean>Whether the chat is running tool calls.
Signal<boolean>Indicates whether the underlying chat call is currently sending a message.
Signal<Chat.AssistantMessage<Output, Tools> | undefined>Signal<FinishReason | undefined>Why the model stopped in the last run that completed, such as length
when the answer was cut off by a token limit, or undefined when the
server did not say. Cleared when the next run starts.
Signal<JsonValue | undefined>The return value the agent attached to the last run that completed
(AG-UI's RUN_FINISHED.result), or undefined when it attached none.
Cleared when the next run starts. Interrupted, cancelled, and failed
runs never set it.
Signal<readonly TokenUsage[] | undefined>The token usage of the last run that completed (AG-UI's
RUN_FINISHED.usage), one entry per provider and model, or undefined
when the server reported none. Cleared when the next run starts, so a turn
that calls tools reports only its final run.
Signal<PendingConversationRecovery | undefined>The inert browser recovery batch awaiting explicit settlement.
Signal<PendingInterruptBatch | undefined>The complete pending interrupt batch, including while claimed.
Signal<ConversationRecoveryState>The local recovery revision and whether an explicit restore is required.
() => booleanRemove the last assistant response and re-send the previous user message. Returns true if a reload was performed.
() => voidCause current messages to be resent. Can be used after an error in chat.
Signal<Error | undefined>Transport/request error before generation events arrive.
(message: Chat.UserMessageInput) => voidSend a new user message to the chat.
(messages: Chat.MessageInput<Output, Tools>[]) => voidUpdate the chat messages.
Signal<State | undefined>The currently visible shared agent state.
(clearStreamingMessage?: boolean) => voidStops any currently-streaming message.
Signal<readonly SubagentRun$1[]>Observed native subagent invocations in the current conversation.