{"record":{"id":"3f6abd27668f9643","repo":"BerriAI/litellm","slug":"transform-ocr-response-must-be-implemented-by-prov","errorCode":null,"errorMessage":"transform_ocr_response must be implemented by provider","messagePattern":"transform_ocr_response must be implemented by provider","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/llms/base_llm/ocr/transformation.py","lineNumber":222,"sourceCode":"            model=model,\n            document=document,\n            optional_params=optional_params,\n            headers=headers,\n            **kwargs,\n        )\n\n    def transform_ocr_response(\n        self,\n        model: str,\n        raw_response: httpx.Response,\n        logging_obj: LiteLLMLoggingObj,\n        **kwargs,\n    ) -> OCRResponse:\n        \"\"\"\n        Transform provider-specific OCR response to standard format.\n        Override in provider-specific implementations.\n        \"\"\"\n        raise NotImplementedError(\"transform_ocr_response must be implemented by provider\")\n\n    async def async_transform_ocr_response(\n        self,\n        model: str,\n        raw_response: httpx.Response,\n        logging_obj: LiteLLMLoggingObj,\n        **kwargs,\n    ) -> OCRResponse:\n        \"\"\"\n        Async transform provider-specific OCR response to standard format.\n        Optional method - providers can override if they need async transformations\n        (e.g., Azure Document Intelligence for async operation polling).\n\n        Default implementation falls back to sync transform_ocr_response.\n\n        Args:\n            model: Model name\n            raw_response: Raw HTTP response","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/base_llm/ocr/transformation.py#L204-L240","documentation":"Error \"transform_ocr_response must be implemented by provider\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/base_llm/ocr/transformation.py:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a provider that implements OCR; transform_ocr_response is abstract in the base class.","Implement transform_ocr_response in the custom provider's transformation class.","Verify the model string routes to a provider with OCR support."],"exampleFix":null,"handlingStrategy":null,"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-23T08:17:48.524Z"}