Skip to content

Add playground video generation endpoints and UI; wire video parameters through frontend and backend - #4

Merged
LJR199887 merged 2 commits into
mainfrom
codex/find-project-purpose
Mar 28, 2026
Merged

Add playground video generation endpoints and UI; wire video parameters through frontend and backend#4
LJR199887 merged 2 commits into
mainfrom
codex/find-project-purpose

Conversation

@LJR199887

Copy link
Copy Markdown
Owner

Motivation

  • Add support for video generation from the playground with dedicated submit and fetch endpoints and pass video-specific parameters through the whole stack.
  • Centralize playground token/context setup to reuse logic between chat and video flows.
  • Provide a friendly UI in the playground to configure video size, seconds, and quality, and ensure video requests are handled as non-streaming tasks.

Description

  • Backend: introduce PlaygroundVideoSubmit and PlaygroundVideoFetch handlers and setupPlaygroundTokenContext helper to set up token context for playground flows, and refactor Playground to use the helper before delegating to Relay via Relay(c, types.RelayFormatOpenAI).
  • Router: register new routes /pg/video/generations (POST) and /pg/video/generations/:task_id (GET) and keep existing /pg/chat/completions mapping to controller.Playground.
  • DTO: extend GeneralOpenAIRequest with seconds and quality fields to carry video parameters upstream.
  • Frontend UI: add video parameter controls to SettingsPanel.jsx (video size, seconds, quality) and default values in DEFAULT_CONFIG.
  • Frontend API/helpers: add API_ENDPOINTS.VIDEO_GENERATIONS, update buildApiPayload to include size, seconds, and quality for video models and force stream = false for them, and enrich handleApiError usage.
  • Frontend request flow: extend useApiRequest to detect video-generation payloads, build simplified video request payloads (extracting prompt and image from the last user message), route requests to /pg/video/generations, treat video requests as non-streaming, handle returned task_id/video_url responses by converting them into a summary assistant message, and adjust SSE/stream dispatch logic (forceNonStream) accordingly.

Testing

  • Ran backend build check with go build ./... which completed successfully.
  • Ran frontend build with npm run build which completed successfully.
  • Ran frontend unit checks with npm test (project test suite) and they passed.

Codex Task

@LJR199887
LJR199887 merged commit e20c678 into main Mar 28, 2026
1 check failed
@LJR199887
LJR199887 deleted the codex/find-project-purpose branch March 28, 2026 07:19
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.

1 participant