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>;isLoadingThread: Signal <boolean>;isReceiving: Signal <boolean>;isRunningToolCalls: Signal <boolean>;isSavingThread: 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;threadLoadError: Signal <
| {
error: string;
stacktrace?: string;
}
| undefined
>;threadSaveError: Signal <
| {
error: string;
stacktrace?: string;
}
| undefined
>;}@typeOutput@typeToolsChat.AnyToolSignal<Error | undefined>Error emitted during generation frames.
Signal<boolean>Indicates whether the chat is generating assistant output.
Signal<boolean>Aggregate loading flag across transport, generation, tool calls, and thread load/save.
Signal<boolean>Indicates whether a thread load request is in flight.
Signal<boolean>Whether the resource is currently receiving a response from the model.
Signal<boolean>Whether the chat is running tool calls.
Signal<boolean>Indicates whether a thread save request is in flight.
Signal<boolean>Indicates whether the underlying chat call is currently sending a message.
Signal<Chat.AssistantMessage<Output, Tools> | undefined>() => booleanRemove the last assistant response and re-send the previous user message. Returns true if a reload was performed.
() => voidCause current messages to be resent. Can be used after an error in chat.
Signal<Error | undefined>Transport/request error before generation frames arrive.
(message: Chat.UserMessage) => voidSend a new user message to the chat.
(messages: Chat.Message<Output, Tools>[]) => voidUpdate the chat messages.
(clearStreamingMessage?: boolean) => voidStops any currently-streaming message.
Signal<{
error: string;
stacktrace?: string;
} | undefined>Thread loading error, if present.
Signal<{
error: string;
stacktrace?: string;
} | undefined>Thread saving error, if present.