{"record":{"id":"e4bde04cfa387a0e","repo":"ATH-MaaS/Pixelle-Video","slug":"unsupported-asset-type-for-vlm-analysis-asset-pa","errorCode":null,"errorMessage":"Unsupported asset type for VLM analysis: {asset_path}","messagePattern":"Unsupported asset type for VLM analysis: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_asset_analysis.py","lineNumber":132,"sourceCode":"        video_file = Path(video_path)\n        if not video_file.exists():\n            raise FileNotFoundError(f\"Video file not found: {video_path}\")\n\n        return await self._query_vlm(\n            prompt=prompt or self.VIDEO_PROMPT,\n            image_paths=[],\n            video_paths=[str(video_file)],\n            model=model,\n        )\n\n    async def __call__(self, asset_path: str, asset_type: Optional[str] = None, **kwargs) -> str:\n        path = Path(asset_path)\n        resolved_type = asset_type or self._get_asset_type(path)\n        if resolved_type == \"image\":\n            return await self.analyze_image(asset_path, **kwargs)\n        if resolved_type == \"video\":\n            return await self.analyze_video(asset_path, **kwargs)\n        raise ValueError(f\"Unsupported asset type for VLM analysis: {asset_path}\")\n\n    async def _query_vlm(\n        self,\n        prompt: str,\n        image_paths: list[str],\n        model: Optional[str],\n        video_paths: Optional[list[str]] = None,\n    ) -> str:\n        from pixelle_video.services.api_services.vlm_client import VLM\n\n        selected_model = (model or \"\").strip()\n        if not selected_model:\n            raise RuntimeError(\n                \"API VLM analysis requires an explicitly selected VLM model. \"\n                \"Please choose one in the asset analysis service settings.\"\n            )\n\n        logger.info(","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_asset_analysis.py#L114-L150","documentation":"The asset-analysis __call__ dispatches to analyze_image or analyze_video based on the resolved asset type; when the type is neither image nor video (unknown extension or an explicitly wrong asset_type), it raises ValueError.","triggerScenarios":"Calling __call__ with a file whose suffix is not in image_exts (.jpg/.jpeg/.png/.gif/.webp) or video_exts (.mp4/.mov/.avi/.mkv/.webm), or passing asset_type that resolves to something other than 'image'/'video'.","commonSituations":"Uploading .bmp/.tiff/.heic images, .webp variants outside the set, audio files, PDFs, or files without an extension; passing asset_type='audio' or 'document'.","solutions":["Convert the asset to a supported format (e.g. .png for images, .mp4 for videos) before analysis","Pass an explicit asset_type='image' or 'video' only when it genuinely matches the file","Check the file extension — _get_asset_type dispatches purely on suffix","Handle non-media uploads in a different service (this service is VLM image/video only)"],"exampleFix":"# before\nawait analyzer(asset_path=\"/tmp/note.pdf\")  # unknown type\n# after\nawait analyzer(asset_path=\"/tmp/cover.png\", asset_type=\"image\")","handlingStrategy":"validation","validationCode":"from pathlib import Path\nSUPPORTED = {\".jpg\",\".jpeg\",\".png\",\".gif\",\".webp\",\".mp4\",\".mov\",\".avi\",\".mkv\",\".webm\"}\np = Path(asset_path)\nif p.suffix.lower() not in SUPPORTED:\n    raise ValueError(f\"unsupported asset extension: {p.suffix}\")","typeGuard":"IMAGE_EXTS = {\".jpg\",\".jpeg\",\".png\",\".gif\",\".webp\"}\nVIDEO_EXTS = {\".mp4\",\".mov\",\".avi\",\".mkv\",\".webm\"}\ndef is_supported_asset(path: str) -> bool:\n    return Path(path).suffix.lower() in IMAGE_EXTS | VIDEO_EXTS","tryCatchPattern":"try:\n    desc = await analyzer(asset_path, asset_type=asset_type)\nexcept ValueError as e:\n    if \"Unsupported asset type\" in str(e):\n        converted = convert_to_supported_format(asset_path)\n        desc = await analyzer(converted)\n    else:\n        raise","preventionTips":["Convert/normalize uploads to supported formats (.png/.jpg images, .mp4 video) at ingestion time","Only pass asset_type='image'|'video' and only when it matches the file","Reject non-media uploads in your app before reaching the analysis service"],"tags":["validation","unsupported-format","asset-type"],"backgroundTag":"unsupported-file-type","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}