reenbale the download action (#4299)

This commit is contained in:
LawyZheng
2025-12-15 14:30:32 +08:00
committed by GitHub
parent 6178a20824
commit ce717146f3
9 changed files with 208 additions and 37 deletions

View File

@@ -246,13 +246,15 @@ class UploadFileAction(WebAction):
return f"UploadFileAction(element_id={self.element_id}, file={self.file_url}, is_upload_file_tag={self.is_upload_file_tag})"
# this is a deprecated action type
class DownloadFileAction(WebAction):
# This action is deprecated in 'extract-actions' prompt. Only used for the download action triggered by the code.
class DownloadFileAction(Action):
action_type: ActionType = ActionType.DOWNLOAD_FILE
file_name: str
byte: Annotated[bytes | None, Field(exclude=True)] = None # bytes data
download_url: str | None = None # URL to download file from
def __repr__(self) -> str:
return f"DownloadFileAction(element_id={self.element_id}, file_name={self.file_name})"
return f"DownloadFileAction(file_name={self.file_name}, download_url={self.download_url}, has_byte={self.byte is not None})"
class NullAction(Action):