A reference to the structured chat resource.
API
interface StructuredChatResourceRef<Output, Tools extends Chat.AnyTool> 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;stop: (clearStreamingMessage?: boolean) => void;}StructuredChatResourceRef
@typeOutput@typeToolsChat.AnyToolgeneratingError
Signal<Error | undefined>Error emitted during generation frames.
isGenerating
Signal<boolean>Indicates whether the chat is generating assistant output.
isLoading
Signal<boolean>Aggregate loading flag across transport, generation, and tool calls.
isReceiving
Signal<boolean>Whether the resource is currently receiving a response from the model.
isRunningToolCalls
Signal<boolean>Whether the chat is running tool calls.
isSending
Signal<boolean>Indicates whether the underlying chat call is currently sending a message.
lastAssistantMessage
Signal<Chat.AssistantMessage<Output, Tools> | undefined>reload
() => booleanRemove the last assistant response and re-send the previous user message. Returns true if a reload was performed.
resendMessages
() => voidCause current messages to be resent. Can be used after an error in chat.
sendingError
Signal<Error | undefined>Transport/request error before generation frames arrive.
sendMessage
(message: Chat.UserMessage) => voidSend a new user message to the chat.
setMessages
(messages: Chat.Message<Output, Tools>[]) => voidUpdate the chat messages.
stop
(clearStreamingMessage?: boolean) => voidStops any currently-streaming message.