{"record":{"id":"9477529bc23189b3","repo":"BerriAI/litellm","slug":"reducto-expected-ocr-preprocessing-to-produce-docu","errorCode":null,"errorMessage":"Reducto expected OCR preprocessing to produce document_url or image_url for model={model}","messagePattern":"Reducto expected OCR preprocessing to produce document_url or image_url for model=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/reducto/ocr/transformation.py","lineNumber":71,"sourceCode":"            \"Authorization\": f\"Bearer {resolved_key}\",\n            \"Content-Type\": \"application/json\",\n            **headers,\n        }\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        model: str,\n        optional_params: dict,\n        litellm_params: dict | None = None,\n        **kwargs,\n    ) -> str:\n        return \"{}/parse\".format((api_base or REDUCTO_API_BASE).rstrip(\"/\"))\n\n    def _get_source_url(self, document: DocumentType, model: str) -> str:\n        source_url: Final = document.get(\"document_url\") or document.get(\"image_url\")\n        if source_url is None:\n            raise ValueError(\n                f\"Reducto expected OCR preprocessing to produce document_url or image_url for model={model}\"\n            )\n        return source_url\n\n    @staticmethod\n    def _resolve_credentials(api_key: str | None, api_base: str | None) -> tuple[str, str]:\n        from litellm.secret_managers.main import get_secret_str\n\n        resolved_key: Final = api_key or get_secret_str(\"REDUCTO_API_KEY\")\n        if resolved_key is None:\n            raise ValueError(\n                \"Missing REDUCTO_API_KEY - set it in the environment or pass api_key to litellm.ocr()/litellm.aocr()\"\n            )\n        resolved_base: Final = (api_base or REDUCTO_API_BASE).rstrip(\"/\")\n        return resolved_key, resolved_base\n\n    def _ensure_file_id_sync(\n        self,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/reducto/ocr/transformation.py#L53-L89","documentation":"Preprocessing guard in the Reducto OCR transformation: the supplied DocumentType contains neither document_url nor image_url, so there is no source to send to the /parse endpoint and the request is rejected before URL construction.","triggerScenarios":"Triggered when Reducto OCR preprocessing fails to produce a document_url or image_url for the requested model.","commonSituations":"See trigger scenarios.","solutions":["Ensure the OCR preprocessing step yields a document_url or image_url for the chosen model.","Pass a supported input (document or image) for the specified Reducto model."],"exampleFix":"# provide a file or URL that preprocessing converts to document_url/image_url.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}