task v2 refactor part 8: observer_task -> task_v2 in backend code (#1820)

This commit is contained in:
Shuchang Zheng
2025-02-23 22:17:28 -08:00
committed by GitHub
parent 148693aa25
commit b1de14e2fe
9 changed files with 132 additions and 132 deletions

View File

@@ -260,7 +260,7 @@ class Evaluator:
)
extracted_information: list | dict[str, Any] | str | None = None
if workflow_run_response.observer_task is None:
if workflow_run_response.task_v2 is None:
assert workflow_run_response.outputs and len(workflow_run_response.outputs) > 0, (
f"Expected {workflow_pid + '/' + workflow_run_id} with output, but got empty output"
)
@@ -272,10 +272,10 @@ class Evaluator:
# FIXME: improve this when the last block is loop block
extracted_information = result
else:
workflow_run_response.observer_task.summary
workflow_run_response.observer_task.output
summary = f"{('summary:' + workflow_run_response.observer_task.summary) if workflow_run_response.observer_task.summary else ''}"
output = f"{('output: ' + json.dumps(workflow_run_response.observer_task.output)) if workflow_run_response.observer_task.output else ''}"
workflow_run_response.task_v2.summary
workflow_run_response.task_v2.output
summary = f"{('summary:' + workflow_run_response.task_v2.summary) if workflow_run_response.task_v2.summary else ''}"
output = f"{('output: ' + json.dumps(workflow_run_response.task_v2.output)) if workflow_run_response.task_v2.output else ''}"
extracted_information = ""
if summary:
extracted_information = summary

View File

@@ -51,8 +51,8 @@ def main(
{
"workflow_permanent_id": workflow_pid,
"status": str(workflow_run_response.status),
"summary": workflow_run_response.observer_task.summary,
"output": workflow_run_response.observer_task.output,
"summary": workflow_run_response.task_v2.summary,
"output": workflow_run_response.task_v2.output,
"assertion": workflow_run_response.status == WorkflowRunStatus.completed,
"failure_reason": workflow_run_response.failure_reason or "",
}

View File

@@ -36,8 +36,8 @@ async def process_record(client: SkyvernClient, one_record: dict[str, Any]) -> d
one_record.update(
{
"status": str(workflow_run_response.status),
"summary": workflow_run_response.observer_task.summary,
"output": workflow_run_response.observer_task.output,
"summary": workflow_run_response.task_v2.summary,
"output": workflow_run_response.task_v2.output,
}
)
if workflow_run_response.status != WorkflowRunStatus.completed: