Skip to content

Commit b2c1f07

Browse files
tombeckenhamclaude
andcommitted
fix(docs): make OpenRouter duration snippet self-contained for kiira doc type-check
The new kiira doc-typecheck (#805) type-checks fenced TS samples. The OpenRouter snapDuration snippet referenced generateVideo/openRouterVideo/sliderSeconds without imports or a declaration; add them so the snippet type-checks standalone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 38b8fe9 commit b2c1f07

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/media/video-generation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,16 +813,20 @@ and the adapter implements the same `availableDurations()` / `snapDuration()`
813813
introspection helpers:
814814

815815
```typescript
816+
import { generateVideo } from '@tanstack/ai'
817+
import { openRouterVideo } from '@tanstack/ai-openrouter'
818+
816819
const adapter = openRouterVideo('bytedance/seedance-2.0')
817820

818821
adapter.availableDurations()
819822
// { kind: 'discrete', values: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] }
820823
adapter.snapDuration(7.4) // 7 — closest valid duration
821824

825+
const sliderSeconds = 7 // raw seconds from a UI control
822826
await generateVideo({
823827
adapter,
824828
prompt: 'A timelapse of clouds',
825-
duration: adapter.snapDuration(sliderSeconds), // coerce raw UI seconds
829+
duration: adapter.snapDuration(sliderSeconds), // coerce to a valid duration
826830
})
827831
```
828832

0 commit comments

Comments
 (0)