Skip to content

feat(playground): add video size/duration/quality selectors - #3466

Closed
LJR199887 wants to merge 2 commits into
QuantumNous:mainfrom
LJR199887:codex/find-project-purpose
Closed

feat(playground): add video size/duration/quality selectors#3466
LJR199887 wants to merge 2 commits into
QuantumNous:mainfrom
LJR199887:codex/find-project-purpose

Conversation

@LJR199887

@LJR199887 LJR199887 commented Mar 27, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Added video parameter controls to the playground interface for video-capable models.
    • New configurable options: video size (default 1280x720), duration (default 10 seconds), and quality (default standard).
    • Video parameters are automatically included in API requests when using video models.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR adds video generation model support by introducing two new optional parameters (Seconds and Quality) to the backend DTO, configuring default video settings on the frontend, conditionally displaying video parameter controls in the UI when a video model is selected, and adapting the API payload builder to include video-specific fields for video models.

Changes

Cohort / File(s) Summary
Backend DTO
dto/openai_request.go
Added two optional request fields Seconds *int and Quality *string to GeneralOpenAIRequest, serialized as seconds and quality with omitempty tags.
Frontend Configuration
web/src/constants/playground.constants.js
Added three new default video configuration properties: videoSize ('1280x720'), videoSeconds ('10'), and videoQuality ('standard') under DEFAULT_CONFIG.inputs.
Frontend UI Controls
web/src/components/playground/SettingsPanel.jsx
Introduced derived state to detect video-capable models and rendered conditional "video parameters" section with three Select controls for size, duration, and quality when a video model is active.
Frontend API Builder
web/src/helpers/api.js
Extended buildApiPayload to detect video models and conditionally add video-specific fields (size, seconds, quality) to the API payload with proper integer parsing and finite number validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • feat: pplx channel #1998: Adds additional optional fields to GeneralOpenAIRequest struct, extending the same DTO with search and return parameters, indicating parallel feature expansion in the request model.

Poem

🐰 Hop along with videos new,
Size and seconds, quality true,
From UI to payload we send,
Video features now extend!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding video size, duration (seconds), and quality selector controls to the playground UI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
web/src/helpers/api.js (1)

158-159: Consider case-insensitive model name matching.

The current check inputs.model.includes('video') is case-sensitive. If model names vary in casing (e.g., "Video-Gen", "VIDEO-1"), they won't be detected as video models.

🔧 Optional: Case-insensitive check
   const isVideoModel =
-    typeof inputs.model === 'string' && inputs.model.includes('video');
+    typeof inputs.model === 'string' && inputs.model.toLowerCase().includes('video');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/helpers/api.js` around lines 158 - 159, The isVideoModel detection is
case-sensitive and misses variants like "Video-Gen" or "VIDEO-1"; update the
check in the isVideoModel logic to perform a case-insensitive match by
normalizing inputs.model (e.g., call .toLowerCase() after confirming typeof
inputs.model === 'string') and then checking .includes('video') (or use a
case-insensitive regex like /video/i) so all casing variants are detected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@web/src/helpers/api.js`:
- Around line 158-159: The isVideoModel detection is case-sensitive and misses
variants like "Video-Gen" or "VIDEO-1"; update the check in the isVideoModel
logic to perform a case-insensitive match by normalizing inputs.model (e.g.,
call .toLowerCase() after confirming typeof inputs.model === 'string') and then
checking .includes('video') (or use a case-insensitive regex like /video/i) so
all casing variants are detected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5f7f849f-6636-434c-9a05-16e9c96bdf06

📥 Commits

Reviewing files that changed from the base of the PR and between fbf235d and 680271d.

📒 Files selected for processing (4)
  • dto/openai_request.go
  • web/src/components/playground/SettingsPanel.jsx
  • web/src/constants/playground.constants.js
  • web/src/helpers/api.js

@ghost

This comment was marked as spam.

@LJR199887 LJR199887 closed this Mar 28, 2026
@LJR199887
LJR199887 deleted the codex/find-project-purpose branch March 28, 2026 06:11
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