fix SkyvernClient (#2055)

This commit is contained in:
Shuchang Zheng
2025-03-31 22:35:16 -04:00
committed by GitHub
parent ead1e4ba59
commit 59d2eb9df7
2 changed files with 7 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ class SkyvernClient:
publish_workflow: bool = False,
) -> TaskRunResponse:
task_run_obj = await self.client.agent.run_task(
goal=prompt,
prompt=prompt,
url=url,
title=title,
engine=engine,
@@ -42,7 +42,7 @@ class SkyvernClient:
browser_session_id=browser_session_id,
publish_workflow=publish_workflow,
)
return TaskRunResponse.model_validate(task_run_obj)
return TaskRunResponse.model_validate(task_run_obj.dict())
async def run_workflow(
self,
@@ -65,7 +65,7 @@ class SkyvernClient:
browser_session_id=browser_session_id,
template=template,
)
return WorkflowRunResponse.model_validate(workflow_run_obj)
return WorkflowRunResponse.model_validate(workflow_run_obj.dict())
async def get_run(
self,
@@ -73,7 +73,7 @@ class SkyvernClient:
) -> RunResponse:
run_obj = await self.client.agent.get_run(run_id=run_id)
if run_obj.run_type in [RunType.task_v1, RunType.task_v2]:
return TaskRunResponse.model_validate(run_obj)
return TaskRunResponse.model_validate(run_obj.dict())
elif run_obj.run_type == RunType.workflow_run:
return WorkflowRunResponse.model_validate(run_obj)
return WorkflowRunResponse.model_validate(run_obj.dict())
raise ValueError(f"Invalid run type: {run_obj.run_type}")

View File

@@ -1475,7 +1475,7 @@ async def run_task(
try:
task_v2 = await task_v2_service.initialize_task_v2(
organization=current_org,
user_prompt=run_request.goal,
user_prompt=run_request.prompt,
user_url=run_request.url,
totp_identifier=run_request.totp_identifier,
totp_verification_url=run_request.totp_url,
@@ -1504,7 +1504,7 @@ async def run_task(
run_type=RunType.task_v2,
status=str(task_v2.status),
output=task_v2.output,
failure_reason=task_v2.failure_reason,
failure_reason=None,
created_at=task_v2.created_at,
modified_at=task_v2.modified_at,
run_request=TaskRunRequest(