hashbrown

ChatResourceRef

Represents the reactive chat resource, including current messages and control methods.

API

ChatResourceRef
@typeTools
Chat.AnyTool
lastAssistantMessage
Signal<Chat.AssistantMessage<string, Tools> | undefined>

The last assistant message for the chat.

reload
() => boolean

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

sendMessage
(message: Chat.UserMessage) => void

Send a new user message to the chat.

stop
(clearStreamingMessage?: boolean) => void

Stops any currently-streaming message.