A reference to the structured chat resource.
API
interface StructuredChatResourceRef<Output, Tools extends Chat.AnyTool> extends Resource<Chat.Message<Output, Tools>[]> {lastAssistantMessage: Signal <
Chat.AssistantMessage <Output, Tools> | undefined
>;reload: () => boolean;resendMessages: () => void;sendMessage: (message: Chat.UserMessage) => void;setMessages: (messages: Chat.Message<Output, Tools>[]) => void;stop: (clearStreamingMessage?: boolean) => void;}StructuredChatResourceRef
@typeOutput@typeToolsChat.AnyToollastAssistantMessage
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.
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.