Publish npm package using Trusted Publisher (#3953)

This commit is contained in:
Stanislav Novosad
2025-11-10 13:51:53 -07:00
committed by GitHub
parent af88a7912b
commit e3cd3eeae0
43 changed files with 2143 additions and 290 deletions

View File

@@ -41,6 +41,7 @@ if typing.TYPE_CHECKING:
BitwardenSensitiveInformationParameter,
BitwardenSensitiveInformationParameterYaml,
BlockType,
BrowserProfile,
BrowserSessionResponse,
ClickAction,
ClickActionData,
@@ -468,7 +469,7 @@ if typing.TYPE_CHECKING:
WorkflowStatus,
)
from .errors import BadRequestError, ForbiddenError, NotFoundError, UnprocessableEntityError
from . import scripts, workflows
from . import browser_profiles, scripts, workflows
from .client import AsyncSkyvern, Skyvern
from .environment import SkyvernEnvironment
from .version import __version__
@@ -509,6 +510,7 @@ _dynamic_imports: typing.Dict[str, str] = {
"BitwardenSensitiveInformationParameter": ".types",
"BitwardenSensitiveInformationParameterYaml": ".types",
"BlockType": ".types",
"BrowserProfile": ".types",
"BrowserSessionResponse": ".types",
"ClickAction": ".types",
"ClickActionData": ".types",
@@ -940,6 +942,7 @@ _dynamic_imports: typing.Dict[str, str] = {
"WorkflowRunTimelineType": ".types",
"WorkflowStatus": ".types",
"__version__": ".version",
"browser_profiles": ".browser_profiles",
"scripts": ".scripts",
"workflows": ".workflows",
}
@@ -1003,6 +1006,7 @@ __all__ = [
"BitwardenSensitiveInformationParameter",
"BitwardenSensitiveInformationParameterYaml",
"BlockType",
"BrowserProfile",
"BrowserSessionResponse",
"ClickAction",
"ClickActionData",
@@ -1434,6 +1438,7 @@ __all__ = [
"WorkflowRunTimelineType",
"WorkflowStatus",
"__version__",
"browser_profiles",
"scripts",
"workflows",
]

View File

@@ -0,0 +1,4 @@
# This file was auto-generated by Fern from our API Definition.
# isort: skip_file

View File

@@ -0,0 +1,379 @@
# This file was auto-generated by Fern from our API Definition.
import typing
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.browser_profile import BrowserProfile
from .raw_client import AsyncRawBrowserProfilesClient, RawBrowserProfilesClient
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
class BrowserProfilesClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._raw_client = RawBrowserProfilesClient(client_wrapper=client_wrapper)
@property
def with_raw_response(self) -> RawBrowserProfilesClient:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
RawBrowserProfilesClient
"""
return self._raw_client
def list_browser_profiles(
self, *, include_deleted: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
) -> typing.List[BrowserProfile]:
"""
Get all browser profiles for the organization
Parameters
----------
include_deleted : typing.Optional[bool]
Include deleted browser profiles
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[BrowserProfile]
Successful Response
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.browser_profiles.list_browser_profiles(
include_deleted=True,
)
"""
_response = self._raw_client.list_browser_profiles(
include_deleted=include_deleted, request_options=request_options
)
return _response.data
def create_browser_profile(
self,
*,
name: str,
description: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> BrowserProfile:
"""
Parameters
----------
name : str
Name for the browser profile
description : typing.Optional[str]
Optional profile description
browser_session_id : typing.Optional[str]
Persistent browser session to convert into a profile
workflow_run_id : typing.Optional[str]
Workflow run whose persisted session should be captured
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
BrowserProfile
Successful Response
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.browser_profiles.create_browser_profile(
name="name",
)
"""
_response = self._raw_client.create_browser_profile(
name=name,
description=description,
browser_session_id=browser_session_id,
workflow_run_id=workflow_run_id,
request_options=request_options,
)
return _response.data
def get_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BrowserProfile:
"""
Get a specific browser profile by ID
Parameters
----------
profile_id : str
The ID of the browser profile. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
BrowserProfile
Successfully retrieved browser profile
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.browser_profiles.get_browser_profile(
profile_id="bp_123456",
)
"""
_response = self._raw_client.get_browser_profile(profile_id, request_options=request_options)
return _response.data
def delete_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> None:
"""
Delete a browser profile (soft delete)
Parameters
----------
profile_id : str
The ID of the browser profile to delete. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
None
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.browser_profiles.delete_browser_profile(
profile_id="bp_123456",
)
"""
_response = self._raw_client.delete_browser_profile(profile_id, request_options=request_options)
return _response.data
class AsyncBrowserProfilesClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._raw_client = AsyncRawBrowserProfilesClient(client_wrapper=client_wrapper)
@property
def with_raw_response(self) -> AsyncRawBrowserProfilesClient:
"""
Retrieves a raw implementation of this client that returns raw responses.
Returns
-------
AsyncRawBrowserProfilesClient
"""
return self._raw_client
async def list_browser_profiles(
self, *, include_deleted: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
) -> typing.List[BrowserProfile]:
"""
Get all browser profiles for the organization
Parameters
----------
include_deleted : typing.Optional[bool]
Include deleted browser profiles
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.List[BrowserProfile]
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.browser_profiles.list_browser_profiles(
include_deleted=True,
)
asyncio.run(main())
"""
_response = await self._raw_client.list_browser_profiles(
include_deleted=include_deleted, request_options=request_options
)
return _response.data
async def create_browser_profile(
self,
*,
name: str,
description: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> BrowserProfile:
"""
Parameters
----------
name : str
Name for the browser profile
description : typing.Optional[str]
Optional profile description
browser_session_id : typing.Optional[str]
Persistent browser session to convert into a profile
workflow_run_id : typing.Optional[str]
Workflow run whose persisted session should be captured
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
BrowserProfile
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.browser_profiles.create_browser_profile(
name="name",
)
asyncio.run(main())
"""
_response = await self._raw_client.create_browser_profile(
name=name,
description=description,
browser_session_id=browser_session_id,
workflow_run_id=workflow_run_id,
request_options=request_options,
)
return _response.data
async def get_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> BrowserProfile:
"""
Get a specific browser profile by ID
Parameters
----------
profile_id : str
The ID of the browser profile. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
BrowserProfile
Successfully retrieved browser profile
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.browser_profiles.get_browser_profile(
profile_id="bp_123456",
)
asyncio.run(main())
"""
_response = await self._raw_client.get_browser_profile(profile_id, request_options=request_options)
return _response.data
async def delete_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> None:
"""
Delete a browser profile (soft delete)
Parameters
----------
profile_id : str
The ID of the browser profile to delete. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
None
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.browser_profiles.delete_browser_profile(
profile_id="bp_123456",
)
asyncio.run(main())
"""
_response = await self._raw_client.delete_browser_profile(profile_id, request_options=request_options)
return _response.data

View File

@@ -0,0 +1,507 @@
# This file was auto-generated by Fern from our API Definition.
import typing
from json.decoder import JSONDecodeError
from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.jsonable_encoder import jsonable_encoder
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..errors.not_found_error import NotFoundError
from ..errors.unprocessable_entity_error import UnprocessableEntityError
from ..types.browser_profile import BrowserProfile
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
class RawBrowserProfilesClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper
def list_browser_profiles(
self, *, include_deleted: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[typing.List[BrowserProfile]]:
"""
Get all browser profiles for the organization
Parameters
----------
include_deleted : typing.Optional[bool]
Include deleted browser profiles
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[typing.List[BrowserProfile]]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/browser_profiles",
method="GET",
params={
"include_deleted": include_deleted,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[BrowserProfile],
parse_obj_as(
type_=typing.List[BrowserProfile], # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
def create_browser_profile(
self,
*,
name: str,
description: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> HttpResponse[BrowserProfile]:
"""
Parameters
----------
name : str
Name for the browser profile
description : typing.Optional[str]
Optional profile description
browser_session_id : typing.Optional[str]
Persistent browser session to convert into a profile
workflow_run_id : typing.Optional[str]
Workflow run whose persisted session should be captured
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[BrowserProfile]
Successful Response
"""
_response = self._client_wrapper.httpx_client.request(
"v1/browser_profiles",
method="POST",
json={
"name": name,
"description": description,
"browser_session_id": browser_session_id,
"workflow_run_id": workflow_run_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BrowserProfile,
parse_obj_as(
type_=BrowserProfile, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
def get_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[BrowserProfile]:
"""
Get a specific browser profile by ID
Parameters
----------
profile_id : str
The ID of the browser profile. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[BrowserProfile]
Successfully retrieved browser profile
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/browser_profiles/{jsonable_encoder(profile_id)}",
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BrowserProfile,
parse_obj_as(
type_=BrowserProfile, # type: ignore
object_=_response.json(),
),
)
return HttpResponse(response=_response, data=_data)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
def delete_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> HttpResponse[None]:
"""
Delete a browser profile (soft delete)
Parameters
----------
profile_id : str
The ID of the browser profile to delete. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
HttpResponse[None]
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/browser_profiles/{jsonable_encoder(profile_id)}",
method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return HttpResponse(response=_response, data=None)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
class AsyncRawBrowserProfilesClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper
async def list_browser_profiles(
self, *, include_deleted: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[typing.List[BrowserProfile]]:
"""
Get all browser profiles for the organization
Parameters
----------
include_deleted : typing.Optional[bool]
Include deleted browser profiles
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[typing.List[BrowserProfile]]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/browser_profiles",
method="GET",
params={
"include_deleted": include_deleted,
},
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
typing.List[BrowserProfile],
parse_obj_as(
type_=typing.List[BrowserProfile], # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
async def create_browser_profile(
self,
*,
name: str,
description: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> AsyncHttpResponse[BrowserProfile]:
"""
Parameters
----------
name : str
Name for the browser profile
description : typing.Optional[str]
Optional profile description
browser_session_id : typing.Optional[str]
Persistent browser session to convert into a profile
workflow_run_id : typing.Optional[str]
Workflow run whose persisted session should be captured
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[BrowserProfile]
Successful Response
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/browser_profiles",
method="POST",
json={
"name": name,
"description": description,
"browser_session_id": browser_session_id,
"workflow_run_id": workflow_run_id,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BrowserProfile,
parse_obj_as(
type_=BrowserProfile, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
async def get_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[BrowserProfile]:
"""
Get a specific browser profile by ID
Parameters
----------
profile_id : str
The ID of the browser profile. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[BrowserProfile]
Successfully retrieved browser profile
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/browser_profiles/{jsonable_encoder(profile_id)}",
method="GET",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
_data = typing.cast(
BrowserProfile,
parse_obj_as(
type_=BrowserProfile, # type: ignore
object_=_response.json(),
),
)
return AsyncHttpResponse(response=_response, data=_data)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
async def delete_browser_profile(
self, profile_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> AsyncHttpResponse[None]:
"""
Delete a browser profile (soft delete)
Parameters
----------
profile_id : str
The ID of the browser profile to delete. browser_profile_id starts with `bp_`
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
AsyncHttpResponse[None]
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/browser_profiles/{jsonable_encoder(profile_id)}",
method="DELETE",
request_options=request_options,
)
try:
if 200 <= _response.status_code < 300:
return AsyncHttpResponse(response=_response, data=None)
if _response.status_code == 404:
raise NotFoundError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
headers=dict(_response.headers),
body=typing.cast(
typing.Optional[typing.Any],
parse_obj_as(
type_=typing.Optional[typing.Any], # type: ignore
object_=_response.json(),
),
),
)
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

View File

@@ -35,6 +35,7 @@ from .types.workflow_run_timeline import WorkflowRunTimeline
from .types.workflow_status import WorkflowStatus
if typing.TYPE_CHECKING:
from .browser_profiles.client import AsyncBrowserProfilesClient, BrowserProfilesClient
from .scripts.client import AsyncScriptsClient, ScriptsClient
from .workflows.client import AsyncWorkflowsClient, WorkflowsClient
# this is used as the default value for optional parameters
@@ -108,6 +109,7 @@ class Skyvern:
)
self._raw_client = RawSkyvern(client_wrapper=self._client_wrapper)
self._workflows: typing.Optional[WorkflowsClient] = None
self._browser_profiles: typing.Optional[BrowserProfilesClient] = None
self._scripts: typing.Optional[ScriptsClient] = None
@property
@@ -297,6 +299,7 @@ class Skyvern:
totp_url: typing.Optional[str] = OMIT,
totp_identifier: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
browser_profile_id: typing.Optional[str] = OMIT,
max_screenshot_scrolls: typing.Optional[int] = OMIT,
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
browser_address: typing.Optional[str] = OMIT,
@@ -363,6 +366,9 @@ class Skyvern:
browser_session_id : typing.Optional[str]
ID of a Skyvern browser session to reuse, having it continue from the current screen state
browser_profile_id : typing.Optional[str]
ID of a browser profile to reuse for this workflow run
max_screenshot_scrolls : typing.Optional[int]
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.
@@ -412,6 +418,7 @@ class Skyvern:
totp_url=totp_url,
totp_identifier=totp_identifier,
browser_session_id=browser_session_id,
browser_profile_id=browser_profile_id,
max_screenshot_scrolls=max_screenshot_scrolls,
extra_http_headers=extra_http_headers,
browser_address=browser_address,
@@ -575,6 +582,7 @@ class Skyvern:
def create_workflow(
self,
*,
folder_id: typing.Optional[str] = None,
json_definition: typing.Optional[WorkflowCreateYamlRequest] = OMIT,
yaml_definition: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -584,6 +592,9 @@ class Skyvern:
Parameters
----------
folder_id : typing.Optional[str]
Optional folder ID to assign the workflow to
json_definition : typing.Optional[WorkflowCreateYamlRequest]
Workflow definition in JSON format
@@ -605,10 +616,15 @@ class Skyvern:
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.create_workflow()
client.create_workflow(
folder_id="folder_id",
)
"""
_response = self._raw_client.create_workflow(
json_definition=json_definition, yaml_definition=yaml_definition, request_options=request_options
folder_id=folder_id,
json_definition=json_definition,
yaml_definition=yaml_definition,
request_options=request_options,
)
return _response.data
@@ -1577,6 +1593,14 @@ class Skyvern:
self._workflows = WorkflowsClient(client_wrapper=self._client_wrapper)
return self._workflows
@property
def browser_profiles(self):
if self._browser_profiles is None:
from .browser_profiles.client import BrowserProfilesClient # noqa: E402
self._browser_profiles = BrowserProfilesClient(client_wrapper=self._client_wrapper)
return self._browser_profiles
@property
def scripts(self):
if self._scripts is None:
@@ -1653,6 +1677,7 @@ class AsyncSkyvern:
)
self._raw_client = AsyncRawSkyvern(client_wrapper=self._client_wrapper)
self._workflows: typing.Optional[AsyncWorkflowsClient] = None
self._browser_profiles: typing.Optional[AsyncBrowserProfilesClient] = None
self._scripts: typing.Optional[AsyncScriptsClient] = None
@property
@@ -1850,6 +1875,7 @@ class AsyncSkyvern:
totp_url: typing.Optional[str] = OMIT,
totp_identifier: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
browser_profile_id: typing.Optional[str] = OMIT,
max_screenshot_scrolls: typing.Optional[int] = OMIT,
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
browser_address: typing.Optional[str] = OMIT,
@@ -1916,6 +1942,9 @@ class AsyncSkyvern:
browser_session_id : typing.Optional[str]
ID of a Skyvern browser session to reuse, having it continue from the current screen state
browser_profile_id : typing.Optional[str]
ID of a browser profile to reuse for this workflow run
max_screenshot_scrolls : typing.Optional[int]
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.
@@ -1973,6 +2002,7 @@ class AsyncSkyvern:
totp_url=totp_url,
totp_identifier=totp_identifier,
browser_session_id=browser_session_id,
browser_profile_id=browser_profile_id,
max_screenshot_scrolls=max_screenshot_scrolls,
extra_http_headers=extra_http_headers,
browser_address=browser_address,
@@ -2160,6 +2190,7 @@ class AsyncSkyvern:
async def create_workflow(
self,
*,
folder_id: typing.Optional[str] = None,
json_definition: typing.Optional[WorkflowCreateYamlRequest] = OMIT,
yaml_definition: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2169,6 +2200,9 @@ class AsyncSkyvern:
Parameters
----------
folder_id : typing.Optional[str]
Optional folder ID to assign the workflow to
json_definition : typing.Optional[WorkflowCreateYamlRequest]
Workflow definition in JSON format
@@ -2195,13 +2229,18 @@ class AsyncSkyvern:
async def main() -> None:
await client.create_workflow()
await client.create_workflow(
folder_id="folder_id",
)
asyncio.run(main())
"""
_response = await self._raw_client.create_workflow(
json_definition=json_definition, yaml_definition=yaml_definition, request_options=request_options
folder_id=folder_id,
json_definition=json_definition,
yaml_definition=yaml_definition,
request_options=request_options,
)
return _response.data
@@ -3344,6 +3383,14 @@ class AsyncSkyvern:
self._workflows = AsyncWorkflowsClient(client_wrapper=self._client_wrapper)
return self._workflows
@property
def browser_profiles(self):
if self._browser_profiles is None:
from .browser_profiles.client import AsyncBrowserProfilesClient # noqa: E402
self._browser_profiles = AsyncBrowserProfilesClient(client_wrapper=self._client_wrapper)
return self._browser_profiles
@property
def scripts(self):
if self._scripts is None:

View File

@@ -256,6 +256,7 @@ class RawSkyvern:
totp_url: typing.Optional[str] = OMIT,
totp_identifier: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
browser_profile_id: typing.Optional[str] = OMIT,
max_screenshot_scrolls: typing.Optional[int] = OMIT,
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
browser_address: typing.Optional[str] = OMIT,
@@ -322,6 +323,9 @@ class RawSkyvern:
browser_session_id : typing.Optional[str]
ID of a Skyvern browser session to reuse, having it continue from the current screen state
browser_profile_id : typing.Optional[str]
ID of a browser profile to reuse for this workflow run
max_screenshot_scrolls : typing.Optional[int]
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.
@@ -360,6 +364,7 @@ class RawSkyvern:
"totp_url": totp_url,
"totp_identifier": totp_identifier,
"browser_session_id": browser_session_id,
"browser_profile_id": browser_profile_id,
"max_screenshot_scrolls": max_screenshot_scrolls,
"extra_http_headers": extra_http_headers,
"browser_address": browser_address,
@@ -624,6 +629,7 @@ class RawSkyvern:
def create_workflow(
self,
*,
folder_id: typing.Optional[str] = None,
json_definition: typing.Optional[WorkflowCreateYamlRequest] = OMIT,
yaml_definition: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -633,6 +639,9 @@ class RawSkyvern:
Parameters
----------
folder_id : typing.Optional[str]
Optional folder ID to assign the workflow to
json_definition : typing.Optional[WorkflowCreateYamlRequest]
Workflow definition in JSON format
@@ -650,6 +659,9 @@ class RawSkyvern:
_response = self._client_wrapper.httpx_client.request(
"v1/workflows",
method="POST",
params={
"folder_id": folder_id,
},
json={
"json_definition": convert_and_respect_annotation_metadata(
object_=json_definition, annotation=WorkflowCreateYamlRequest, direction="write"
@@ -2360,6 +2372,7 @@ class AsyncRawSkyvern:
totp_url: typing.Optional[str] = OMIT,
totp_identifier: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT,
browser_profile_id: typing.Optional[str] = OMIT,
max_screenshot_scrolls: typing.Optional[int] = OMIT,
extra_http_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
browser_address: typing.Optional[str] = OMIT,
@@ -2426,6 +2439,9 @@ class AsyncRawSkyvern:
browser_session_id : typing.Optional[str]
ID of a Skyvern browser session to reuse, having it continue from the current screen state
browser_profile_id : typing.Optional[str]
ID of a browser profile to reuse for this workflow run
max_screenshot_scrolls : typing.Optional[int]
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.
@@ -2464,6 +2480,7 @@ class AsyncRawSkyvern:
"totp_url": totp_url,
"totp_identifier": totp_identifier,
"browser_session_id": browser_session_id,
"browser_profile_id": browser_profile_id,
"max_screenshot_scrolls": max_screenshot_scrolls,
"extra_http_headers": extra_http_headers,
"browser_address": browser_address,
@@ -2728,6 +2745,7 @@ class AsyncRawSkyvern:
async def create_workflow(
self,
*,
folder_id: typing.Optional[str] = None,
json_definition: typing.Optional[WorkflowCreateYamlRequest] = OMIT,
yaml_definition: typing.Optional[str] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
@@ -2737,6 +2755,9 @@ class AsyncRawSkyvern:
Parameters
----------
folder_id : typing.Optional[str]
Optional folder ID to assign the workflow to
json_definition : typing.Optional[WorkflowCreateYamlRequest]
Workflow definition in JSON format
@@ -2754,6 +2775,9 @@ class AsyncRawSkyvern:
_response = await self._client_wrapper.httpx_client.request(
"v1/workflows",
method="POST",
params={
"folder_id": folder_id,
},
json={
"json_definition": convert_and_respect_annotation_metadata(
object_=json_definition, annotation=WorkflowCreateYamlRequest, direction="write"

View File

@@ -42,6 +42,7 @@ if typing.TYPE_CHECKING:
from .bitwarden_sensitive_information_parameter import BitwardenSensitiveInformationParameter
from .bitwarden_sensitive_information_parameter_yaml import BitwardenSensitiveInformationParameterYaml
from .block_type import BlockType
from .browser_profile import BrowserProfile
from .browser_session_response import BrowserSessionResponse
from .click_action import ClickAction
from .click_action_data import ClickActionData
@@ -546,6 +547,7 @@ _dynamic_imports: typing.Dict[str, str] = {
"BitwardenSensitiveInformationParameter": ".bitwarden_sensitive_information_parameter",
"BitwardenSensitiveInformationParameterYaml": ".bitwarden_sensitive_information_parameter_yaml",
"BlockType": ".block_type",
"BrowserProfile": ".browser_profile",
"BrowserSessionResponse": ".browser_session_response",
"ClickAction": ".click_action",
"ClickActionData": ".click_action_data",
@@ -1030,6 +1032,7 @@ __all__ = [
"BitwardenSensitiveInformationParameter",
"BitwardenSensitiveInformationParameterYaml",
"BlockType",
"BrowserProfile",
"BrowserSessionResponse",
"ClickAction",
"ClickActionData",

View File

@@ -0,0 +1,26 @@
# This file was auto-generated by Fern from our API Definition.
import datetime as dt
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
class BrowserProfile(UniversalBaseModel):
browser_profile_id: str
organization_id: str
name: str
description: typing.Optional[str] = None
created_at: dt.datetime
modified_at: dt.datetime
deleted_at: typing.Optional[dt.datetime] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow

View File

@@ -32,6 +32,7 @@ class GetRunResponse_TaskV1(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
@@ -63,6 +64,7 @@ class GetRunResponse_TaskV2(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
@@ -94,6 +96,7 @@ class GetRunResponse_OpenaiCua(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
@@ -125,6 +128,7 @@ class GetRunResponse_AnthropicCua(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
@@ -156,6 +160,7 @@ class GetRunResponse_UiTars(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
@@ -187,6 +192,7 @@ class GetRunResponse_WorkflowRun(UniversalBaseModel):
finished_at: typing.Optional[dt.datetime] = None
app_url: typing.Optional[str] = None
browser_session_id: typing.Optional[str] = None
browser_profile_id: typing.Optional[str] = None
max_screenshot_scrolls: typing.Optional[int] = None
script_run: typing.Optional[ScriptRunResponse] = None
errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None

View File

@@ -13,6 +13,7 @@ class InputOrSelectContext(UniversalBaseModel):
is_search_bar: typing.Optional[bool] = None
is_location_input: typing.Optional[bool] = None
is_date_related: typing.Optional[bool] = None
date_format: typing.Optional[str] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -1,7 +0,0 @@
# This file was auto-generated by Fern from our API Definition.
import typing
RunSdkActionResponseResult = typing.Union[
str, typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], float, bool
]

View File

@@ -1,129 +0,0 @@
# This file was auto-generated by Fern from our API Definition.
from __future__ import annotations
import typing
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .click_action_data import ClickActionData
from .extract_action_data import ExtractActionData
from .extract_action_extract_schema import ExtractActionExtractSchema
from .input_text_action_data import InputTextActionData
from .select_option_action_data import SelectOptionActionData
from .upload_file_action_data import UploadFileActionData
class SdkAction_AiClick(UniversalBaseModel):
type: typing.Literal["ai_click"] = "ai_click"
selector: typing.Optional[str] = None
intention: typing.Optional[str] = None
data: typing.Optional[ClickActionData] = None
timeout: typing.Optional[float] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class SdkAction_AiInputText(UniversalBaseModel):
type: typing.Literal["ai_input_text"] = "ai_input_text"
selector: typing.Optional[str] = None
value: typing.Optional[str] = None
intention: typing.Optional[str] = None
data: typing.Optional[InputTextActionData] = None
totp_identifier: typing.Optional[str] = None
totp_url: typing.Optional[str] = None
timeout: typing.Optional[float] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class SdkAction_AiSelectOption(UniversalBaseModel):
type: typing.Literal["ai_select_option"] = "ai_select_option"
selector: typing.Optional[str] = None
value: typing.Optional[str] = None
intention: typing.Optional[str] = None
data: typing.Optional[SelectOptionActionData] = None
timeout: typing.Optional[float] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class SdkAction_AiUploadFile(UniversalBaseModel):
type: typing.Literal["ai_upload_file"] = "ai_upload_file"
selector: typing.Optional[str] = None
file_url: typing.Optional[str] = None
intention: typing.Optional[str] = None
data: typing.Optional[UploadFileActionData] = None
timeout: typing.Optional[float] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class SdkAction_AiAct(UniversalBaseModel):
type: typing.Literal["ai_act"] = "ai_act"
intention: typing.Optional[str] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
class SdkAction_Extract(UniversalBaseModel):
type: typing.Literal["extract"] = "extract"
prompt: typing.Optional[str] = None
extract_schema: typing.Optional[ExtractActionExtractSchema] = None
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
intention: typing.Optional[str] = None
data: typing.Optional[ExtractActionData] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
SdkAction = typing.Union[
SdkAction_AiClick,
SdkAction_AiInputText,
SdkAction_AiSelectOption,
SdkAction_AiUploadFile,
SdkAction_AiAct,
SdkAction_Extract,
]

View File

@@ -83,6 +83,11 @@ class TaskRunResponse(UniversalBaseModel):
ID of the Skyvern persistent browser session used for this run
"""
browser_profile_id: typing.Optional[str] = pydantic.Field(default=None)
"""
ID of the browser profile used for this run
"""
max_screenshot_scrolls: typing.Optional[int] = pydantic.Field(default=None)
"""
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot

View File

@@ -30,6 +30,7 @@ class WorkflowCreateYamlRequest(UniversalBaseModel):
cache_key: typing.Optional[str] = None
run_sequentially: typing.Optional[bool] = None
sequential_key: typing.Optional[str] = None
folder_id: typing.Optional[str] = None
if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -72,6 +72,11 @@ class WorkflowRunRequest(UniversalBaseModel):
ID of a Skyvern browser session to reuse, having it continue from the current screen state
"""
browser_profile_id: typing.Optional[str] = pydantic.Field(default=None)
"""
ID of a browser profile to reuse for this workflow run
"""
max_screenshot_scrolls: typing.Optional[int] = pydantic.Field(default=None)
"""
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot.

View File

@@ -83,6 +83,11 @@ class WorkflowRunResponse(UniversalBaseModel):
ID of the Skyvern persistent browser session used for this run
"""
browser_profile_id: typing.Optional[str] = pydantic.Field(default=None)
"""
ID of the browser profile used for this run
"""
max_screenshot_scrolls: typing.Optional[int] = pydantic.Field(default=None)
"""
The maximum number of scrolls for the post action screenshot. When it's None or 0, it takes the current viewpoint screenshot