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

Function createVideoChunks

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

Source from the content-addressed store, hash-verified

33
34// Helper to create video generation stream chunks
35function createVideoChunks(jobId: string, url: string): Array<StreamChunk> {
36 return [
37 { type: 'RUN_STARTED', runId: 'run-1', timestamp: Date.now() },
38 {
39 type: 'CUSTOM',
40 name: 'video:job:created',
41 value: { jobId },
42 timestamp: Date.now(),
43 },
44 {
45 type: 'CUSTOM',
46 name: 'video:status',
47 value: { jobId, status: 'processing', progress: 50 },
48 timestamp: Date.now(),
49 },
50 {
51 type: 'CUSTOM',
52 name: 'generation:result',
53 value: { jobId, status: 'completed', url },
54 timestamp: Date.now(),
55 },
56 {
57 type: 'RUN_FINISHED',
58 runId: 'run-1',
59 finishReason: 'stop',
60 timestamp: Date.now(),
61 },
62 ] as unknown as Array<StreamChunk>
63}
64
65// Helper to create error stream chunks
66function createErrorChunks(message: string): Array<StreamChunk> {

Callers 1

Calls 1

nowMethod · 0.80

Tested by

no test coverage detected