hashbrown

StructuredChatResourceRef

A reference to the structured chat resource.

API

StructuredChatResourceRef
@typeOutput
@typeTools
Chat.AnyTool
lastAssistantMessage
Signal<Chat.AssistantMessage<Output, Tools> | undefined>
reload
() => boolean

Remove the last assistant response and re-send the previous user message. Returns true if a reload was performed.

resendMessages
() => void

Cause current messages to be resent. Can be used after an error in chat.

sendMessage
(message: Chat.UserMessage) => void

Send a new user message to the chat.

setMessages
(messages: Chat.Message<Output, Tools>[]) => void

Update the chat messages.

stop
(clearStreamingMessage?: boolean) => void

Stops any currently-streaming message.