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

Function createVideoChunks

packages/ai-solid/tests/use-generation.test.ts:39–72  ·  view source on GitHub ↗
(jobId: string, url: string)

Source from the content-addressed store, hash-verified

37
38// Helper to create video generation stream chunks
39function createVideoChunks(jobId: string, url: string): Array<StreamChunk> {
40 return [
41 {
42 type: EventType.RUN_STARTED,
43 runId: 'run-1',
44 threadId: 'thread-1',
45 timestamp: Date.now(),
46 },
47 {
48 type: EventType.CUSTOM,
49 name: 'video:job:created',
50 value: { jobId },
51 timestamp: Date.now(),
52 },
53 {
54 type: EventType.CUSTOM,
55 name: 'video:status',
56 value: { jobId, status: 'processing', progress: 50 },
57 timestamp: Date.now(),
58 },
59 {
60 type: EventType.CUSTOM,
61 name: 'generation:result',
62 value: { jobId, status: 'completed', url },
63 timestamp: Date.now(),
64 },
65 {
66 type: EventType.RUN_FINISHED,
67 runId: 'run-1',
68 threadId: 'thread-1',
69 timestamp: Date.now(),
70 },
71 ]
72}
73
74// Helper to create error stream chunks.
75// NOTE: The AG-UI spec for RUN_ERROR carries `message` directly on the event

Callers 1

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected