diff --git a/docling/datamodel/base_models.py b/docling/datamodel/base_models.py index 311d6d01..d19d08f7 100644 --- a/docling/datamodel/base_models.py +++ b/docling/datamodel/base_models.py @@ -1,5 +1,4 @@ from enum import Enum, auto -from io import BytesIO from typing import TYPE_CHECKING, Dict, List, Optional, Union from docling_core.types.doc import ( @@ -9,6 +8,7 @@ from docling_core.types.doc import ( Size, TableCell, ) +from docling_core.types.io import DocumentStream from PIL.Image import Image from pydantic import BaseModel, ConfigDict @@ -207,10 +207,3 @@ class Page(BaseModel): @property def image(self) -> Optional[Image]: return self.get_image(scale=self._default_image_scale) - - -class DocumentStream(BaseModel): - model_config = ConfigDict(arbitrary_types_allowed=True) - - name: str - stream: BytesIO diff --git a/poetry.lock b/poetry.lock index 9e057ed0..a0f39b5d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -896,13 +896,13 @@ files = [ [[package]] name = "docling-core" -version = "2.5.1" +version = "2.6.0" description = "A python library to define and validate data types in Docling." optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "docling_core-2.5.1-py3-none-any.whl", hash = "sha256:e4a5626520714c25a5ec2f9f7495407e730485257c2272e8467faae7357435bf"}, - {file = "docling_core-2.5.1.tar.gz", hash = "sha256:e9a7c7c46f869b13747436a2ce42df3632af655e1a3af574dfcd114e71dcbb75"}, + {file = "docling_core-2.6.0-py3-none-any.whl", hash = "sha256:feda35ad24fb01d983eda3ea817ff10062d849832532bdbadd0326152902e2ad"}, + {file = "docling_core-2.6.0.tar.gz", hash = "sha256:1aa7b13e22cecf43a3127d6874bbf5a8a4c72e4da66c2aa2a69c651cfa574d5a"}, ] [package.dependencies] @@ -913,6 +913,7 @@ pillow = ">=10.3.0,<11.0.0" pydantic = ">=2.6.0,<2.10" pyyaml = ">=5.1,<7.0.0" tabulate = ">=0.9.0,<0.10.0" +typing-extensions = ">=4.12.2,<5.0.0" [[package]] name = "docling-ibm-models" @@ -3200,6 +3201,7 @@ files = [ {file = "nh3-0.2.19-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:00810cd5275f5c3f44b9eb0e521d1a841ee2f8023622de39ffc7d88bd533d8e0"}, {file = "nh3-0.2.19-cp38-abi3-win32.whl", hash = "sha256:7e98621856b0a911c21faa5eef8f8ea3e691526c2433f9afc2be713cb6fbdb48"}, {file = "nh3-0.2.19-cp38-abi3-win_amd64.whl", hash = "sha256:75c7cafb840f24430b009f7368945cb5ca88b2b54bb384ebfba495f16bc9c121"}, + {file = "nh3-0.2.19.tar.gz", hash = "sha256:790056b54c068ff8dceb443eaefb696b84beff58cca6c07afd754d17692a4804"}, ] [[package]] @@ -6028,6 +6030,11 @@ files = [ {file = "scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f60021ec1574e56632be2a36b946f8143bf4e5e6af4a06d85281adc22938e0dd"}, {file = "scikit_learn-1.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:394397841449853c2290a32050382edaec3da89e35b3e03d6cc966aebc6a8ae6"}, {file = "scikit_learn-1.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:57cc1786cfd6bd118220a92ede80270132aa353647684efa385a74244a41e3b1"}, + {file = "scikit_learn-1.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9a702e2de732bbb20d3bad29ebd77fc05a6b427dc49964300340e4c9328b3f5"}, + {file = "scikit_learn-1.5.2-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:b0768ad641981f5d3a198430a1d31c3e044ed2e8a6f22166b4d546a5116d7908"}, + {file = "scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:178ddd0a5cb0044464fc1bfc4cca5b1833bfc7bb022d70b05db8530da4bb3dd3"}, + {file = "scikit_learn-1.5.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7284ade780084d94505632241bf78c44ab3b6f1e8ccab3d2af58e0e950f9c12"}, + {file = "scikit_learn-1.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:b7b0f9a0b1040830d38c39b91b3a44e1b643f4b36e36567b80b7c6bd2202a27f"}, {file = "scikit_learn-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:757c7d514ddb00ae249832fe87100d9c73c6ea91423802872d9e74970a0e40b9"}, {file = "scikit_learn-1.5.2-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:52788f48b5d8bca5c0736c175fa6bdaab2ef00a8f536cda698db61bd89c551c1"}, {file = "scikit_learn-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:643964678f4b5fbdc95cbf8aec638acc7aa70f5f79ee2cdad1eec3df4ba6ead8"}, @@ -7646,4 +7653,4 @@ tesserocr = ["tesserocr"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "2e7c27ffe32d556a66cc1008a7147a90c17f63b01d2a6cde3e7b941ba7e268d7" +content-hash = "6d93463a9d8ab91262b1e3947ac21ce63c2757d8b0ca68bc857516d742f1a621" diff --git a/pyproject.toml b/pyproject.toml index 4d4ceac9..7c84f763 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ packages = [{include = "docling"}] ###################### python = "^3.9" pydantic = ">=2.0.0,<2.10" -docling-core = "^2.5.1" +docling-core = "^2.6.0" docling-ibm-models = "^2.0.6" deepsearch-glm = "^0.26.1" filetype = "^1.2.0"