{"record":{"id":"0f1249cc46ce793e","repo":"calesthio/OpenMontage","slug":"web-search-is-supported-only-for-pure-text-input","errorCode":null,"errorMessage":"web_search is supported only for pure text input","messagePattern":"web_search is supported only for pure text input","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/video/seedance_ark.py","lineNumber":881,"sourceCode":"                )\n\n            content.extend(\n                self._image_content(ref, role=\"reference_image\") for ref in image_refs\n            )\n            content.extend(\n                {\n                    \"type\": \"video_url\",\n                    \"video_url\": {\"url\": str(ref)},\n                    \"role\": \"reference_video\",\n                }\n                for ref in video_refs\n            )\n            content.extend(\n                self._audio_content(ref, role=\"reference_audio\") for ref in audio_refs\n            )\n\n        if inputs.get(\"web_search\") and len(content) != 1:\n            raise ValueError(\"web_search is supported only for pure text input\")\n\n        payload: dict[str, Any] = {\n            \"model\": model,\n            \"content\": content,\n            \"duration\": duration,\n            \"ratio\": ratio,\n            \"resolution\": resolution,\n            \"generate_audio\": bool(inputs.get(\"generate_audio\", True)),\n            \"watermark\": bool(inputs.get(\"watermark\", False)),\n            \"return_last_frame\": bool(inputs.get(\"return_last_frame\", False)),\n        }\n        optional = (\n            \"callback_url\",\n            \"execution_expires_after\",\n            \"priority\",\n            \"safety_identifier\",\n        )\n        for key in optional:","sourceCodeStart":863,"sourceCodeEnd":899,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/video/seedance_ark.py#L863-L899","documentation":"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.","triggerScenarios":"inputs.web_search truthy together with any reference media (image_to_video refs, reference_to_video refs, or end frames), making len(content) > 1.","commonSituations":"Reusing a web_search config across all operations; wanting 'grounded' image-to-video and assuming search plus a first frame is allowed.","solutions":["Remove web_search from media-conditioned requests","Keep web_search only for pure text_to_video with a prompt and no media","Do retrieval yourself, inject findings into the prompt, and keep media refs without web_search"],"exampleFix":"# before\ninputs = {\"operation\": \"image_to_video\", \"reference_image_url\": a,\n          \"web_search\": True}\n\n# after\ninputs = {\"operation\": \"image_to_video\", \"reference_image_url\": a}","handlingStrategy":"validation","validationCode":"if inputs.get(\"web_search\"):\n    assert inputs.get(\"operation\") in (None, \"text_to_video\"), \"web_search is text-only\"\n    assert not has_media(inputs), \"web_search forbids reference media\"\n    inputs.pop(\"end_image_url\", None); inputs.pop(\"end_image_path\", None)","typeGuard":"def web_search_compatible(inputs: dict) -> bool:\n    if not inputs.get(\"web_search\"):\n        return True\n    return not has_media(inputs) and not inputs.get(\"end_image_url\") and not inputs.get(\"end_image_path\")","tryCatchPattern":null,"preventionTips":["Enable web_search only on the pure text_to_video path","Do retrieval externally and enrich the prompt instead"],"tags":["validation","seedance","ark","web-search","input-validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}