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

    Function takeUntil

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

    • Takes chunks from a stream until a predicate returns true.

      Type Parameters

      • T

      Parameters

      • stream: AsyncIterable<T>

        The source stream

      • predicate: (chunk: T, index: number) => boolean | Promise<boolean>

        Function that returns true to stop taking

      • options: { signal?: AbortSignal; inclusive?: boolean } = {}

        Options including whether to include the matching chunk

      Returns AsyncIterable<T>

      Stream of chunks up to (and optionally including) the match