speculative step with mouse movement (#4679)
This commit is contained in:
@@ -1795,6 +1795,7 @@ class ForgeAgent:
|
|||||||
|
|
||||||
async def _speculate_next_step_plan(
|
async def _speculate_next_step_plan(
|
||||||
self,
|
self,
|
||||||
|
organization: Organization,
|
||||||
task: Task,
|
task: Task,
|
||||||
current_step: Step,
|
current_step: Step,
|
||||||
next_step: Step,
|
next_step: Step,
|
||||||
@@ -1812,6 +1813,9 @@ class ForgeAgent:
|
|||||||
try:
|
try:
|
||||||
next_step.is_speculative = True
|
next_step.is_speculative = True
|
||||||
|
|
||||||
|
if page := await browser_state.get_working_page():
|
||||||
|
await self.register_async_operations(organization, task, page)
|
||||||
|
|
||||||
scraped_page, extract_action_prompt, use_caching, prompt_name = await self.build_and_record_step_prompt(
|
scraped_page, extract_action_prompt, use_caching, prompt_name = await self.build_and_record_step_prompt(
|
||||||
task,
|
task,
|
||||||
next_step,
|
next_step,
|
||||||
@@ -1830,6 +1834,8 @@ class ForgeAgent:
|
|||||||
default=app.LLM_API_HANDLER,
|
default=app.LLM_API_HANDLER,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.async_operation_pool.run_operation(task.task_id, AgentPhase.llm)
|
||||||
|
|
||||||
llm_json_response = await llm_api_handler(
|
llm_json_response = await llm_api_handler(
|
||||||
prompt=extract_action_prompt,
|
prompt=extract_action_prompt,
|
||||||
prompt_name=prompt_name,
|
prompt_name=prompt_name,
|
||||||
@@ -3766,6 +3772,7 @@ class ForgeAgent:
|
|||||||
|
|
||||||
speculative_task = asyncio.create_task(
|
speculative_task = asyncio.create_task(
|
||||||
self._speculate_next_step_plan(
|
self._speculate_next_step_plan(
|
||||||
|
organization=organization,
|
||||||
task=task,
|
task=task,
|
||||||
current_step=step,
|
current_step=step,
|
||||||
next_step=next_step,
|
next_step=next_step,
|
||||||
|
|||||||
Reference in New Issue
Block a user