From 32cde81d2493f60e73dc3cebb46de9823bd6d0cc Mon Sep 17 00:00:00 2001 From: Hisir0909 Date: Thu, 26 Dec 2024 13:31:13 +0800 Subject: [PATCH] format code --- api/core/workflow/nodes/document_extractor/node.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/document_extractor/node.py b/api/core/workflow/nodes/document_extractor/node.py index db2ad8d907a165..b57459c5bae12d 100644 --- a/api/core/workflow/nodes/document_extractor/node.py +++ b/api/core/workflow/nodes/document_extractor/node.py @@ -11,6 +11,8 @@ import pandas as pd import pypdfium2 # type: ignore import yaml # type: ignore +from docx.table import Table +from docx.text.paragraph import Paragraph from configs import dify_config from core.file import File, FileTransferMethod, file_manager @@ -192,7 +194,7 @@ def _extract_text_from_doc(file_content: bytes) -> str: text = [] # Keep track of paragraph and table positions - content_items = [] + content_items: list[tuple[int, str, Table | Paragraph]] = [] # Process paragraphs and tables for i, paragraph in enumerate(doc.paragraphs):