Skip to content

feat(typescript-sdk): add MediaProvider interface and OpenRouter media generation#477

Merged
santoshkumarradha merged 1 commit intodev/add-videofrom
feat/467-ts-sdk-media
Apr 18, 2026
Merged

feat(typescript-sdk): add MediaProvider interface and OpenRouter media generation#477
santoshkumarradha merged 1 commit intodev/add-videofrom
feat/467-ts-sdk-media

Conversation

@santoshkumarradha
Copy link
Copy Markdown
Member

Summary

  • Adds MediaProvider interface with VideoRequest, ImageRequest, AudioRequest, and MediaResponse types
  • Adds MediaRouter for prefix-based provider dispatch (longest-prefix-first matching)
  • Implements OpenRouterMediaProvider with video (async job submit/poll/download), image (chat completions with image modality), and audio (SSE stream parsing) generation
  • 15 tests covering router logic, prefix stripping, error handling, and all three generation methods with mocked fetch

Closes #467

Test plan

  • TypeScript compiles cleanly (npx tsc --noEmit)
  • All 15 new tests pass (vitest run tests/media_provider.test.ts)
  • Full suite (525 tests) passes with 0 failures

…a generation (#467)

Ports MediaProvider abstraction to TS SDK with VideoRequest/ImageRequest/AudioRequest
types, MediaRouter prefix-based dispatch, and OpenRouterMediaProvider supporting
video (async job polling), image, and audio (SSE stream) generation.
@santoshkumarradha santoshkumarradha requested review from a team and AbirAbbas as code owners April 18, 2026 09:55
@github-actions
Copy link
Copy Markdown
Contributor

Performance

SDK Memory Δ Latency Δ Tests Status
TS 228 B -35% 2.63 µs +31%

✓ No regressions detected

@santoshkumarradha santoshkumarradha merged commit 4426efd into dev/add-video Apr 18, 2026
17 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant