MCPcopy Create free account
hub / github.com/TanStack/ai / collectChunks

Function collectChunks

packages/ai/tests/stream-generation.test.ts:11–19  ·  view source on GitHub ↗
(
  stream: AsyncIterable<StreamChunk>,
)

Source from the content-addressed store, hash-verified

9
10// Helper to collect all chunks from an async iterable
11async function collectChunks(
12 stream: AsyncIterable<StreamChunk>,
13): Promise<Array<StreamChunk>> {
14 const chunks: Array<StreamChunk> = []
15 for await (const chunk of stream) {
16 chunks.push(chunk)
17 }
18 return chunks
19}
20
21// ============================================================================
22// generateImage({ stream: true }) tests

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected