Release v1.0.2 (#4175)
This commit is contained in:
committed by
GitHub
parent
2961fdd721
commit
d9610701d3
@@ -12,6 +12,7 @@ from .environment import SkyvernEnvironment
|
||||
from .raw_client import AsyncRawSkyvern, RawSkyvern
|
||||
from .types.artifact import Artifact
|
||||
from .types.artifact_type import ArtifactType
|
||||
from .types.browser_profile import BrowserProfile
|
||||
from .types.browser_session_response import BrowserSessionResponse
|
||||
from .types.create_credential_request_credential import CreateCredentialRequestCredential
|
||||
from .types.create_script_response import CreateScriptResponse
|
||||
@@ -26,17 +27,17 @@ from .types.script_file_create import ScriptFileCreate
|
||||
from .types.skyvern_forge_sdk_schemas_credentials_credential_type import SkyvernForgeSdkSchemasCredentialsCredentialType
|
||||
from .types.skyvern_schemas_run_blocks_credential_type import SkyvernSchemasRunBlocksCredentialType
|
||||
from .types.task_run_request_data_extraction_schema import TaskRunRequestDataExtractionSchema
|
||||
from .types.task_run_request_proxy_location import TaskRunRequestProxyLocation
|
||||
from .types.task_run_response import TaskRunResponse
|
||||
from .types.totp_code import TotpCode
|
||||
from .types.workflow import Workflow
|
||||
from .types.workflow_create_yaml_request import WorkflowCreateYamlRequest
|
||||
from .types.workflow_run_request_proxy_location import WorkflowRunRequestProxyLocation
|
||||
from .types.workflow_run_response import WorkflowRunResponse
|
||||
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 .prompts.client import AsyncPromptsClient, PromptsClient
|
||||
from .scripts.client import AsyncScriptsClient, ScriptsClient
|
||||
from .workflows.client import AsyncWorkflowsClient, WorkflowsClient
|
||||
# this is used as the default value for optional parameters
|
||||
@@ -110,8 +111,6 @@ 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._prompts: typing.Optional[PromptsClient] = None
|
||||
self._scripts: typing.Optional[ScriptsClient] = None
|
||||
|
||||
@property
|
||||
@@ -133,7 +132,7 @@ class Skyvern:
|
||||
url: typing.Optional[str] = OMIT,
|
||||
engine: typing.Optional[RunEngine] = OMIT,
|
||||
title: typing.Optional[str] = OMIT,
|
||||
proxy_location: typing.Optional[ProxyLocation] = OMIT,
|
||||
proxy_location: typing.Optional[TaskRunRequestProxyLocation] = OMIT,
|
||||
data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT,
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
||||
max_steps: typing.Optional[int] = OMIT,
|
||||
@@ -171,7 +170,7 @@ class Skyvern:
|
||||
title : typing.Optional[str]
|
||||
The title for the task
|
||||
|
||||
proxy_location : typing.Optional[ProxyLocation]
|
||||
proxy_location : typing.Optional[TaskRunRequestProxyLocation]
|
||||
|
||||
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.
|
||||
|
||||
@@ -195,6 +194,7 @@ class Skyvern:
|
||||
- US-FL: Florida
|
||||
- US-WA: Washington
|
||||
- NONE: No proxy
|
||||
Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
|
||||
|
||||
data_extraction_schema : typing.Optional[TaskRunRequestDataExtractionSchema]
|
||||
|
||||
@@ -296,7 +296,7 @@ class Skyvern:
|
||||
user_agent: typing.Optional[str] = None,
|
||||
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
||||
title: typing.Optional[str] = OMIT,
|
||||
proxy_location: typing.Optional[ProxyLocation] = OMIT,
|
||||
proxy_location: typing.Optional[WorkflowRunRequestProxyLocation] = OMIT,
|
||||
webhook_url: typing.Optional[str] = OMIT,
|
||||
totp_url: typing.Optional[str] = OMIT,
|
||||
totp_identifier: typing.Optional[str] = OMIT,
|
||||
@@ -329,7 +329,7 @@ class Skyvern:
|
||||
title : typing.Optional[str]
|
||||
The title for this workflow run
|
||||
|
||||
proxy_location : typing.Optional[ProxyLocation]
|
||||
proxy_location : typing.Optional[WorkflowRunRequestProxyLocation]
|
||||
|
||||
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.
|
||||
|
||||
@@ -353,6 +353,7 @@ class Skyvern:
|
||||
- US-FL: Florida
|
||||
- US-WA: Washington
|
||||
- NONE: No proxy
|
||||
Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
|
||||
|
||||
webhook_url : typing.Optional[str]
|
||||
URL to send workflow status updates to after a run is finished. Refer to https://www.skyvern.com/docs/running-tasks/webhooks-faq for webhook questions.
|
||||
@@ -849,6 +850,160 @@ class Skyvern:
|
||||
_response = self._raw_client.get_run_timeline(run_id, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
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]
|
||||
Successfully retrieved browser profiles
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
client.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:
|
||||
"""
|
||||
Create a browser profile from a persistent browser session or workflow run.
|
||||
|
||||
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
|
||||
Successfully created browser profile
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
client.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.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.delete_browser_profile(
|
||||
profile_id="bp_123456",
|
||||
)
|
||||
"""
|
||||
_response = self._raw_client.delete_browser_profile(profile_id, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
def get_browser_sessions(
|
||||
self, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> typing.List[BrowserSessionResponse]:
|
||||
@@ -1600,22 +1755,6 @@ 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 prompts(self):
|
||||
if self._prompts is None:
|
||||
from .prompts.client import PromptsClient # noqa: E402
|
||||
|
||||
self._prompts = PromptsClient(client_wrapper=self._client_wrapper)
|
||||
return self._prompts
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
if self._scripts is None:
|
||||
@@ -1692,8 +1831,6 @@ 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._prompts: typing.Optional[AsyncPromptsClient] = None
|
||||
self._scripts: typing.Optional[AsyncScriptsClient] = None
|
||||
|
||||
@property
|
||||
@@ -1715,7 +1852,7 @@ class AsyncSkyvern:
|
||||
url: typing.Optional[str] = OMIT,
|
||||
engine: typing.Optional[RunEngine] = OMIT,
|
||||
title: typing.Optional[str] = OMIT,
|
||||
proxy_location: typing.Optional[ProxyLocation] = OMIT,
|
||||
proxy_location: typing.Optional[TaskRunRequestProxyLocation] = OMIT,
|
||||
data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT,
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
|
||||
max_steps: typing.Optional[int] = OMIT,
|
||||
@@ -1753,7 +1890,7 @@ class AsyncSkyvern:
|
||||
title : typing.Optional[str]
|
||||
The title for the task
|
||||
|
||||
proxy_location : typing.Optional[ProxyLocation]
|
||||
proxy_location : typing.Optional[TaskRunRequestProxyLocation]
|
||||
|
||||
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.
|
||||
|
||||
@@ -1777,6 +1914,7 @@ class AsyncSkyvern:
|
||||
- US-FL: Florida
|
||||
- US-WA: Washington
|
||||
- NONE: No proxy
|
||||
Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
|
||||
|
||||
data_extraction_schema : typing.Optional[TaskRunRequestDataExtractionSchema]
|
||||
|
||||
@@ -1886,7 +2024,7 @@ class AsyncSkyvern:
|
||||
user_agent: typing.Optional[str] = None,
|
||||
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
|
||||
title: typing.Optional[str] = OMIT,
|
||||
proxy_location: typing.Optional[ProxyLocation] = OMIT,
|
||||
proxy_location: typing.Optional[WorkflowRunRequestProxyLocation] = OMIT,
|
||||
webhook_url: typing.Optional[str] = OMIT,
|
||||
totp_url: typing.Optional[str] = OMIT,
|
||||
totp_identifier: typing.Optional[str] = OMIT,
|
||||
@@ -1919,7 +2057,7 @@ class AsyncSkyvern:
|
||||
title : typing.Optional[str]
|
||||
The title for this workflow run
|
||||
|
||||
proxy_location : typing.Optional[ProxyLocation]
|
||||
proxy_location : typing.Optional[WorkflowRunRequestProxyLocation]
|
||||
|
||||
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.
|
||||
|
||||
@@ -1943,6 +2081,7 @@ class AsyncSkyvern:
|
||||
- US-FL: Florida
|
||||
- US-WA: Washington
|
||||
- NONE: No proxy
|
||||
Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}
|
||||
|
||||
webhook_url : typing.Optional[str]
|
||||
URL to send workflow status updates to after a run is finished. Refer to https://www.skyvern.com/docs/running-tasks/webhooks-faq for webhook questions.
|
||||
@@ -2529,6 +2668,192 @@ class AsyncSkyvern:
|
||||
_response = await self._raw_client.get_run_timeline(run_id, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
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]
|
||||
Successfully retrieved browser profiles
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.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:
|
||||
"""
|
||||
Create a browser profile from a persistent browser session or workflow run.
|
||||
|
||||
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
|
||||
Successfully created browser profile
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.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.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.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
|
||||
|
||||
async def get_browser_sessions(
|
||||
self, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> typing.List[BrowserSessionResponse]:
|
||||
@@ -3404,22 +3729,6 @@ 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 prompts(self):
|
||||
if self._prompts is None:
|
||||
from .prompts.client import AsyncPromptsClient # noqa: E402
|
||||
|
||||
self._prompts = AsyncPromptsClient(client_wrapper=self._client_wrapper)
|
||||
return self._prompts
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
if self._scripts is None:
|
||||
|
||||
Reference in New Issue
Block a user