promptdojo_

Why programmatic video — when AI gen alone isn't enough — step 6 of 7

Write classify_video_task(task) that takes a task dict and returns one of "ai-gen-only", "code-driven", or "hybrid".

Input fields (all optional, use .get() with sensible defaults):

  • rows: int (default 1)
  • needs_copy: bool (default False)
  • data_source: str | None (default None)
  • is_one_shot: bool (default False)

Rules, in order:

  • If is_one_shot AND rows == 1 AND NOT needs_copy AND data_source is None → return "ai-gen-only".
  • Else if rows > 1 OR data_source is not None → return "code-driven".
  • Else → return "hybrid".

Five briefs run. Expected output:

fog shot:        ai-gen-only
channel intro:   hybrid
shopify ads:     code-driven
nfl reel:        code-driven
album loop:      ai-gen-only

full-screen editor opens — close anytime to keep reading.