refac/fix: docling auth

This commit is contained in:
Timothy Jaeryang Baek 2025-12-06 08:06:42 -05:00
parent dcdbafa5ae
commit 7e6b8a9a71

View file

@ -144,19 +144,17 @@ class DoclingLoader:
with open(self.file_path, "rb") as f: with open(self.file_path, "rb") as f:
headers = {} headers = {}
if self.api_key: if self.api_key:
headers["Authorization"] = f"Bearer {self.api_key}" headers["X-Api-Key"] = f"Bearer {self.api_key}"
r = requests.post(
f"{self.url}/v1/convert/file",
files={ files={
"files": ( "files": (
self.file_path, self.file_path,
f, f,
self.mime_type or "application/octet-stream", self.mime_type or "application/octet-stream",
) )
} },
r = requests.post(
f"{self.url}/v1/convert/file",
files=files,
data={ data={
"image_export_mode": "placeholder", "image_export_mode": "placeholder",
**self.params, **self.params,