{"record":{"id":"bed853c306886215","repo":"BerriAI/litellm","slug":"must-provide-file-data-file-url-or-file-id","errorCode":null,"errorMessage":"Must provide file_data, file_url, or file_id","messagePattern":"Must provide file_data, file_url, or file_id","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/base_ingestion.py","lineNumber":134,"sourceCode":"            Tuple of (filename, file_content, content_type, existing_file_id)\n        \"\"\"\n        if file_data:\n            filename, file_content, content_type = file_data\n            return filename, file_content, content_type, None\n\n        if file_url:\n            http_client: Final = get_async_httpx_client(llm_provider=httpxSpecialProvider.RAG)\n            response: Final = await async_safe_get(http_client, file_url)\n            response.raise_for_status()\n            file_content = response.content\n            filename = file_url.split(\"/\")[-1] or \"document\"\n            content_type = response.headers.get(\"content-type\", \"application/octet-stream\")\n            return filename, file_content, content_type, None\n\n        if file_id:\n            return None, None, None, file_id\n\n        raise ValueError(\"Must provide file_data, file_url, or file_id\")\n\n    async def ocr(\n        self,\n        file_content: bytes | None,\n        content_type: str | None,\n    ) -> str | None:\n        \"\"\"\n        Perform OCR on file content to extract text.\n\n        Args:\n            file_content: Raw file bytes\n            content_type: MIME type of the file\n\n        Returns:\n            Extracted text or None if OCR not configured/needed\n        \"\"\"\n        if not self.ocr_config or not file_content:\n            return None","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/base_ingestion.py#L116-L152","documentation":"Input-source guard in the RAG upload flow: none of file_data (tuple), file_url, or file_id was provided, so there is no document to ingest. The endpoint requires exactly one source; supply inline file data, a fetchable URL, or a previously uploaded file id.","triggerScenarios":"Thrown at litellm/rag/ingestion/base_ingestion.py:134 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide one of file_data, file_url, or file_id in the ingestion request."],"exampleFix":null,"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"}