nexus-agents - v2.80.0
    Preparing search index...

    Function reduceStream

    Adapters exports - Model adapters (Claude, OpenAI, Gemini, Ollama) Split from index.ts for file size compliance (Issue #285)

    • Reduces a stream to a single value.

      Type Parameters

      • T
      • U

      Parameters

      • stream: AsyncIterable<T>

        The source stream

      • reducer: (accumulator: U, chunk: T, index: number) => U | Promise<U>

        Reducer function

      • initialValue: U

        Initial accumulator value

      • options: { signal?: AbortSignal } = {}

        Options including optional AbortSignal

      Returns Promise<Result<U, StreamError>>

      Result containing the final value or error