chore: switch to docling-core Markdown export (#14)

Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com>
This commit is contained in:
Panos Vagenas
2024-07-18 16:10:05 +02:00
committed by GitHub
parent 28d1c746a6
commit eb0b208272
3 changed files with 7 additions and 10 deletions

View File

@@ -3,7 +3,6 @@ from io import BytesIO
from pathlib import Path, PurePath
from typing import ClassVar, Dict, Iterable, List, Optional, Type, Union
from deepsearch.documents.core.export import export_to_markdown
from docling_core.types import BaseCell, BaseText
from docling_core.types import BoundingBox as DsBoundingBox
from docling_core.types import Document as DsDocument
@@ -299,9 +298,7 @@ class ConvertedDocument(BaseModel):
def render_as_markdown(self):
if self.output:
return export_to_markdown(
self.output.model_dump(by_alias=True, exclude_none=True)
)
return self.output.export_to_markdown()
else:
return ""