{"record":{"id":"fd52a95fc0ca90e8","repo":"BerriAI/litellm","slug":"document-url-is-required","errorCode":null,"errorMessage":"Document URL is required","messagePattern":"Document URL is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/ocr/document_intelligence/transformation.py","lineNumber":373,"sourceCode":"        \"\"\"\n        verbose_logger.debug(\"Azure Document Intelligence transform_ocr_request - model: %s\", model)\n\n        if not isinstance(document, dict):\n            raise ValueError(f\"Expected document dict, got {type(document)}\")\n\n        # Extract document URL from Mistral format\n        doc_type: Final = document.get(\"type\")\n        document_url = None\n\n        if doc_type == \"document_url\":\n            document_url = document.get(\"document_url\", \"\")\n        elif doc_type == \"image_url\":\n            document_url = document.get(\"image_url\", \"\")\n        else:\n            raise ValueError(f\"Invalid document type: {doc_type}. Must be 'document_url' or 'image_url'\")\n\n        if not document_url:\n            raise ValueError(\"Document URL is required\")\n\n        # Build Azure DI request\n        data: Final[dict[str, Any]] = {}\n\n        # Check if it's a data URI (base64)\n        if document_url.startswith(\"data:\"):\n            # Extract base64 content\n            base64_content: Final = self._extract_base64_from_data_uri(document_url)\n            data[\"base64Source\"] = base64_content\n            verbose_logger.debug(\"Using base64Source for Azure Document Intelligence\")\n        else:\n            # Regular URL\n            data[\"urlSource\"] = document_url\n            verbose_logger.debug(\"Using urlSource for Azure Document Intelligence\")\n\n        # Azure DI: `pages` is a query param (wired in get_complete_url),\n        # not a body field. Other Mistral-specific params (e.g.\n        # include_image_base64, image_limit) are unsupported and ignored.","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py#L355-L391","documentation":"Error \"Document URL is required\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/ocr/document_intelligence/transformation.py:373 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the document URL in the request."],"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"}