mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +00:00
use requests instead of httpx
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
fdb2191bdb
commit
b686e5ab88
@ -3,7 +3,7 @@ import io
|
|||||||
import logging
|
import logging
|
||||||
from typing import Iterable, List, Optional
|
from typing import Iterable, List, Optional
|
||||||
|
|
||||||
import httpx
|
import requests
|
||||||
from docling_core.types.doc import PictureItem
|
from docling_core.types.doc import PictureItem
|
||||||
from docling_core.types.doc.document import ( # TODO: move import to docling_core.types.doc
|
from docling_core.types.doc.document import ( # TODO: move import to docling_core.types.doc
|
||||||
PictureDescriptionData,
|
PictureDescriptionData,
|
||||||
@ -90,13 +90,13 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel):
|
|||||||
**self.options.params,
|
**self.options.params,
|
||||||
}
|
}
|
||||||
|
|
||||||
r = httpx.post(
|
r = requests.post(
|
||||||
str(self.options.url),
|
str(self.options.url),
|
||||||
headers=self.options.headers,
|
headers=self.options.headers,
|
||||||
json=payload,
|
json=payload,
|
||||||
timeout=self.options.timeout,
|
timeout=self.options.timeout,
|
||||||
)
|
)
|
||||||
if not r.is_success:
|
if not r.ok:
|
||||||
_log.error(f"Error calling the API. Reponse was {r.text}")
|
_log.error(f"Error calling the API. Reponse was {r.text}")
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user