mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 19:50:42 +00:00
Use persistent browser session in runnables (#1510)
Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com> Co-authored-by: Shuchang Zheng <shu@skyvern.com>
This commit is contained in:
parent
5ed7e5ad8e
commit
a4744ed9f5
12 changed files with 506 additions and 59 deletions
|
|
@ -25,6 +25,7 @@ class AsyncExecutor(abc.ABC):
|
|||
organization_id: str,
|
||||
max_steps_override: int | None,
|
||||
api_key: str | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
pass
|
||||
|
|
@ -39,6 +40,7 @@ class AsyncExecutor(abc.ABC):
|
|||
workflow_run_id: str,
|
||||
max_steps_override: int | None,
|
||||
api_key: str | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
pass
|
||||
|
|
@ -51,6 +53,7 @@ class AsyncExecutor(abc.ABC):
|
|||
organization_id: str,
|
||||
observer_cruise_id: str,
|
||||
max_iterations_override: int | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
pass
|
||||
|
|
@ -65,10 +68,13 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
organization_id: str,
|
||||
max_steps_override: int | None,
|
||||
api_key: str | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
LOG.info("Executing task using background task executor", task_id=task_id)
|
||||
|
||||
close_browser_on_completion = browser_session_id is None
|
||||
|
||||
organization = await app.DATABASE.get_organization(organization_id)
|
||||
if organization is None:
|
||||
raise OrganizationNotFound(organization_id)
|
||||
|
|
@ -98,6 +104,8 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
task,
|
||||
step,
|
||||
api_key,
|
||||
close_browser_on_completion=close_browser_on_completion,
|
||||
browser_session_id=browser_session_id,
|
||||
)
|
||||
|
||||
async def execute_workflow(
|
||||
|
|
@ -109,6 +117,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
workflow_run_id: str,
|
||||
max_steps_override: int | None,
|
||||
api_key: str | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
LOG.info(
|
||||
|
|
@ -126,6 +135,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
workflow_run_id=workflow_run_id,
|
||||
api_key=api_key,
|
||||
organization=organization,
|
||||
browser_session_id=browser_session_id,
|
||||
)
|
||||
|
||||
async def execute_cruise(
|
||||
|
|
@ -135,6 +145,7 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
organization_id: str,
|
||||
observer_cruise_id: str,
|
||||
max_iterations_override: int | None,
|
||||
browser_session_id: str | None,
|
||||
**kwargs: dict,
|
||||
) -> None:
|
||||
LOG.info(
|
||||
|
|
@ -169,4 +180,5 @@ class BackgroundTaskExecutor(AsyncExecutor):
|
|||
organization=organization,
|
||||
observer_cruise_id=observer_cruise_id,
|
||||
max_iterations_override=max_iterations_override,
|
||||
browser_session_id=browser_session_id,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue