calesthio/OpenMontage · error · ValueError
prompt is required
Error message
prompt is required
What it means
Raised by the static `_prompt(inputs)` helper: it reads `inputs['prompt']`, stringifies, strips whitespace, and if the result is empty the call is rejected before any paid Kling request. Kling's generation endpoints require a non-empty text prompt, so this is a deliberate pre-flight check to avoid spending credits on a call the API would reject anyway.
Source
Thrown at tools/video/kling_official_video.py:694
"video_urls",
):
count += len(inputs.get(key) or [])
for key in (
"reference_image_url",
"reference_image_path",
"reference_tail_image_url",
"reference_tail_image_path",
"reference_video_url",
):
if inputs.get(key):
count += 1
return count
@staticmethod
def _prompt(inputs: dict[str, Any]) -> str:
prompt = str(inputs.get("prompt") or "").strip()
if not prompt:
raise ValueError("prompt is required")
return prompt
@staticmethod
def _first_output_url(outputs: list[dict[str, Any]]) -> str:
for item in outputs:
try:
return KlingOfficialVideo._output_url(item)
except ValueError:
continue
raise ValueError(f"Kling video response contained no downloadable URL: {outputs}")
View on GitHub (pinned to 95e1c3d0ab)
Solutions
- Set a non-empty `prompt` string in the inputs dict
- If the prompt comes from a variable, add a check that it is non-empty before invoking the tool
- Verify the exact key name is `prompt` per the tool's schema — not `text`, `description`, or `negative_prompt`
Example fix
// before
inputs = {"model": "kling-v2-master", "duration": 5}
// after
inputs = {"model": "kling-v2-master", "duration": 5, "prompt": "A cinematic drone shot over foggy mountains at dawn"} Defensive patterns
Strategy: validation
Validate before calling
prompt = str(inputs.get("prompt") or "").strip()
if not prompt:
raise ValueError("prompt is required before calling kling_official_video") Type guard
def has_prompt(inputs: dict) -> bool:
return bool(str(inputs.get("prompt") or "").strip()) Try / catch
try:
result = kling.execute(inputs)
except ValueError as e:
if "prompt is required" in str(e):
raise RuntimeError(f"upstream produced empty prompt for inputs keys: {sorted(inputs)}") from e
raise Prevention
- Assert a non-empty prompt in your input-builder function, closest to where the prompt originates
- When the prompt is model-generated (LLM narration), validate before spend, not after
When it happens
Trigger: Calling kling_official_video with `prompt` omitted, set to `None`, set to `""`, or containing only whitespace; passing the prompt under a wrong key (e.g. `text` or `description`) so `inputs.get('prompt')` returns nothing.
Common situations: Agents composing inputs programmatically where an upstream variable was never filled; prompt-key typos; image-to-video flows where the developer assumed the reference image alone suffices and no prompt is needed (this tool still requires one).
Related errors
- prompt is required
- video_list items must be objects
- prompt is required for text_to_video
- prompt references <<<image_{max(existing_numbers)}>>> but on
- Image Omni prompt placeholders must start at <<<image_1>>>
AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15).
Data as JSON: /api/errors/6d09a208aed53c5f.
Report an issue: GitHub.