{"record":{"id":"68fcaf05313f05df","repo":"HKUDS/DeepTutor","slug":"media-id-is-required","errorCode":null,"errorMessage":"media_id is required.","messagePattern":"media_id is required\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/ima/tools.py","lineNumber":211,"sourceCode":"                \"Use it when a retrieved snippet is too short to answer from.\"\n            ),\n            parameters=[\n                ToolParameter(\n                    name=\"media_id\",\n                    type=\"string\",\n                    description=\"Item id from ima_list or a retrieval result.\",\n                ),\n                _KB_NAME_PARAM,\n            ],\n        )\n\n    async def _run(self, client, binding, kwargs):\n        from deeptutor.services.rag.pipelines.ima import media as media_ops\n        from deeptutor.services.rag.pipelines.ima import sources as source_policy\n\n        media_id = str(kwargs.get(\"media_id\") or \"\").strip()\n        if not media_id:\n            raise ValueError(\"media_id is required.\")\n        media = await client.get_media_content(media_id)\n        text = await media_ops.extract_text(\n            media,\n            max_chars=source_policy.MAX_FULLTEXT_CHARS,\n        )\n        if not text:\n            return _err(\n                \"That item has no readable text — it may be an image, an audio file, \"\n                \"or a format Tencent IMA does not expose over the API.\"\n            )\n        return _ok(\n            {\n                \"knowledge_base\": binding.name,\n                \"media_id\": media_id,\n                \"truncated\": len(text) >= source_policy.MAX_FULLTEXT_CHARS,\n                \"content\": text,\n            }\n        )","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/ima/tools.py#L193-L229","documentation":"Error \"media_id is required.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/ima/tools.py:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}