add screenshot_urls to the get_run endpoint (#2417)
This commit is contained in:
@@ -300,6 +300,10 @@ class BaseRunResponse(BaseModel):
|
|||||||
)
|
)
|
||||||
downloaded_files: list[FileInfo] | None = Field(default=None, description="List of files downloaded during the run")
|
downloaded_files: list[FileInfo] | None = Field(default=None, description="List of files downloaded during the run")
|
||||||
recording_url: str | None = Field(default=None, description="URL to the recording of the run")
|
recording_url: str | None = Field(default=None, description="URL to the recording of the run")
|
||||||
|
screenshot_urls: list[str] | None = Field(
|
||||||
|
default=None,
|
||||||
|
description="List of last n screenshot URLs in reverse chronological order - the first one the list is the latest screenshot.",
|
||||||
|
)
|
||||||
failure_reason: str | None = Field(default=None, description="Reason for failure if the run failed or terminated")
|
failure_reason: str | None = Field(default=None, description="Reason for failure if the run failed or terminated")
|
||||||
created_at: datetime = Field(description="Timestamp when this run was created", examples=["2025-01-01T00:00:00Z"])
|
created_at: datetime = Field(description="Timestamp when this run was created", examples=["2025-01-01T00:00:00Z"])
|
||||||
modified_at: datetime = Field(
|
modified_at: datetime = Field(
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ async def get_run_response(run_id: str, organization_id: str | None = None) -> R
|
|||||||
modified_at=task_v1_response.modified_at,
|
modified_at=task_v1_response.modified_at,
|
||||||
app_url=f"{settings.SKYVERN_APP_URL.rstrip('/')}/tasks/{task_v1_response.task_id}",
|
app_url=f"{settings.SKYVERN_APP_URL.rstrip('/')}/tasks/{task_v1_response.task_id}",
|
||||||
recording_url=task_v1_response.recording_url,
|
recording_url=task_v1_response.recording_url,
|
||||||
|
screenshot_urls=task_v1_response.action_screenshot_urls,
|
||||||
downloaded_files=task_v1_response.downloaded_files,
|
downloaded_files=task_v1_response.downloaded_files,
|
||||||
run_request=TaskRunRequest(
|
run_request=TaskRunRequest(
|
||||||
engine=run_engine,
|
engine=run_engine,
|
||||||
@@ -80,6 +81,7 @@ async def get_run_response(run_id: str, organization_id: str | None = None) -> R
|
|||||||
created_at=task_v2.created_at,
|
created_at=task_v2.created_at,
|
||||||
modified_at=task_v2.modified_at,
|
modified_at=task_v2.modified_at,
|
||||||
recording_url=workflow_run.recording_url if workflow_run else None,
|
recording_url=workflow_run.recording_url if workflow_run else None,
|
||||||
|
screenshot_urls=workflow_run.screenshot_urls if workflow_run else None,
|
||||||
downloaded_files=workflow_run.downloaded_files if workflow_run else None,
|
downloaded_files=workflow_run.downloaded_files if workflow_run else None,
|
||||||
app_url=f"{settings.SKYVERN_APP_URL.rstrip('/')}/workflows/{task_v2.workflow_permanent_id}/{task_v2.workflow_run_id}",
|
app_url=f"{settings.SKYVERN_APP_URL.rstrip('/')}/workflows/{task_v2.workflow_permanent_id}/{task_v2.workflow_run_id}",
|
||||||
run_request=TaskRunRequest(
|
run_request=TaskRunRequest(
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ async def get_workflow_run_response(
|
|||||||
output=workflow_run_resp.outputs,
|
output=workflow_run_resp.outputs,
|
||||||
downloaded_files=workflow_run_resp.downloaded_files,
|
downloaded_files=workflow_run_resp.downloaded_files,
|
||||||
recording_url=workflow_run_resp.recording_url,
|
recording_url=workflow_run_resp.recording_url,
|
||||||
|
screenshot_urls=workflow_run_resp.screenshot_urls,
|
||||||
failure_reason=workflow_run_resp.failure_reason,
|
failure_reason=workflow_run_resp.failure_reason,
|
||||||
app_url=app_url,
|
app_url=app_url,
|
||||||
created_at=workflow_run.created_at,
|
created_at=workflow_run.created_at,
|
||||||
|
|||||||
Reference in New Issue
Block a user