From 72d109854df601f259b56693b177f58391240dde Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Sun, 14 Apr 2024 23:07:41 -0700 Subject: [PATCH] add get_aio_task interface to get a specific aio task from the async operation pool (#191) --- skyvern/forge/async_operations.py | 3 +++ skyvern/forge/prompts/skyvern/extract-action.j2 | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/skyvern/forge/async_operations.py b/skyvern/forge/async_operations.py index 8f30098f..8b91aa70 100644 --- a/skyvern/forge/async_operations.py +++ b/skyvern/forge/async_operations.py @@ -93,6 +93,9 @@ class AsyncOperationPool: """ return [aio_task for aio_task in self._aio_tasks.get(task_id, {}).values() if not aio_task.done()] + def get_aio_task(self, task_id: str, operation_type: str) -> asyncio.Task | None: + return self._aio_tasks.get(task_id, {}).get(operation_type, None) + def run_operation(self, task_id: str, agent_phase: AgentPhase) -> None: # get the operation from the pool operation = self._get_operation(task_id, agent_phase) diff --git a/skyvern/forge/prompts/skyvern/extract-action.j2 b/skyvern/forge/prompts/skyvern/extract-action.j2 index 2195241b..eb967ba0 100644 --- a/skyvern/forge/prompts/skyvern/extract-action.j2 +++ b/skyvern/forge/prompts/skyvern/extract-action.j2 @@ -6,10 +6,6 @@ Each element is tagged with an ID. If you see any information in red in the page screenshot, this means a condition wasn't satisfied. prioritize actions with the red information. If you see a popup in the page screenshot, prioritize actions on the popup. -{% if "lever" in starting_url %} -DO NOT UPDATE ANY LOCATION FIELDS -{% endif %} - Reply in JSON format with the following keys: { "actions": array // An array of actions. Here's the format of each action: