Skip to content

feat(go-sdk): add MediaProvider interface and OpenRouter media generation#476

Merged
santoshkumarradha merged 10 commits intodev/add-videofrom
feat/468-go-sdk-media
Apr 18, 2026
Merged

feat(go-sdk): add MediaProvider interface and OpenRouter media generation#476
santoshkumarradha merged 10 commits intodev/add-videofrom
feat/468-go-sdk-media

Conversation

@santoshkumarradha
Copy link
Copy Markdown
Member

Summary

  • Adds MediaProvider interface with GenerateImage, GenerateAudio, GenerateVideo methods
  • Adds MediaRouter for longest-prefix model dispatch to providers
  • Implements OpenRouterMediaProvider supporting video (async poll), image (chat completions), and audio (SSE streaming) generation
  • All types: VideoRequest, ImageRequest, AudioRequest, MediaResponse, VideoData, ImageData, AudioData, FileData

Closes #468

Test plan

  • go build ./... passes
  • go test ./... passes (all 1004 tests across 6 packages)
  • go vet ./... clean
  • Manual integration test with live OpenRouter API key

…tion (#468)

Adds MediaProvider interface, MediaRouter for model-prefix-based dispatch,
and OpenRouterMediaProvider supporting image, audio, and video generation.
@santoshkumarradha santoshkumarradha requested review from a team and AbirAbbas as code owners April 18, 2026 09:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

Performance

SDK Memory Δ Latency Δ Tests Status
Go 210 B -25% 0.56 µs -44%

✓ No regressions detected

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

📊 Coverage gate

Thresholds from .coverage-gate.toml: per-surface ≥ 86%, aggregate ≥ 88%, max per-surface regression ≤ 1.0 pp, max aggregate regression ≤ 0.50 pp.

Surface Current Baseline Δ
control-plane 87.30% 87.30% → +0.00 pp 🟡
sdk-go 90.00% 90.70% ↓ -0.70 pp 🟢
sdk-python 93.63% 93.63% ↑ +0.00 pp 🟢
sdk-typescript 92.56% 92.56% → +0.00 pp 🟢
web-ui 90.02% 90.01% ↑ +0.01 pp 🟢
aggregate 89.02% 89.01% ↑ +0.01 pp 🟡

✅ Gate passed

No surface regressed past the allowed threshold and the aggregate stayed above the floor.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

📐 Patch coverage gate

Threshold: 80% on lines this PR touches vs origin/main (from .coverage-gate.toml:thresholds.min_patch).

Surface Touched lines Patch coverage Status
control-plane 0 ➖ no changes
sdk-go 377 66.00%
sdk-python 0 ➖ no changes
sdk-typescript 0 ➖ no changes
web-ui 0 ➖ no changes

❌ Patch gate failed

sdk-go — 66.00% on 377 touched lines (128 uncovered):

File Patch coverage Missing lines
sdk/go/ai/openrouter_media.go 64.5% 62, 90, 91, 92, 93, 94, 95, 96, 97, 98 …(+118 more)
sdk/go/ai/media_provider.go 100.0%

How to fix

  1. For each file listed above, add tests that exercise the missing line numbers in this same PR.
  2. Re-run locally: ./scripts/coverage-summary.sh && ./scripts/patch-coverage-gate.sh.
  3. Do not lower min_patch in .coverage-gate.toml to silence this — the floor is the contract.

@santoshkumarradha santoshkumarradha merged commit 97dcf74 into dev/add-video Apr 18, 2026
15 of 16 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