add browser console log (#1120)
This commit is contained in:
@@ -277,6 +277,15 @@ async def get_task(
|
|||||||
if recording_artifact:
|
if recording_artifact:
|
||||||
recording_url = await app.ARTIFACT_MANAGER.get_share_link(recording_artifact)
|
recording_url = await app.ARTIFACT_MANAGER.get_share_link(recording_artifact)
|
||||||
|
|
||||||
|
browser_console_log = await app.DATABASE.get_latest_artifact(
|
||||||
|
task_id=task_obj.task_id,
|
||||||
|
artifact_types=[ArtifactType.BROWSER_CONSOLE_LOG],
|
||||||
|
organization_id=current_org.organization_id,
|
||||||
|
)
|
||||||
|
browser_console_log_url = None
|
||||||
|
if browser_console_log:
|
||||||
|
browser_console_log_url = await app.ARTIFACT_MANAGER.get_share_link(browser_console_log)
|
||||||
|
|
||||||
# get the artifact of the last screenshot and get the screenshot_url
|
# get the artifact of the last screenshot and get the screenshot_url
|
||||||
latest_action_screenshot_artifacts = await app.DATABASE.get_latest_n_artifacts(
|
latest_action_screenshot_artifacts = await app.DATABASE.get_latest_n_artifacts(
|
||||||
task_id=task_obj.task_id,
|
task_id=task_obj.task_id,
|
||||||
@@ -315,6 +324,7 @@ async def get_task(
|
|||||||
action_screenshot_urls=latest_action_screenshot_urls,
|
action_screenshot_urls=latest_action_screenshot_urls,
|
||||||
screenshot_url=screenshot_url,
|
screenshot_url=screenshot_url,
|
||||||
recording_url=recording_url,
|
recording_url=recording_url,
|
||||||
|
browser_console_log_url=browser_console_log_url,
|
||||||
failure_reason=failure_reason,
|
failure_reason=failure_reason,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ class Task(TaskBase):
|
|||||||
action_screenshot_urls: list[str] | None = None,
|
action_screenshot_urls: list[str] | None = None,
|
||||||
screenshot_url: str | None = None,
|
screenshot_url: str | None = None,
|
||||||
recording_url: str | None = None,
|
recording_url: str | None = None,
|
||||||
|
browser_console_log_url: str | None = None,
|
||||||
failure_reason: str | None = None,
|
failure_reason: str | None = None,
|
||||||
) -> TaskResponse:
|
) -> TaskResponse:
|
||||||
return TaskResponse(
|
return TaskResponse(
|
||||||
@@ -248,6 +249,7 @@ class Task(TaskBase):
|
|||||||
action_screenshot_urls=action_screenshot_urls,
|
action_screenshot_urls=action_screenshot_urls,
|
||||||
screenshot_url=screenshot_url,
|
screenshot_url=screenshot_url,
|
||||||
recording_url=recording_url,
|
recording_url=recording_url,
|
||||||
|
browser_console_log_url=browser_console_log_url,
|
||||||
errors=self.errors,
|
errors=self.errors,
|
||||||
max_steps_per_run=self.max_steps_per_run,
|
max_steps_per_run=self.max_steps_per_run,
|
||||||
workflow_run_id=self.workflow_run_id,
|
workflow_run_id=self.workflow_run_id,
|
||||||
@@ -264,6 +266,7 @@ class TaskResponse(BaseModel):
|
|||||||
action_screenshot_urls: list[str] | None = None
|
action_screenshot_urls: list[str] | None = None
|
||||||
screenshot_url: str | None = None
|
screenshot_url: str | None = None
|
||||||
recording_url: str | None = None
|
recording_url: str | None = None
|
||||||
|
browser_console_log_url: str | None = None
|
||||||
failure_reason: str | None = None
|
failure_reason: str | None = None
|
||||||
errors: list[dict[str, Any]] = []
|
errors: list[dict[str, Any]] = []
|
||||||
max_steps_per_run: int | None = None
|
max_steps_per_run: int | None = None
|
||||||
|
|||||||
Reference in New Issue
Block a user