MCPcopy
hub / github.com/TanStack/ai / createGenerationChunks

Function createGenerationChunks

packages/ai-solid/tests/use-generation.test.ts:15–36  ·  view source on GitHub ↗
(result: unknown)

Source from the content-addressed store, hash-verified

13
14// Helper to create generation stream chunks
15function createGenerationChunks(result: unknown): Array<StreamChunk> {
16 return [
17 {
18 type: EventType.RUN_STARTED,
19 runId: 'run-1',
20 threadId: 'thread-1',
21 timestamp: Date.now(),
22 },
23 {
24 type: EventType.CUSTOM,
25 name: 'generation:result',
26 value: result,
27 timestamp: Date.now(),
28 },
29 {
30 type: EventType.RUN_FINISHED,
31 runId: 'run-1',
32 threadId: 'thread-1',
33 timestamp: Date.now(),
34 },
35 ]
36}
37
38// Helper to create video generation stream chunks
39function createVideoChunks(jobId: string, url: string): Array<StreamChunk> {

Callers 1

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected