Skip to content

feat: add bjj-vqa generate CLI with Gemini + frame extraction#45

Open
clawdinhobot wants to merge 2 commits intomainfrom
clawdinho/issue-38-generate-cli
Open

feat: add bjj-vqa generate CLI with Gemini + frame extraction#45
clawdinhobot wants to merge 2 commits intomainfrom
clawdinho/issue-38-generate-cli

Conversation

@clawdinhobot
Copy link
Copy Markdown
Collaborator

Summary

Implement bjj-vqa generate <url> — calls Gemini Flash via OpenRouter with the YouTube URL, receives structured JSON, extracts frames via yt-dlp + ffmpeg, and appends records to data/samples.json.

Changes

  • src/bjj_vqa/generate/prompt.md — rewritten to request structured JSON output
  • src/bjj_vqa/generate/__init__.py — generate module with:
    • generate_questions(url) — calls Gemini via OpenRouter with video_url input
    • _extract_frame(url, timestamp, output) — yt-dlp + ffmpeg frame extraction
    • run(url) — full pipeline: generate → extract frames → append to samples.json
  • src/bjj_vqa/cli.py — added generate subcommand
  • pyproject.toml — added yt-dlp>=2025.1.0 to dependencies, renamed @pytest.mark.vision to @pytest.mark.integration
  • tests/test_generate.py — 3 integration tests (skip without OPENROUTER_API_KEY)

Acceptance criteria

  • yt-dlp added to project dependencies
  • bjj-vqa generate <url> exits 0 and appends valid records to data/samples.json
  • New images written to data/images/ with uuid.uuid4().hex[:8] names
  • uv run bjj-vqa validate passes after generate
  • src/bjj_vqa/generate/prompt.md rewritten to request structured JSON output
  • @pytest.mark.vision renamed to @pytest.mark.integration everywhere
  • Tests in tests/test_generate.py use real OpenRouter API, skip without key
  • Existing 28 tests still pass

Closes #38

@clawdinhobot
Copy link
Copy Markdown
Collaborator Author

Fixed ty check error in generate module — added inline ty: ignore[invalid-argument-type] for OpenAI dict-literal messages. Now only 2 pre-existing errors from main (src/bjj_vqa/task.py:30,40).

@clawdinhobot
Copy link
Copy Markdown
Collaborator Author

Opened PR #46 to fix the pre-existing ty errors on main. Once merged, validate CI should pass on this PR too.

@matheusccouto
Copy link
Copy Markdown
Owner

I merged #46, please rebase.

clawdinhobot and others added 2 commits May 3, 2026 19:52
Rewrite generate prompt to request structured JSON output.
Implement 'bjj-vqa generate <url>' that calls Gemini Flash via
OpenRouter (video_url input), extracts frames via yt-dlp + ffmpeg,
writes images with short UUID hex names, and appends records to
data/samples.json.

- Add yt-dlp>=2025.1.0 to project dependencies
- Rename @pytest.mark.vision to @pytest.mark.integration
- Add tests/test_generate.py with 3 integration tests
- Existing 28 tests still pass (3 integration tests skipped)

Closes #38
@clawdinhobot clawdinhobot force-pushed the clawdinho/issue-38-generate-cli branch from 92009b5 to 3ad5348 Compare May 3, 2026 22:52
@clawdinhobot
Copy link
Copy Markdown
Collaborator Author

Branch is already up to date with main (includes PR #46 merge).

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.

bjj-vqa generate <url> — Gemini Flash + frame extraction

2 participants