LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
[MERGE-WITH-SDK-ROLL-RC6] updated logic for getting mimetype according to the sdk changes (#884)
alid873c72bfa72
diff --git a/backend/workflow_manager/endpoint_v2/destination.py b/backend/workflow_manager/endpoint_v2/destination.pyindex 2375cf801..627b254c9 100644--- a/backend/workflow_manager/endpoint_v2/destination.py+++ b/backend/workflow_manager/endpoint_v2/destination.py@@ -10,6 +10,7 @@ import magicfrom connector_v2.models import ConnectorInstancefrom fsspec.implementations.local import LocalFileSystemfrom unstract.sdk.constants import ToolExecKey+from unstract.sdk.file_storage.constants import FileOperationParamsfrom unstract.sdk.tool.mime_types import EXT_MIME_MAPfrom unstract.workflow_execution.constants import ToolOutputTypefrom utils.user_context import UserContext@@ -457,7 +458,9 @@ class DestinationConnector(BaseConnector):file_storage = file_system.get_file_storage()try:# TODO: SDK handles validation; consider removing here.- file_type = file_storage.mime_type(output_file)+ file_type = file_storage.mime_type(+ path=output_file, read_length=FileOperationParams.READ_ENTIRE_LENGTH+ )if output_type == ToolOutputType.JSON:if file_type != EXT_MIME_MAP[ToolOutputType.JSON.lower()]:logger.error(f"Output type json mismatched {file_type}")