Closed capsenz closed 1 week ago
The documentation for DocumentStream in the "Convert from binary PDF streams" contains some wrong naming.
from io import BytesIO from docling.datamodel.base_models import DocumentStream from docling.document_converter import DocumentConverter buf = BytesIO(your_binary_stream) source = DocumentStream(name="my_doc.pdf", stream=buf) converter = DocumentConverter() result = converter.convert(source)
instead of
from io import BytesIO from docling.datamodel.base_models import DocumentStream from docling.document_converter import DocumentConverter buf = BytesIO(your_binary_stream) source = DocumentStream(filename="my_doc.pdf", stream=buf) converter = DocumentConverter() result = converter.convert(source)
...
Ran the example and got a Pydantic error. ...
Docling version: 2.5.2 ...
Python 3.12.7 ...
Well spotted and thanks for the fix.
Bug
The documentation for DocumentStream in the "Convert from binary PDF streams" contains some wrong naming.
instead of
...
Steps to reproduce
Ran the example and got a Pydantic error. ...
Docling version
Docling version: 2.5.2 ...
Python version
Python 3.12.7 ...