{"record":{"id":"0ebd36ce188e4f68","repo":"iflytek/astron-agent","slug":"iflyauditapi-input-media-is-not-implemented-yet","errorCode":null,"errorMessage":"IFlyAuditAPI.input_media is not implemented yet","messagePattern":"IFlyAuditAPI\\.input_media is not implemented yet","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"core/workflow/infra/audit_system/audit_api/iflytek/ifly_audit_api.py","lineNumber":438,"sourceCode":"        )\n        if resp.get(\"data\", {}).get(\"action\") != ActionEnum.NONE:\n            raise CustomException(\n                CodeEnum.AUDIT_OUTPUT_ERROR,\n                cause_error=f\"Audit result abnormal: {resp}\",\n            )\n\n    async def input_media(self, text: str, **kwargs: Any) -> None:\n        \"\"\"\n        In LLM content security scenarios, filter, detect and identify user input text,\n        images, videos, documents, etc., and process and respond accordingly based on security policies.\n        :param text: Text content to be processed\n        :param kwargs: Additional keyword arguments\n        :return: None\n        \"\"\"\n        # path = f\"/audit/v3/aichat/inputMedia\"\n\n        # TODO: To be implemented\n        raise NotImplementedError(\"IFlyAuditAPI.input_media is not implemented yet\")\n\n    async def output_media(self, text: str, **kwargs: Any) -> None:\n        \"\"\"\n        In LLM content security scenarios, filter, detect and identify LLM output images,\n        videos, audio, etc., and process and respond accordingly based on security policies.\n        :param text: Text content to be processed\n        :param kwargs: Additional keyword arguments\n        :return: None\n        \"\"\"\n        # path = f\"/audit/v3/aichat/outputMedia\"\n        # TODO: To be implemented\n        raise NotImplementedError(\"IFlyAuditAPI.output_media is not implemented yet\")\n\n    async def know_ref(self, text: str, **kwargs: Any) -> None:\n        \"\"\"\n        In LLM content security scenarios, filter, detect and identify websites, knowledge bases\n        and other data referenced during LLM responses, and process and respond accordingly based on security policies.\n        :param text: Text content to be processed","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/workflow/infra/audit_system/audit_api/iflytek/ifly_audit_api.py#L420-L456","documentation":"input_media is a stub: the endpoint path /audit/v3/aichat/inputMedia is commented out and the method immediately raises NotImplementedError. The media (image/video/audio) input audit capability has not been implemented in IFlyAuditAPI yet.","triggerScenarios":"Any call to IFlyAuditAPI.input_media(text, **kwargs), e.g. attempting to audit user-uploaded images or audio before sending them through a workflow.","commonSituations":"Developers extending the audit pipeline to multimodal content assume parity with input_text/output_text and call the media methods; feature was planned (TODO in code) but not wired up.","solutions":["Do not call input_media; gate multimodal flows on feature detection and fall back to text-only auditing.","Implement the method following output_text's pattern: build the payload, call self._post('/audit/v3/aichat/inputMedia', ...), and check data.action != ActionEnum.NONE.","Alternatively register a different audit API implementation that supports media via the audit_system abstraction."],"exampleFix":"// before\nclass MediaAuditor:\n    async def audit(self, api, media):\n        await api.input_media(media.url)  # NotImplementedError\n// after: feature-detect and fallback\nif isinstance(api, IFlyAuditAPI):\n    logger.warning(\"media audit not supported; skipping\")\n    return\nawait api.input_media(media.url)","handlingStrategy":"fallback","validationCode":"def supports_media_audit(api) -> bool:\n    return not isinstance(api, IFlyAuditAPI)","typeGuard":"def has_media_audit(api) -> bool:\n    return callable(getattr(api, 'input_media', None)) and not isinstance(api, IFlyAuditAPI)","tryCatchPattern":"try:\n    await api.input_media(media_url)\nexcept NotImplementedError:\n    logger.warning(\"media audit unavailable; using text-only audit\")\n    await api.input_text(media_caption, chat_sid, span)","preventionTips":["Check implementation status before planning multimodal audit flows","Wrap unimplemented methods with capability flags in your audit facade","Track the upstream TODO and implement via self._post when available"],"tags":["audit","not-implemented","stub","multimodal"],"backgroundTag":"method-not-implemented","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}