Member Junction
    Preparing search index...

    Interface ParallelChatCompletionsCallbacks

    Interface for callbacks used in parallel chat completions

    interface ParallelChatCompletionsCallbacks {
        OnAllCompleted?: (responses: ChatResult[]) => void;
        OnCompletion?: (response: ChatResult, index: number) => void;
        OnError?: (error: any, index: number) => void;
    }
    Index

    Properties

    OnAllCompleted?: (responses: ChatResult[]) => void

    Called when all completions in the batch are completed (successfully or with errors)

    Type Declaration

      • (responses: ChatResult[]): void
      • Parameters

        • responses: ChatResult[]

          Array of all ChatResults in the same order as the request params

        Returns void

    OnCompletion?: (response: ChatResult, index: number) => void

    Called when a single completion from the batch is completed

    Type Declaration

      • (response: ChatResult, index: number): void
      • Parameters

        • response: ChatResult

          The completed ChatResult

        • index: number

          The index of the completion in the original request array

        Returns void

    OnError?: (error: any, index: number) => void

    Called when any completion in the batch encounters an error

    Type Declaration

      • (error: any, index: number): void
      • Parameters

        • error: any

          The error that occurred

        • index: number

          The index of the completion that failed

        Returns void