calesthio/OpenMontage · error · ValueError

web_search is supported only for pure text input

Error message

web_search is supported only for pure text input

What it means

Raised when web_search is enabled but the built content array has more than one element, i.e. the request contains any reference media alongside the prompt. Ark's web_search tool only works on a pure text prompt, so combining it with images/videos/audio is rejected client-side.

Source

Thrown at tools/video/seedance_ark.py:881

                )

            content.extend(
                self._image_content(ref, role="reference_image") for ref in image_refs
            )
            content.extend(
                {
                    "type": "video_url",
                    "video_url": {"url": str(ref)},
                    "role": "reference_video",
                }
                for ref in video_refs
            )
            content.extend(
                self._audio_content(ref, role="reference_audio") for ref in audio_refs
            )

        if inputs.get("web_search") and len(content) != 1:
            raise ValueError("web_search is supported only for pure text input")

        payload: dict[str, Any] = {
            "model": model,
            "content": content,
            "duration": duration,
            "ratio": ratio,
            "resolution": resolution,
            "generate_audio": bool(inputs.get("generate_audio", True)),
            "watermark": bool(inputs.get("watermark", False)),
            "return_last_frame": bool(inputs.get("return_last_frame", False)),
        }
        optional = (
            "callback_url",
            "execution_expires_after",
            "priority",
            "safety_identifier",
        )
        for key in optional:

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Remove web_search from media-conditioned requests
  2. Keep web_search only for pure text_to_video with a prompt and no media
  3. Do retrieval yourself, inject findings into the prompt, and keep media refs without web_search

Example fix

# before
inputs = {"operation": "image_to_video", "reference_image_url": a,
          "web_search": True}

# after
inputs = {"operation": "image_to_video", "reference_image_url": a}
Defensive patterns

Strategy: validation

Validate before calling

if inputs.get("web_search"):
    assert inputs.get("operation") in (None, "text_to_video"), "web_search is text-only"
    assert not has_media(inputs), "web_search forbids reference media"
    inputs.pop("end_image_url", None); inputs.pop("end_image_path", None)

Type guard

def web_search_compatible(inputs: dict) -> bool:
    if not inputs.get("web_search"):
        return True
    return not has_media(inputs) and not inputs.get("end_image_url") and not inputs.get("end_image_path")

Prevention

When it happens

Trigger: inputs.web_search truthy together with any reference media (image_to_video refs, reference_to_video refs, or end frames), making len(content) > 1.

Common situations: Reusing a web_search config across all operations; wanting 'grounded' image-to-video and assuming search plus a first frame is allowed.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/0f1249cc46ce793e. Report an issue: GitHub.