From ef5cb8d6714312f12922aa411ee14e11cf89074b Mon Sep 17 00:00:00 2001 From: LawyZheng Date: Thu, 20 Feb 2025 13:36:50 +0800 Subject: [PATCH] increase max file uploading number (#1794) --- skyvern/constants.py | 1 + skyvern/forge/sdk/workflow/models/block.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/skyvern/constants.py b/skyvern/constants.py index b786ac8d..de23234a 100644 --- a/skyvern/constants.py +++ b/skyvern/constants.py @@ -19,6 +19,7 @@ NAVIGATION_MAX_RETRY_TIME = 5 AUTO_COMPLETION_POTENTIAL_VALUES_COUNT = 5 DROPDOWN_MENU_MAX_DISTANCE = 100 BROWSER_DOWNLOADING_SUFFIX = ".crdownload" +MAX_UPLOAD_FILE_COUNT = 50 # reserved fields for navigation payload SPECIAL_FIELD_VERIFICATION_CODE = "verification_code" diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.py index 7af69901..7cffde14 100644 --- a/skyvern/forge/sdk/workflow/models/block.py +++ b/skyvern/forge/sdk/workflow/models/block.py @@ -25,6 +25,7 @@ from pypdf import PdfReader from pypdf.errors import PdfReadError from skyvern.config import settings +from skyvern.constants import MAX_UPLOAD_FILE_COUNT from skyvern.exceptions import ( ContextParameterValueNotFound, DisabledBlockExecutionError, @@ -1429,7 +1430,7 @@ class UploadToS3Block(Block): if os.path.isdir(self.path): # get all files in the directory, if there are more than 25 files, we will not upload them files = os.listdir(self.path) - if len(files) > 25: + if len(files) > MAX_UPLOAD_FILE_COUNT: raise ValueError("Too many files in the directory, not uploading") for file in files: # if the file is a directory, we will not upload it