hashbrown

StructuredChatResourceRef

A reference to the structured chat resource.

API

StructuredChatResourceRef
@typeOutput
@typeTools
Chat.AnyTool
generatingError
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, tool calls, and thread load/save.

isLoadingThread
Signal<boolean>

Indicates whether a thread load request is in flight.

isReceiving
Signal<boolean>

Whether the resource is currently receiving a response from the model.

isRunningToolCalls
Signal<boolean>

Whether the chat is running tool calls.

isSavingThread
Signal<boolean>

Indicates whether a thread save request is in flight.

isSending
Signal<boolean>

Indicates whether the underlying chat call is currently sending a message.

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.

sendingError
Signal<Error | undefined>

Transport/request error before generation frames arrive.

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.

threadLoadError
Signal<{
        error: string;
        stacktrace?: string;
    } | undefined>

Thread loading error, if present.

threadSaveError
Signal<{
        error: string;
        stacktrace?: string;
    } | undefined>

Thread saving error, if present.