Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
feat(document_extractor): integrate unstructured API for PPTX extraction (#10180)
-LAN-53a7cb0e9ddb
diff --git a/api/core/workflow/nodes/document_extractor/node.py b/api/core/workflow/nodes/document_extractor/node.pyindex c2f51ad1e5e..aacee940957 100644--- a/api/core/workflow/nodes/document_extractor/node.py+++ b/api/core/workflow/nodes/document_extractor/node.py@@ -6,12 +6,14 @@ import docximport pandas as pdimport pypdfium2import yaml+from unstructured.partition.api import partition_via_apifrom unstructured.partition.email import partition_emailfrom unstructured.partition.epub import partition_epubfrom unstructured.partition.msg import partition_msgfrom unstructured.partition.ppt import partition_pptfrom unstructured.partition.pptx import partition_pptx+from configs import dify_configfrom core.file import File, FileTransferMethod, file_managerfrom core.helper import ssrf_proxyfrom core.variables import ArrayFileSegment@@ -263,7 +265,14 @@ def _extract_text_from_ppt(file_content: bytes) -> str:def _extract_text_from_pptx(file_content: bytes) -> str:try:with io.BytesIO(file_content) as file:- elements = partition_pptx(file=file)+ if dify_config.UNSTRUCTURED_API_URL and dify_config.UNSTRUCTURED_API_KEY:+ elements = partition_via_api(+ file=file,+ api_url=dify_config.UNSTRUCTURED_API_URL,+ api_key=dify_config.UNSTRUCTURED_API_KEY,+ )+ else:+ elements = partition_pptx(file=file)return "\n".join([getattr(element, "text", "") for element in elements])except Exception as e:raise TextExtractionError(f"Failed to extract text from PPTX: {str(e)}") from e