# Function bufferStream

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

- bufferStream<T>(
  stream: AsyncIterable<T>,
  size: number,
  options?: { signal?: AbortSignal },
  ): AsyncIterable<T[]>

  Buffers stream chunks into groups of a specified size.

  #### Type Parameters

  - T

  #### Parameters

  - stream: AsyncIterable<T>

    The source stream

  - size: number

    Buffer size

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

    Options including optional AbortSignal

  #### Returns AsyncIterable<T[]>

  Stream of chunk arrays

  - Defined in packages/nexus-agents/src/adapters/stream-operators.ts:237