support browser type choice for pbs (#4406)

This commit is contained in:
LawyZheng
2026-01-07 15:39:53 +08:00
committed by GitHub
parent 058a9178aa
commit 6db8fe2ae6
8 changed files with 65 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ from skyvern.forge.sdk.schemas.persistent_browser_sessions import (
Extensions,
PersistentBrowserSession,
PersistentBrowserSessionStatus,
PersistentBrowserType,
is_final_status,
)
from skyvern.schemas.runs import ProxyLocation, ProxyLocationInput
@@ -258,6 +259,7 @@ class PersistentSessionsManager:
timeout_minutes: int | None = None,
proxy_location: ProxyLocationInput = ProxyLocation.RESIDENTIAL,
extensions: list[Extensions] | None = None,
browser_type: PersistentBrowserType | None = None,
) -> PersistentBrowserSession:
"""Create a new browser session for an organization and return its ID with the browser state."""
@@ -273,6 +275,7 @@ class PersistentSessionsManager:
timeout_minutes=timeout_minutes,
proxy_location=proxy_location,
extensions=extensions,
browser_type=browser_type,
)
return browser_session_db

View File

@@ -10,7 +10,11 @@ from skyvern.config import settings
from skyvern.constants import GET_DOWNLOADED_FILES_TIMEOUT
from skyvern.forge.sdk.artifact.storage.base import BaseStorage
from skyvern.forge.sdk.schemas.files import FileInfo
from skyvern.forge.sdk.schemas.persistent_browser_sessions import Extensions, PersistentBrowserSession
from skyvern.forge.sdk.schemas.persistent_browser_sessions import (
Extensions,
PersistentBrowserSession,
PersistentBrowserType,
)
LOG = structlog.get_logger()
@@ -50,6 +54,10 @@ class BrowserSessionResponse(BaseModel):
None,
description="A list of extensions installed in the browser session.",
)
browser_type: PersistentBrowserType | None = Field(
default=None,
description="The type of browser used for the session.",
)
vnc_streaming_supported: bool = Field(False, description="Whether the browser session supports VNC streaming")
download_path: str | None = Field(None, description="The path where the browser session downloads files")
downloaded_files: list[FileInfo] | None = Field(
@@ -131,4 +139,5 @@ class BrowserSessionResponse(BaseModel):
downloaded_files=downloaded_files,
recordings=recordings,
extensions=browser_session.extensions,
browser_type=browser_session.browser_type,
)