A reference to the UI chat resource.
API
interface UiChatResourceRef<Tools extends Chat.AnyTool, State = unknown> extends Resource<UiChatMessage<Tools>[]> {readonly components: Signal<UiKitInput<ExposedComponent<any>>[]>;getRecoveryConfiguration(): ConversationRecoveryConfiguration;readonly isResuming: Signal<boolean>;lastAssistantMessage: Signal <
UiAssistantMessage <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;sendMessage: (message: Chat.UserMessageInput) => void;setComponents(components: UiKitInput<ExposedComponent<any>>[]): void;setMessages: (messages: Chat.MessageInput<s.Infer<UiChatMessageOutput>, Tools>[]) => void;setState(state: State): void;readonly state: Signal<State | undefined>;stop: (clearStreamingMessage?: boolean) => void;readonly subagents: Signal<readonly SubagentRun$1[]>;}@typeToolsChat.AnyTool@typeStateSignal<UiKitInput<ExposedComponent<any>>[]>The components offered to the model on the next request: the
components option until setComponents replaces them.
Signal<boolean>Whether the resumed interaction is still running.
Signal<UiAssistantMessage<Tools> | undefined>The last assistant message for the UI chat resource.
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 resend the preceding history.
() => voidCause current messages to be resent. Can be used after an error in chat.
(message: Chat.UserMessageInput) => voidSend a new user message to the chat.
(messages: Chat.MessageInput<s.Infer<UiChatMessageOutput>, Tools>[]) => voidReplace the current chat history.
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.