Skip to content

feat: add Gemini agentic video adapter - #1608

Open
groupthinking wants to merge 3 commits into
mainfrom
feat/gemini-agentic-video
Open

feat: add Gemini agentic video adapter#1608
groupthinking wants to merge 3 commits into
mainfrom
feat/gemini-agentic-video

Conversation

@groupthinking

Copy link
Copy Markdown
Owner

What changed

Adds an opt-in adapter for Google's agentic video understanding path via the Interactions API.

  • accepts YouTube URLs and file URIs
  • supports agentic and static processing per video, including mixed requests
  • defaults to gemini-3.7-flash
  • returns a durable execution receipt with model, sources, processing modes, text, and token count
  • validates inputs before a provider call

Why

Google AI Studio announced agentic video understanding on September 1, 2026. The capability actively inspects transcript, frames, and audio with adaptive frame sampling, which maps directly to EventRelay's video-to-event pipeline and the See → Act → Record → Review loop.

Sources:

Verification

  • python -m compileall src/integration/gemini_agentic_video.py tests/unit/test_gemini_agentic_video.py — passed
  • dependency-free fake-provider harness — passed request construction, async invocation, receipt, and validation
  • full pytest was not available in the local execution environment (No module named pytest); repository CI remains the merge gate

No production deployment or default-path switch is included.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Error Error Sep 8, 2026 3:27am UTC

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6486f772-77d9-43b1-8ca2-76029a898a21


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the python label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 01c0b41.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Copy link
Copy Markdown
Owner Author

Execution receipt — security workflow diagnosis

Verified failing run: Security Scan 33605167703, job trivy (100167379816).

The container build stops before Trivy executes because:

npm ci --workspace=apps/web --production --legacy-peer-deps
Invalid: lock file's @ai-sdk/gateway@4.0.23 does not satisfy @ai-sdk/gateway@4.0.72
Invalid: lock file's postcss@8.5.21 does not satisfy postcss@8.5.26
ERROR: process ... did not complete successfully: exit code: 1

The PR changes only:

  • src/integration/gemini_agentic_video.py
  • tests/unit/test_gemini_agentic_video.py

Interpretation: the failed security workflow is a repository package/lock synchronization blocker, not a vulnerability finding from this adapter. Trivy was skipped because the image never built.

Action: recorded here rather than mixing an unrelated lockfile rewrite into this focused PR. The next safe repair is to reconcile the web workspace lockfile in its canonical dependency-maintenance work, then rerun Security Scan.

Other exact-head checks currently verified successful: CI, Coverage, CodeQL, Secret Scan, and Dependency Review.

Copy link
Copy Markdown
Owner Author

Execution receipt — Gemini 3.8 adoption boundary and benchmark scope

New verified fact (2026-09-02): Google released Gemini 3.8 Flash, and Vercel AI Gateway exposes it as google/gemini-3.8-flash with video input. Main now uses that gateway path in 25e6fbb.

Separate verified fact: Google's current agentic-video guide still documents processing: "agentic" only for Gemini 3.7 Flash, 3.6 Flash, and 3.5 Flash-Lite. It does not document Gemini 3.8 for this specialized Interactions API mode.

Sources:

Decision: TEST. Keep this draft's default at gemini-3.7-flash until Google explicitly confirms 3.8 support for processing: "agentic". Do not treat the generic gateway video path and the Interactions API agentic path as equivalent.

Re-scoped value of this PR: retain it as the explicit agentic-processing/receipt adapter and use it to benchmark against the main gateway extractor on the same videos:

  1. Video Pack schema completeness and grounded timestamps
  2. Token use and actual cost
  3. Latency
  4. Failure behavior
  5. Provenance/receipt quality

The adapter already permits a model override through GEMINI_AGENTIC_VIDEO_MODEL, so no speculative model-pin change is needed today.

@groupthinking
groupthinking marked this pull request as ready for review September 8, 2026 03:26
Copilot AI balanced review requested due to automatic review settings September 8, 2026 03:26

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

TypeScript build fails with "Variable 'promise' is used before being assigned" because promise is referenced inside its own initializer closure under strict definite-assignment analysis

Fix on Vercel

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The locked SDK version loses response text, and malformed video URIs still reach the provider.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an opt-in Gemini Interactions API adapter for agentic and static video analysis.

Changes:

  • Adds video input and execution receipt models.
  • Supports mixed processing modes and asynchronous provider calls.
  • Tests request construction, receipts, and basic validation.
File summaries
File Description
src/integration/gemini_agentic_video.py Implements the Gemini video adapter.
tests/unit/test_gemini_agentic_video.py Adds adapter unit tests.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

usage = getattr(response, "usage", None)
total_tokens = getattr(usage, "total_tokens", None)
return AgenticVideoReceipt(
output_text=str(getattr(response, "output_text", "")),
Comment on lines +74 to +79
for video in videos:
if not video.uri.strip():
raise ValueError("Video URI must not be empty")
item = {
"type": "video",
"uri": video.uri,
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

⚠️ Repository reconciliation: this PR does not reference exactly one canonical issue.

Please add a Closes #<issue> reference in the PR description so it can be tracked against the delivery plan.

See governance: #898

@groupthinking groupthinking linked an issue Sep 8, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent help

2 participants