optimize async task and remove hover (#1095)

This commit is contained in:
LawyZheng
2024-10-31 10:49:02 +08:00
committed by GitHub
parent 326e749f83
commit 00549c921b
4 changed files with 32 additions and 18 deletions

View File

@@ -209,8 +209,8 @@ class ForgeAgent:
)
return task
def register_async_operations(self, organization: Organization, task: Task, page: Page) -> None:
operations = app.AGENT_FUNCTION.generate_async_operations(organization, task, page)
async def register_async_operations(self, organization: Organization, task: Task, page: Page) -> None:
operations = await app.AGENT_FUNCTION.generate_async_operations(organization, task, page)
self.async_operation_pool.add_operations(task.task_id, operations)
async def execute_step(
@@ -273,7 +273,7 @@ class ForgeAgent:
) = await self._initialize_execution_state(task, step, workflow_run)
if page := await browser_state.get_working_page():
self.register_async_operations(organization, task, page)
await self.register_async_operations(organization, task, page)
step, detailed_output = await self.agent_step(
task, step, browser_state, organization=organization, task_block=task_block

View File

@@ -303,7 +303,7 @@ class AgentFunction:
"""
return
def generate_async_operations(
async def generate_async_operations(
self,
organization: Organization,
task: Task,