Script generation (#3157)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Shuchang Zheng 2025-08-10 13:16:46 -07:00 committed by GitHub
parent 19d7b951bb
commit 58bd43171e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 708 additions and 244 deletions

View file

@ -1,23 +0,0 @@
from typing import Any
from playwright.async_api import async_playwright
from skyvern.core.code_generations.skyvern_page import RunContext, SkyvernPage
from skyvern.forge.sdk.core import skyvern_context
from skyvern.webeye.browser_factory import BrowserContextFactory
# TODO: find a better name for this function
async def setup(parameters: dict[str, Any]) -> tuple[SkyvernPage, RunContext]:
# set up skyvern context
skyvern_context.set(skyvern_context.SkyvernContext())
# start playwright
pw = await async_playwright().start()
(
browser_context,
_,
_,
) = await BrowserContextFactory.create_browser_context(playwright=pw)
new_page = await browser_context.new_page()
skyvern_page = SkyvernPage(page=new_page)
return skyvern_page, RunContext(parameters=parameters, page=skyvern_page)