Skip to content

Commit

Permalink
Merge branch 'main' into feat/rc6-rollout
Browse files Browse the repository at this point in the history
  • Loading branch information
gaya3-zipstack authored Dec 12, 2024
2 parents aff96aa + d873c72 commit edc199a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/workflow_manager/endpoint_v2/destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from connector_v2.models import ConnectorInstance
from fsspec.implementations.local import LocalFileSystem
from unstract.sdk.constants import ToolExecKey
from unstract.sdk.file_storage.constants import FileOperationParams
from unstract.sdk.tool.mime_types import EXT_MIME_MAP
from unstract.workflow_execution.constants import ToolOutputType
from utils.user_context import UserContext
Expand Down Expand Up @@ -457,7 +458,9 @@ def get_result_with_file_storage(
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}")
Expand Down

0 comments on commit edc199a

Please sign in to comment.