claudius-chat-widget
    Preparing search index...

    Interface ChatStreamOptions

    interface ChatStreamOptions {
        onChunk?: (text: string, fullText: string) => void;
        onToolUse?: (toolUse: ToolUse, allToolUses: ToolUse[]) => void;
        signal?: AbortSignal;
    }
    Index

    Properties

    onChunk?: (text: string, fullText: string) => void

    Called once per streamed text delta, as tokens arrive.

    Type Declaration

      • (text: string, fullText: string): void
      • Parameters

        • text: string

          The incremental text of this chunk.

        • fullText: string

          The full reply accumulated so far, including this chunk.

        Returns void

    onToolUse?: (toolUse: ToolUse, allToolUses: ToolUse[]) => void

    Called when the assistant finishes a tool call mid-stream, so the UI can show a "used tool" affordance before the reply completes.

    signal?: AbortSignal

    Cancels the stream when aborted. Cancellation is not an error: the promise resolves with the partial reply and aborted: true.