mirror of
https://github.com/langgenius/dify.git
synced 2026-03-28 17:40:53 +08:00
feat: add File Upload node functionality and related components
- Implemented File Upload node with support for uploading files to the sandbox. - Added necessary UI components including node panel and default configurations. - Enhanced workflow constants and enums to include File Upload. - Updated error handling for file upload operations. - Integrated File Upload into existing workflow structure, ensuring compatibility with variable handling and output management. - Added translations for new File Upload features in workflow.json.
This commit is contained in:
@ -17,7 +17,8 @@ from core.workflow.nodes.command.exc import CommandExecutionError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
COMMAND_NODE_TIMEOUT_SECONDS = 60
|
||||
# FIXME(Mairuis): The timeout value is currently hardcoded and should be made configurable in the future.
|
||||
COMMAND_NODE_TIMEOUT_SECONDS = 60 * 10
|
||||
|
||||
|
||||
class CommandNode(Node[CommandNodeData]):
|
||||
@ -71,8 +72,6 @@ class CommandNode(Node[CommandNodeData]):
|
||||
error_type="CommandNodeError",
|
||||
)
|
||||
|
||||
timeout = COMMAND_NODE_TIMEOUT_SECONDS if COMMAND_NODE_TIMEOUT_SECONDS > 0 else None
|
||||
|
||||
try:
|
||||
sandbox.wait_ready(timeout=SANDBOX_READY_TIMEOUT)
|
||||
with with_connection(sandbox.vm) as conn:
|
||||
@ -81,7 +80,7 @@ class CommandNode(Node[CommandNodeData]):
|
||||
sandbox_debug("command_node", "command", command)
|
||||
|
||||
future = submit_command(sandbox.vm, conn, command, cwd=working_directory)
|
||||
result = future.result(timeout=timeout)
|
||||
result = future.result(timeout=COMMAND_NODE_TIMEOUT_SECONDS)
|
||||
|
||||
outputs: dict[str, Any] = {
|
||||
"stdout": result.stdout.decode("utf-8", errors="replace"),
|
||||
|
||||
Reference in New Issue
Block a user