Store screenshot artifacts, generate URLs when needed (#4506)
This commit is contained in:
@@ -404,13 +404,15 @@ class TaskOutput(BaseModel):
|
||||
downloaded_file_urls: list[str] | None = None # For backward compatibility
|
||||
task_screenshots: list[str] | None = None
|
||||
workflow_screenshots: list[str] | None = None
|
||||
task_screenshot_artifact_ids: list[str] | None = None
|
||||
workflow_screenshot_artifact_ids: list[str] | None = None
|
||||
|
||||
@staticmethod
|
||||
def from_task(
|
||||
task: Task,
|
||||
downloaded_files: list[FileInfo] | None = None,
|
||||
task_screenshots: list[str] | None = None,
|
||||
workflow_screenshots: list[str] | None = None,
|
||||
task_screenshot_artifact_ids: list[str] | None = None,
|
||||
workflow_screenshot_artifact_ids: list[str] | None = None,
|
||||
) -> TaskOutput:
|
||||
# For backward compatibility, extract just the URLs from FileInfo objects
|
||||
downloaded_file_urls = [file_info.url for file_info in downloaded_files] if downloaded_files else None
|
||||
@@ -423,8 +425,8 @@ class TaskOutput(BaseModel):
|
||||
errors=task.errors,
|
||||
downloaded_files=downloaded_files,
|
||||
downloaded_file_urls=downloaded_file_urls,
|
||||
task_screenshots=task_screenshots,
|
||||
workflow_screenshots=workflow_screenshots,
|
||||
task_screenshot_artifact_ids=task_screenshot_artifact_ids,
|
||||
workflow_screenshot_artifact_ids=workflow_screenshot_artifact_ids,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user