Member Junction
    Preparing search index...

    Interface StreamingChatCallbacks

    Interface for streaming chat completion callbacks

    interface StreamingChatCallbacks {
        OnComplete?: (finalResponse: ChatResult) => void;
        OnContent?: (chunk: string, isComplete: boolean) => void;
        OnError?: (error: any) => void;
    }
    Index

    Properties

    OnComplete?: (finalResponse: ChatResult) => void

    Called when the stream is complete

    Type Declaration

      • (finalResponse: ChatResult): void
      • Parameters

        Returns void

    OnContent?: (chunk: string, isComplete: boolean) => void

    Called when a new chunk of content is received

    Type Declaration

      • (chunk: string, isComplete: boolean): void
      • Parameters

        • chunk: string

          The new content chunk

        • isComplete: boolean

          Whether this is the final chunk

        Returns void

    OnError?: (error: any) => void

    Called when an error occurs during streaming

    Type Declaration

      • (error: any): void
      • Parameters

        • error: any

          The error that occurred

        Returns void