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
>;isGenerating: Signal <boolean>;isLoading: Signal <boolean>;isReceiving: Signal <boolean>;isRunningToolCalls: Signal <boolean>;isSending: Signal <boolean>;lastAssistantMessage: Signal <
Chat.AssistantMessage <Output, Tools> | undefined
>;reload: () => boolean;resendMessages: () => void;sendingError: Signal <
Error | undefined
>;sendMessage: (message: Chat.UserMessage) => void;setMessages: (messages: Chat.Message<Output, Tools>[]) => void;setState(state: State): void;readonly state: Signal<State | undefined>;stop: (clearStreamingMessage?: boolean) => void;}@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 chat is running tool calls.
Signal<boolean>Indicates whether the underlying chat call is currently sending a message.
Signal<Chat.AssistantMessage<Output, Tools> | undefined>() => 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.UserMessage) => voidSend a new user message to the chat.
(messages: Chat.Message<Output, Tools>[]) => voidUpdate the chat messages.
Signal<State | undefined>The currently visible shared agent state.
(clearStreamingMessage?: boolean) => voidStops any currently-streaming message.