update code samples part1 (#2375)

This commit is contained in:
Shuchang Zheng
2025-05-17 11:15:47 -07:00
committed by GitHub
parent 339c894340
commit 663efc3587
25 changed files with 474 additions and 99 deletions

View File

@@ -159,6 +159,7 @@ from .types import (
TextPromptBlockParametersItem_Credential, TextPromptBlockParametersItem_Credential,
TextPromptBlockParametersItem_Output, TextPromptBlockParametersItem_Output,
TextPromptBlockParametersItem_Workflow, TextPromptBlockParametersItem_Workflow,
TotpCode,
UploadToS3Block, UploadToS3Block,
UrlBlock, UrlBlock,
UrlBlockDataSchema, UrlBlockDataSchema,
@@ -233,7 +234,7 @@ from .types import (
WorkflowRunResponseOutput, WorkflowRunResponseOutput,
WorkflowStatus, WorkflowStatus,
) )
from .errors import BadRequestError, NotFoundError, UnauthorizedError, UnprocessableEntityError from .errors import BadRequestError, ForbiddenError, NotFoundError, UnprocessableEntityError
from . import agent, browser_session, credentials from . import agent, browser_session, credentials
from .agent import ( from .agent import (
AgentGetRunResponse, AgentGetRunResponse,
@@ -358,6 +359,7 @@ __all__ = [
"ForLoopBlockLoopOver_Credential", "ForLoopBlockLoopOver_Credential",
"ForLoopBlockLoopOver_Output", "ForLoopBlockLoopOver_Output",
"ForLoopBlockLoopOver_Workflow", "ForLoopBlockLoopOver_Workflow",
"ForbiddenError",
"HttpValidationError", "HttpValidationError",
"LoginBlock", "LoginBlock",
"LoginBlockDataSchema", "LoginBlockDataSchema",
@@ -419,7 +421,7 @@ __all__ = [
"TextPromptBlockParametersItem_Credential", "TextPromptBlockParametersItem_Credential",
"TextPromptBlockParametersItem_Output", "TextPromptBlockParametersItem_Output",
"TextPromptBlockParametersItem_Workflow", "TextPromptBlockParametersItem_Workflow",
"UnauthorizedError", "TotpCode",
"UnprocessableEntityError", "UnprocessableEntityError",
"UploadToS3Block", "UploadToS3Block",
"UrlBlock", "UrlBlock",

View File

@@ -54,7 +54,7 @@ class AgentClient:
authorization="YOUR_AUTHORIZATION", authorization="YOUR_AUTHORIZATION",
) )
client.agent.get_run( client.agent.get_run(
run_id="run_id", run_id="tsk_123",
) )
""" """
_response = self._client_wrapper.httpx_client.request( _response = self._client_wrapper.httpx_client.request(
@@ -156,6 +156,7 @@ class AgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
The ID of the workflow to update. Workflow ID starts with `wpid_`.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -174,7 +175,7 @@ class AgentClient:
authorization="YOUR_AUTHORIZATION", authorization="YOUR_AUTHORIZATION",
) )
client.agent.update_workflow( client.agent.update_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
""" """
_response = self._client_wrapper.httpx_client.request( _response = self._client_wrapper.httpx_client.request(
@@ -215,6 +216,7 @@ class AgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
The ID of the workflow to delete. Workflow ID starts with `wpid_`.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -233,7 +235,7 @@ class AgentClient:
authorization="YOUR_AUTHORIZATION", authorization="YOUR_AUTHORIZATION",
) )
client.agent.delete_workflow( client.agent.delete_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
""" """
_response = self._client_wrapper.httpx_client.request( _response = self._client_wrapper.httpx_client.request(
@@ -271,8 +273,8 @@ class AgentClient:
prompt: str, prompt: str,
user_agent: typing.Optional[str] = None, user_agent: typing.Optional[str] = None,
url: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT,
title: typing.Optional[str] = OMIT,
engine: typing.Optional[RunEngine] = OMIT, engine: typing.Optional[RunEngine] = OMIT,
title: typing.Optional[str] = OMIT,
proxy_location: typing.Optional[ProxyLocation] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT,
data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT, data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT,
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
@@ -282,6 +284,7 @@ class AgentClient:
totp_url: typing.Optional[str] = OMIT, totp_url: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT, browser_session_id: typing.Optional[str] = OMIT,
publish_workflow: typing.Optional[bool] = OMIT, publish_workflow: typing.Optional[bool] = OMIT,
include_action_history_in_verification: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None, request_options: typing.Optional[RequestOptions] = None,
) -> TaskRunResponse: ) -> TaskRunResponse:
""" """
@@ -297,11 +300,11 @@ class AgentClient:
url : typing.Optional[str] url : typing.Optional[str]
The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL
title : typing.Optional[str]
Optional title for the task
engine : typing.Optional[RunEngine] engine : typing.Optional[RunEngine]
The Skyvern engine version to use for this task The Skyvern engine version to use for this task. The default value is skyvern-2.0.
title : typing.Optional[str]
The title for the task
proxy_location : typing.Optional[ProxyLocation] proxy_location : typing.Optional[ProxyLocation]
Geographic Proxy location to route the browser traffic through Geographic Proxy location to route the browser traffic through
@@ -328,7 +331,10 @@ class AgentClient:
ID of an existing browser session to reuse, having it continue from the current screen state ID of an existing browser session to reuse, having it continue from the current screen state
publish_workflow : typing.Optional[bool] publish_workflow : typing.Optional[bool]
Whether to publish this task as a reusable workflow. Whether to publish this task as a reusable workflow. Only available for skyvern-2.0.
include_action_history_in_verification : typing.Optional[bool]
Whether to include action history when verifying that the task is complete
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -346,7 +352,7 @@ class AgentClient:
api_key="YOUR_API_KEY", api_key="YOUR_API_KEY",
authorization="YOUR_AUTHORIZATION", authorization="YOUR_AUTHORIZATION",
) )
await client.agent.run_task( client.agent.run_task(
prompt="prompt", prompt="prompt",
) )
""" """
@@ -356,8 +362,8 @@ class AgentClient:
json={ json={
"prompt": prompt, "prompt": prompt,
"url": url, "url": url,
"title": title,
"engine": engine, "engine": engine,
"title": title,
"proxy_location": proxy_location, "proxy_location": proxy_location,
"data_extraction_schema": convert_and_respect_annotation_metadata( "data_extraction_schema": convert_and_respect_annotation_metadata(
object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write" object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write"
@@ -369,6 +375,7 @@ class AgentClient:
"totp_url": totp_url, "totp_url": totp_url,
"browser_session_id": browser_session_id, "browser_session_id": browser_session_id,
"publish_workflow": publish_workflow, "publish_workflow": publish_workflow,
"include_action_history_in_verification": include_action_history_in_verification,
}, },
headers={ headers={
"x-user-agent": str(user_agent) if user_agent is not None else None, "x-user-agent": str(user_agent) if user_agent is not None else None,
@@ -417,8 +424,8 @@ class AgentClient:
template: typing.Optional[bool] = None, template: typing.Optional[bool] = None,
max_steps_override: typing.Optional[int] = None, max_steps_override: typing.Optional[int] = None,
user_agent: typing.Optional[str] = None, user_agent: typing.Optional[str] = None,
title: typing.Optional[str] = OMIT,
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, 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[ProxyLocation] = OMIT,
webhook_url: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT,
totp_url: typing.Optional[str] = OMIT, totp_url: typing.Optional[str] = OMIT,
@@ -432,7 +439,7 @@ class AgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
ID of the workflow to run ID of the workflow to run. Workflow ID starts with `wpid_`.
template : typing.Optional[bool] template : typing.Optional[bool]
@@ -440,26 +447,26 @@ class AgentClient:
user_agent : typing.Optional[str] user_agent : typing.Optional[str]
title : typing.Optional[str]
Optional title for this workflow run
parameters : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] parameters : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
Parameters to pass to the workflow Parameters to pass to the workflow
title : typing.Optional[str]
The title for this workflow run
proxy_location : typing.Optional[ProxyLocation] proxy_location : typing.Optional[ProxyLocation]
Location of proxy to use for this workflow run Location of proxy to use for this workflow run
webhook_url : typing.Optional[str] webhook_url : typing.Optional[str]
URL to send workflow status updates to after a run is finished URL to send workflow status updates to after a run is finished. Refer to https://docs.skyvern.com/running-tasks/webhooks-faq for webhook questions.
totp_url : typing.Optional[str] totp_url : typing.Optional[str]
URL for TOTP authentication setup if Skyvern should be polling endpoint for 2FA codes URL that serves TOTP/2FA/MFA codes for Skyvern to use during the workflow run. Refer to https://docs.skyvern.com/running-tasks/advanced-features#get-code-from-your-endpoint
totp_identifier : typing.Optional[str] totp_identifier : typing.Optional[str]
Identifier for TOTP (Time-based One-Time Password) authentication if codes are being pushed to Skyvern Identifier for the TOTP/2FA/MFA code when the code is pushed to Skyvern. Refer to https://docs.skyvern.com/running-tasks/advanced-features#time-based-one-time-password-totp
browser_session_id : typing.Optional[str] browser_session_id : typing.Optional[str]
ID of an existing browser session to reuse, having it continue from the current screen state ID of a Skyvern browser session to reuse, having it continue from the current screen state
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -478,7 +485,7 @@ class AgentClient:
authorization="YOUR_AUTHORIZATION", authorization="YOUR_AUTHORIZATION",
) )
client.agent.run_workflow( client.agent.run_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
""" """
_response = self._client_wrapper.httpx_client.request( _response = self._client_wrapper.httpx_client.request(
@@ -489,8 +496,8 @@ class AgentClient:
}, },
json={ json={
"workflow_id": workflow_id, "workflow_id": workflow_id,
"title": title,
"parameters": parameters, "parameters": parameters,
"title": title,
"proxy_location": proxy_location, "proxy_location": proxy_location,
"webhook_url": webhook_url, "webhook_url": webhook_url,
"totp_url": totp_url, "totp_url": totp_url,
@@ -636,7 +643,7 @@ class AsyncAgentClient:
async def main() -> None: async def main() -> None:
await client.agent.get_run( await client.agent.get_run(
run_id="run_id", run_id="tsk_123",
) )
@@ -751,6 +758,7 @@ class AsyncAgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
The ID of the workflow to update. Workflow ID starts with `wpid_`.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -774,7 +782,7 @@ class AsyncAgentClient:
async def main() -> None: async def main() -> None:
await client.agent.update_workflow( await client.agent.update_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
@@ -818,6 +826,7 @@ class AsyncAgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
The ID of the workflow to delete. Workflow ID starts with `wpid_`.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -841,7 +850,7 @@ class AsyncAgentClient:
async def main() -> None: async def main() -> None:
await client.agent.delete_workflow( await client.agent.delete_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
@@ -882,8 +891,8 @@ class AsyncAgentClient:
prompt: str, prompt: str,
user_agent: typing.Optional[str] = None, user_agent: typing.Optional[str] = None,
url: typing.Optional[str] = OMIT, url: typing.Optional[str] = OMIT,
title: typing.Optional[str] = OMIT,
engine: typing.Optional[RunEngine] = OMIT, engine: typing.Optional[RunEngine] = OMIT,
title: typing.Optional[str] = OMIT,
proxy_location: typing.Optional[ProxyLocation] = OMIT, proxy_location: typing.Optional[ProxyLocation] = OMIT,
data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT, data_extraction_schema: typing.Optional[TaskRunRequestDataExtractionSchema] = OMIT,
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT, error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = OMIT,
@@ -893,6 +902,7 @@ class AsyncAgentClient:
totp_url: typing.Optional[str] = OMIT, totp_url: typing.Optional[str] = OMIT,
browser_session_id: typing.Optional[str] = OMIT, browser_session_id: typing.Optional[str] = OMIT,
publish_workflow: typing.Optional[bool] = OMIT, publish_workflow: typing.Optional[bool] = OMIT,
include_action_history_in_verification: typing.Optional[bool] = OMIT,
request_options: typing.Optional[RequestOptions] = None, request_options: typing.Optional[RequestOptions] = None,
) -> TaskRunResponse: ) -> TaskRunResponse:
""" """
@@ -908,11 +918,11 @@ class AsyncAgentClient:
url : typing.Optional[str] url : typing.Optional[str]
The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL
title : typing.Optional[str]
Optional title for the task
engine : typing.Optional[RunEngine] engine : typing.Optional[RunEngine]
The Skyvern engine version to use for this task The Skyvern engine version to use for this task. The default value is skyvern-2.0.
title : typing.Optional[str]
The title for the task
proxy_location : typing.Optional[ProxyLocation] proxy_location : typing.Optional[ProxyLocation]
Geographic Proxy location to route the browser traffic through Geographic Proxy location to route the browser traffic through
@@ -939,7 +949,10 @@ class AsyncAgentClient:
ID of an existing browser session to reuse, having it continue from the current screen state ID of an existing browser session to reuse, having it continue from the current screen state
publish_workflow : typing.Optional[bool] publish_workflow : typing.Optional[bool]
Whether to publish this task as a reusable workflow. Whether to publish this task as a reusable workflow. Only available for skyvern-2.0.
include_action_history_in_verification : typing.Optional[bool]
Whether to include action history when verifying that the task is complete
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -975,8 +988,8 @@ class AsyncAgentClient:
json={ json={
"prompt": prompt, "prompt": prompt,
"url": url, "url": url,
"title": title,
"engine": engine, "engine": engine,
"title": title,
"proxy_location": proxy_location, "proxy_location": proxy_location,
"data_extraction_schema": convert_and_respect_annotation_metadata( "data_extraction_schema": convert_and_respect_annotation_metadata(
object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write" object_=data_extraction_schema, annotation=TaskRunRequestDataExtractionSchema, direction="write"
@@ -988,6 +1001,7 @@ class AsyncAgentClient:
"totp_url": totp_url, "totp_url": totp_url,
"browser_session_id": browser_session_id, "browser_session_id": browser_session_id,
"publish_workflow": publish_workflow, "publish_workflow": publish_workflow,
"include_action_history_in_verification": include_action_history_in_verification,
}, },
headers={ headers={
"x-user-agent": str(user_agent) if user_agent is not None else None, "x-user-agent": str(user_agent) if user_agent is not None else None,
@@ -1036,8 +1050,8 @@ class AsyncAgentClient:
template: typing.Optional[bool] = None, template: typing.Optional[bool] = None,
max_steps_override: typing.Optional[int] = None, max_steps_override: typing.Optional[int] = None,
user_agent: typing.Optional[str] = None, user_agent: typing.Optional[str] = None,
title: typing.Optional[str] = OMIT,
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, 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[ProxyLocation] = OMIT,
webhook_url: typing.Optional[str] = OMIT, webhook_url: typing.Optional[str] = OMIT,
totp_url: typing.Optional[str] = OMIT, totp_url: typing.Optional[str] = OMIT,
@@ -1051,7 +1065,7 @@ class AsyncAgentClient:
Parameters Parameters
---------- ----------
workflow_id : str workflow_id : str
ID of the workflow to run ID of the workflow to run. Workflow ID starts with `wpid_`.
template : typing.Optional[bool] template : typing.Optional[bool]
@@ -1059,26 +1073,26 @@ class AsyncAgentClient:
user_agent : typing.Optional[str] user_agent : typing.Optional[str]
title : typing.Optional[str]
Optional title for this workflow run
parameters : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] parameters : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
Parameters to pass to the workflow Parameters to pass to the workflow
title : typing.Optional[str]
The title for this workflow run
proxy_location : typing.Optional[ProxyLocation] proxy_location : typing.Optional[ProxyLocation]
Location of proxy to use for this workflow run Location of proxy to use for this workflow run
webhook_url : typing.Optional[str] webhook_url : typing.Optional[str]
URL to send workflow status updates to after a run is finished URL to send workflow status updates to after a run is finished. Refer to https://docs.skyvern.com/running-tasks/webhooks-faq for webhook questions.
totp_url : typing.Optional[str] totp_url : typing.Optional[str]
URL for TOTP authentication setup if Skyvern should be polling endpoint for 2FA codes URL that serves TOTP/2FA/MFA codes for Skyvern to use during the workflow run. Refer to https://docs.skyvern.com/running-tasks/advanced-features#get-code-from-your-endpoint
totp_identifier : typing.Optional[str] totp_identifier : typing.Optional[str]
Identifier for TOTP (Time-based One-Time Password) authentication if codes are being pushed to Skyvern Identifier for the TOTP/2FA/MFA code when the code is pushed to Skyvern. Refer to https://docs.skyvern.com/running-tasks/advanced-features#time-based-one-time-password-totp
browser_session_id : typing.Optional[str] browser_session_id : typing.Optional[str]
ID of an existing browser session to reuse, having it continue from the current screen state ID of a Skyvern browser session to reuse, having it continue from the current screen state
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -1102,7 +1116,7 @@ class AsyncAgentClient:
async def main() -> None: async def main() -> None:
await client.agent.run_workflow( await client.agent.run_workflow(
workflow_id="workflow_id", workflow_id="wpid_123",
) )
@@ -1116,8 +1130,8 @@ class AsyncAgentClient:
}, },
json={ json={
"workflow_id": workflow_id, "workflow_id": workflow_id,
"title": title,
"parameters": parameters, "parameters": parameters,
"title": title,
"proxy_location": proxy_location, "proxy_location": proxy_location,
"webhook_url": webhook_url, "webhook_url": webhook_url,
"totp_url": totp_url, "totp_url": totp_url,

View File

@@ -1,18 +1,21 @@
# This file was auto-generated by Fern from our API Definition. # This file was auto-generated by Fern from our API Definition.
from ..core.client_wrapper import SyncClientWrapper
import typing import typing
from ..core.client_wrapper import SyncClientWrapper
from ..core.request_options import RequestOptions from ..core.request_options import RequestOptions
from ..types.browser_session_response import BrowserSessionResponse from ..types.browser_session_response import BrowserSessionResponse
from ..core.jsonable_encoder import jsonable_encoder from ..core.jsonable_encoder import jsonable_encoder
from ..core.pydantic_utilities import parse_obj_as from ..core.pydantic_utilities import parse_obj_as
from ..errors.unauthorized_error import UnauthorizedError from ..errors.forbidden_error import ForbiddenError
from ..errors.not_found_error import NotFoundError from ..errors.not_found_error import NotFoundError
from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..errors.unprocessable_entity_error import UnprocessableEntityError
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from ..core.api_error import ApiError from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper from ..core.client_wrapper import AsyncClientWrapper
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
class BrowserSessionClient: class BrowserSessionClient:
def __init__(self, *, client_wrapper: SyncClientWrapper): def __init__(self, *, client_wrapper: SyncClientWrapper):
@@ -62,8 +65,8 @@ class BrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -137,8 +140,8 @@ class BrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -163,13 +166,16 @@ class BrowserSessionClient:
raise ApiError(status_code=_response.status_code, body=_response_json) raise ApiError(status_code=_response.status_code, body=_response_json)
def create_browser_session( def create_browser_session(
self, *, request_options: typing.Optional[RequestOptions] = None self, *, timeout: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None
) -> BrowserSessionResponse: ) -> BrowserSessionResponse:
""" """
Create a new browser session Create a new browser session
Parameters Parameters
---------- ----------
timeout : typing.Optional[int]
Timeout in minutes for the session. Timeout is applied after the session is started. Must be between 5 and 10080. Defaults to 60.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -191,7 +197,14 @@ class BrowserSessionClient:
_response = self._client_wrapper.httpx_client.request( _response = self._client_wrapper.httpx_client.request(
"v1/browser_sessions", "v1/browser_sessions",
method="POST", method="POST",
json={
"timeout": timeout,
},
headers={
"content-type": "application/json",
},
request_options=request_options, request_options=request_options,
omit=OMIT,
) )
try: try:
if 200 <= _response.status_code < 300: if 200 <= _response.status_code < 300:
@@ -202,8 +215,8 @@ class BrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -271,8 +284,8 @@ class BrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -353,8 +366,8 @@ class AsyncBrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -436,8 +449,8 @@ class AsyncBrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -462,13 +475,16 @@ class AsyncBrowserSessionClient:
raise ApiError(status_code=_response.status_code, body=_response_json) raise ApiError(status_code=_response.status_code, body=_response_json)
async def create_browser_session( async def create_browser_session(
self, *, request_options: typing.Optional[RequestOptions] = None self, *, timeout: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None
) -> BrowserSessionResponse: ) -> BrowserSessionResponse:
""" """
Create a new browser session Create a new browser session
Parameters Parameters
---------- ----------
timeout : typing.Optional[int]
Timeout in minutes for the session. Timeout is applied after the session is started. Must be between 5 and 10080. Defaults to 60.
request_options : typing.Optional[RequestOptions] request_options : typing.Optional[RequestOptions]
Request-specific configuration. Request-specific configuration.
@@ -498,7 +514,14 @@ class AsyncBrowserSessionClient:
_response = await self._client_wrapper.httpx_client.request( _response = await self._client_wrapper.httpx_client.request(
"v1/browser_sessions", "v1/browser_sessions",
method="POST", method="POST",
json={
"timeout": timeout,
},
headers={
"content-type": "application/json",
},
request_options=request_options, request_options=request_options,
omit=OMIT,
) )
try: try:
if 200 <= _response.status_code < 300: if 200 <= _response.status_code < 300:
@@ -509,8 +532,8 @@ class AsyncBrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(
@@ -586,8 +609,8 @@ class AsyncBrowserSessionClient:
object_=_response.json(), object_=_response.json(),
), ),
) )
if _response.status_code == 401: if _response.status_code == 403:
raise UnauthorizedError( raise ForbiddenError(
typing.cast( typing.cast(
typing.Optional[typing.Any], typing.Optional[typing.Any],
parse_obj_as( parse_obj_as(

View File

@@ -5,12 +5,12 @@ from .environment import SkyvernEnvironment
import httpx import httpx
from .core.client_wrapper import SyncClientWrapper from .core.client_wrapper import SyncClientWrapper
from .agent.client import AgentClient from .agent.client import AgentClient
from .credentials.client import CredentialsClient
from .browser_session.client import BrowserSessionClient from .browser_session.client import BrowserSessionClient
from .credentials.client import CredentialsClient
from .core.client_wrapper import AsyncClientWrapper from .core.client_wrapper import AsyncClientWrapper
from .agent.client import AsyncAgentClient from .agent.client import AsyncAgentClient
from .credentials.client import AsyncCredentialsClient
from .browser_session.client import AsyncBrowserSessionClient from .browser_session.client import AsyncBrowserSessionClient
from .credentials.client import AsyncCredentialsClient
class Skyvern: class Skyvern:
@@ -76,8 +76,8 @@ class Skyvern:
timeout=_defaulted_timeout, timeout=_defaulted_timeout,
) )
self.agent = AgentClient(client_wrapper=self._client_wrapper) self.agent = AgentClient(client_wrapper=self._client_wrapper)
self.credentials = CredentialsClient(client_wrapper=self._client_wrapper)
self.browser_session = BrowserSessionClient(client_wrapper=self._client_wrapper) self.browser_session = BrowserSessionClient(client_wrapper=self._client_wrapper)
self.credentials = CredentialsClient(client_wrapper=self._client_wrapper)
class AsyncSkyvern: class AsyncSkyvern:
@@ -143,8 +143,8 @@ class AsyncSkyvern:
timeout=_defaulted_timeout, timeout=_defaulted_timeout,
) )
self.agent = AsyncAgentClient(client_wrapper=self._client_wrapper) self.agent = AsyncAgentClient(client_wrapper=self._client_wrapper)
self.credentials = AsyncCredentialsClient(client_wrapper=self._client_wrapper)
self.browser_session = AsyncBrowserSessionClient(client_wrapper=self._client_wrapper) self.browser_session = AsyncBrowserSessionClient(client_wrapper=self._client_wrapper)
self.credentials = AsyncCredentialsClient(client_wrapper=self._client_wrapper)
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str: def _get_base_url(*, base_url: typing.Optional[str] = None, environment: SkyvernEnvironment) -> str:

View File

@@ -24,7 +24,7 @@ class BaseClientWrapper:
headers: typing.Dict[str, str] = { headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python", "X-Fern-Language": "Python",
"X-Fern-SDK-Name": "skyvern", "X-Fern-SDK-Name": "skyvern",
"X-Fern-SDK-Version": "0.1.82", "X-Fern-SDK-Version": "0.1.83",
} }
if self._api_key is not None: if self._api_key is not None:
headers["x-api-key"] = self._api_key headers["x-api-key"] = self._api_key

View File

@@ -2,12 +2,14 @@
import typing import typing
from ..core.client_wrapper import SyncClientWrapper from ..core.client_wrapper import SyncClientWrapper
import datetime as dt
from ..core.request_options import RequestOptions from ..core.request_options import RequestOptions
from ..types.credential_response import CredentialResponse from ..types.totp_code import TotpCode
from ..core.pydantic_utilities import parse_obj_as from ..core.pydantic_utilities import parse_obj_as
from ..errors.unprocessable_entity_error import UnprocessableEntityError from ..errors.unprocessable_entity_error import UnprocessableEntityError
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from ..core.api_error import ApiError from ..core.api_error import ApiError
from ..types.credential_response import CredentialResponse
from ..types.credential_type import CredentialType from ..types.credential_type import CredentialType
from .types.create_credential_request_credential import CreateCredentialRequestCredential from .types.create_credential_request_credential import CreateCredentialRequestCredential
from ..core.serialization import convert_and_respect_annotation_metadata from ..core.serialization import convert_and_respect_annotation_metadata
@@ -22,6 +24,107 @@ class CredentialsClient:
def __init__(self, *, client_wrapper: SyncClientWrapper): def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper self._client_wrapper = client_wrapper
def send_totp_code(
self,
*,
totp_identifier: str,
content: str,
task_id: typing.Optional[str] = OMIT,
workflow_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
source: typing.Optional[str] = OMIT,
expired_at: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> TotpCode:
"""
Forward a TOTP (2FA, MFA) code to Skyvern
Parameters
----------
totp_identifier : str
The identifier of the TOTP code. It can be the email address, phone number, or the identifier of the user.
content : str
The content of the TOTP code. It can be the email content that contains the TOTP code, or the sms message that contains the TOTP code. Skyvern will automatically extract the TOTP code from the content.
task_id : typing.Optional[str]
The task_id the totp code is for. It can be the task_id of the task that the TOTP code is for.
workflow_id : typing.Optional[str]
The workflow ID the TOTP code is for. It can be the workflow ID of the workflow that the TOTP code is for.
workflow_run_id : typing.Optional[str]
The workflow run id that the TOTP code is for. It can be the workflow run id of the workflow run that the TOTP code is for.
source : typing.Optional[str]
An optional field. The source of the TOTP code. e.g. email, sms, etc.
expired_at : typing.Optional[dt.datetime]
The timestamp when the TOTP code expires
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
TotpCode
Successful Response
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
authorization="YOUR_AUTHORIZATION",
)
client.credentials.send_totp_code(
totp_identifier="john.doe@example.com",
content="Hello, your verification code is 123456",
)
"""
_response = self._client_wrapper.httpx_client.request(
"v1/credentials/totp",
method="POST",
json={
"totp_identifier": totp_identifier,
"task_id": task_id,
"workflow_id": workflow_id,
"workflow_run_id": workflow_run_id,
"source": source,
"content": content,
"expired_at": expired_at,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
return typing.cast(
TotpCode,
parse_obj_as(
type_=TotpCode, # type: ignore
object_=_response.json(),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
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, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)
def get_credentials( def get_credentials(
self, self,
*, *,
@@ -295,6 +398,115 @@ class AsyncCredentialsClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper): def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper self._client_wrapper = client_wrapper
async def send_totp_code(
self,
*,
totp_identifier: str,
content: str,
task_id: typing.Optional[str] = OMIT,
workflow_id: typing.Optional[str] = OMIT,
workflow_run_id: typing.Optional[str] = OMIT,
source: typing.Optional[str] = OMIT,
expired_at: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> TotpCode:
"""
Forward a TOTP (2FA, MFA) code to Skyvern
Parameters
----------
totp_identifier : str
The identifier of the TOTP code. It can be the email address, phone number, or the identifier of the user.
content : str
The content of the TOTP code. It can be the email content that contains the TOTP code, or the sms message that contains the TOTP code. Skyvern will automatically extract the TOTP code from the content.
task_id : typing.Optional[str]
The task_id the totp code is for. It can be the task_id of the task that the TOTP code is for.
workflow_id : typing.Optional[str]
The workflow ID the TOTP code is for. It can be the workflow ID of the workflow that the TOTP code is for.
workflow_run_id : typing.Optional[str]
The workflow run id that the TOTP code is for. It can be the workflow run id of the workflow run that the TOTP code is for.
source : typing.Optional[str]
An optional field. The source of the TOTP code. e.g. email, sms, etc.
expired_at : typing.Optional[dt.datetime]
The timestamp when the TOTP code expires
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
TotpCode
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
authorization="YOUR_AUTHORIZATION",
)
async def main() -> None:
await client.credentials.send_totp_code(
totp_identifier="john.doe@example.com",
content="Hello, your verification code is 123456",
)
asyncio.run(main())
"""
_response = await self._client_wrapper.httpx_client.request(
"v1/credentials/totp",
method="POST",
json={
"totp_identifier": totp_identifier,
"task_id": task_id,
"workflow_id": workflow_id,
"workflow_run_id": workflow_run_id,
"source": source,
"content": content,
"expired_at": expired_at,
},
headers={
"content-type": "application/json",
},
request_options=request_options,
omit=OMIT,
)
try:
if 200 <= _response.status_code < 300:
return typing.cast(
TotpCode,
parse_obj_as(
type_=TotpCode, # type: ignore
object_=_response.json(),
),
)
if _response.status_code == 422:
raise UnprocessableEntityError(
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, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)
async def get_credentials( async def get_credentials(
self, self,
*, *,

View File

@@ -1,8 +1,8 @@
# This file was auto-generated by Fern from our API Definition. # This file was auto-generated by Fern from our API Definition.
from .bad_request_error import BadRequestError from .bad_request_error import BadRequestError
from .forbidden_error import ForbiddenError
from .not_found_error import NotFoundError from .not_found_error import NotFoundError
from .unauthorized_error import UnauthorizedError
from .unprocessable_entity_error import UnprocessableEntityError from .unprocessable_entity_error import UnprocessableEntityError
__all__ = ["BadRequestError", "NotFoundError", "UnauthorizedError", "UnprocessableEntityError"] __all__ = ["BadRequestError", "ForbiddenError", "NotFoundError", "UnprocessableEntityError"]

View File

@@ -4,6 +4,6 @@ from ..core.api_error import ApiError
import typing import typing
class UnauthorizedError(ApiError): class ForbiddenError(ApiError):
def __init__(self, body: typing.Optional[typing.Any]): def __init__(self, body: typing.Optional[typing.Any]):
super().__init__(status_code=401, body=body) super().__init__(status_code=403, body=body)

View File

@@ -180,6 +180,7 @@ from .text_prompt_block_parameters_item import (
TextPromptBlockParametersItem_Output, TextPromptBlockParametersItem_Output,
TextPromptBlockParametersItem_Workflow, TextPromptBlockParametersItem_Workflow,
) )
from .totp_code import TotpCode
from .upload_to_s3block import UploadToS3Block from .upload_to_s3block import UploadToS3Block
from .url_block import UrlBlock from .url_block import UrlBlock
from .url_block_data_schema import UrlBlockDataSchema from .url_block_data_schema import UrlBlockDataSchema
@@ -423,6 +424,7 @@ __all__ = [
"TextPromptBlockParametersItem_Credential", "TextPromptBlockParametersItem_Credential",
"TextPromptBlockParametersItem_Output", "TextPromptBlockParametersItem_Output",
"TextPromptBlockParametersItem_Workflow", "TextPromptBlockParametersItem_Workflow",
"TotpCode",
"UploadToS3Block", "UploadToS3Block",
"UrlBlock", "UrlBlock",
"UrlBlockDataSchema", "UrlBlockDataSchema",

View File

@@ -34,6 +34,7 @@ class ActionBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -32,9 +32,24 @@ class BrowserSessionResponse(UniversalBaseModel):
ID of the associated runnable ID of the associated runnable
""" """
timeout: typing.Optional[int] = pydantic.Field(default=None)
"""
Timeout in minutes for the session. Timeout is applied after the session is started.
"""
started_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
Timestamp when the session was started
"""
completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
Timestamp when the session was completed
"""
created_at: dt.datetime = pydantic.Field() created_at: dt.datetime = pydantic.Field()
""" """
Timestamp when the session was created Timestamp when the session was created (the timestamp for the initial request)
""" """
modified_at: dt.datetime = pydantic.Field() modified_at: dt.datetime = pydantic.Field()

View File

@@ -34,6 +34,7 @@ class ExtractionBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -34,6 +34,7 @@ class FileDownloadBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -60,6 +60,7 @@ class ForLoopBlockLoopBlocksItem_Action(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -130,6 +131,7 @@ class ForLoopBlockLoopBlocksItem_Extraction(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -165,6 +167,7 @@ class ForLoopBlockLoopBlocksItem_FileDownload(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -263,6 +266,7 @@ class ForLoopBlockLoopBlocksItem_GotoUrl(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -298,6 +302,7 @@ class ForLoopBlockLoopBlocksItem_Login(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -333,6 +338,7 @@ class ForLoopBlockLoopBlocksItem_Navigation(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -411,6 +417,7 @@ class ForLoopBlockLoopBlocksItem_Task(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -505,6 +512,7 @@ class ForLoopBlockLoopBlocksItem_Validation(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -34,6 +34,7 @@ class LoginBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -34,6 +34,7 @@ class NavigationBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -34,6 +34,7 @@ class TaskBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -20,14 +20,14 @@ class TaskRunRequest(UniversalBaseModel):
The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL The starting URL for the task. If not provided, Skyvern will attempt to determine an appropriate URL
""" """
title: typing.Optional[str] = pydantic.Field(default=None)
"""
Optional title for the task
"""
engine: typing.Optional[RunEngine] = pydantic.Field(default=None) engine: typing.Optional[RunEngine] = pydantic.Field(default=None)
""" """
The Skyvern engine version to use for this task The Skyvern engine version to use for this task. The default value is skyvern-2.0.
"""
title: typing.Optional[str] = pydantic.Field(default=None)
"""
The title for the task
""" """
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None) proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
@@ -72,7 +72,12 @@ class TaskRunRequest(UniversalBaseModel):
publish_workflow: typing.Optional[bool] = pydantic.Field(default=None) publish_workflow: typing.Optional[bool] = pydantic.Field(default=None)
""" """
Whether to publish this task as a reusable workflow. Whether to publish this task as a reusable workflow. Only available for skyvern-2.0.
"""
include_action_history_in_verification: typing.Optional[bool] = pydantic.Field(default=None)
"""
Whether to include action history when verifying that the task is complete
""" """
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:

View File

@@ -14,7 +14,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
class TaskRunResponse(UniversalBaseModel): class TaskRunResponse(UniversalBaseModel):
run_id: str = pydantic.Field() run_id: str = pydantic.Field()
""" """
Unique identifier for this run Unique identifier for this run. Run ID starts with `tsk_` for task runs and `wr_` for workflow runs.
""" """
status: RunStatus = pydantic.Field() status: RunStatus = pydantic.Field()
@@ -24,7 +24,7 @@ class TaskRunResponse(UniversalBaseModel):
output: typing.Optional[TaskRunResponseOutput] = pydantic.Field(default=None) output: typing.Optional[TaskRunResponseOutput] = pydantic.Field(default=None)
""" """
Output data from the run, if any. Format depends on the schema in the input Output data from the run, if any. Format/schema depends on the data extracted by the run.
""" """
downloaded_files: typing.Optional[typing.List[FileInfo]] = pydantic.Field(default=None) downloaded_files: typing.Optional[typing.List[FileInfo]] = pydantic.Field(default=None)
@@ -39,7 +39,7 @@ class TaskRunResponse(UniversalBaseModel):
failure_reason: typing.Optional[str] = pydantic.Field(default=None) failure_reason: typing.Optional[str] = pydantic.Field(default=None)
""" """
Reason for failure if the run failed Reason for failure if the run failed or terminated
""" """
created_at: dt.datetime = pydantic.Field() created_at: dt.datetime = pydantic.Field()

View File

@@ -0,0 +1,78 @@
# This file was auto-generated by Fern from our API Definition.
from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2
class TotpCode(UniversalBaseModel):
totp_identifier: str = pydantic.Field()
"""
The identifier of the TOTP code. It can be the email address, phone number, or the identifier of the user.
"""
task_id: typing.Optional[str] = pydantic.Field(default=None)
"""
The task_id the totp code is for. It can be the task_id of the task that the TOTP code is for.
"""
workflow_id: typing.Optional[str] = pydantic.Field(default=None)
"""
The workflow ID the TOTP code is for. It can be the workflow ID of the workflow that the TOTP code is for.
"""
workflow_run_id: typing.Optional[str] = pydantic.Field(default=None)
"""
The workflow run id that the TOTP code is for. It can be the workflow run id of the workflow run that the TOTP code is for.
"""
source: typing.Optional[str] = pydantic.Field(default=None)
"""
An optional field. The source of the TOTP code. e.g. email, sms, etc.
"""
content: str = pydantic.Field()
"""
The content of the TOTP code. It can be the email content that contains the TOTP code, or the sms message that contains the TOTP code. Skyvern will automatically extract the TOTP code from the content.
"""
expired_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
"""
The timestamp when the TOTP code expires
"""
totp_code_id: str = pydantic.Field()
"""
The skyvern ID of the TOTP code.
"""
code: str = pydantic.Field()
"""
The TOTP code extracted from the content.
"""
organization_id: str = pydantic.Field()
"""
The ID of the organization that the TOTP code is for.
"""
created_at: dt.datetime = pydantic.Field()
"""
The timestamp when the TOTP code was created.
"""
modified_at: dt.datetime = pydantic.Field()
"""
The timestamp when the TOTP code was modified.
"""
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

@@ -34,6 +34,7 @@ class UrlBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -34,6 +34,7 @@ class ValidationBlock(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -60,6 +60,7 @@ class WorkflowDefinitionBlocksItem_Action(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -130,6 +131,7 @@ class WorkflowDefinitionBlocksItem_Extraction(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -165,6 +167,7 @@ class WorkflowDefinitionBlocksItem_FileDownload(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -264,6 +267,7 @@ class WorkflowDefinitionBlocksItem_GotoUrl(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -299,6 +303,7 @@ class WorkflowDefinitionBlocksItem_Login(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -334,6 +339,7 @@ class WorkflowDefinitionBlocksItem_Navigation(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -412,6 +418,7 @@ class WorkflowDefinitionBlocksItem_Task(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -506,6 +513,7 @@ class WorkflowDefinitionBlocksItem_Validation(UniversalBaseModel):
totp_identifier: typing.Optional[str] = None totp_identifier: typing.Optional[str] = None
cache_actions: typing.Optional[bool] = None cache_actions: typing.Optional[bool] = None
complete_verification: typing.Optional[bool] = None complete_verification: typing.Optional[bool] = None
include_action_history_in_verification: typing.Optional[bool] = None
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

View File

@@ -10,12 +10,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
class WorkflowRunRequest(UniversalBaseModel): class WorkflowRunRequest(UniversalBaseModel):
workflow_id: str = pydantic.Field() workflow_id: str = pydantic.Field()
""" """
ID of the workflow to run ID of the workflow to run. Workflow ID starts with `wpid_`.
"""
title: typing.Optional[str] = pydantic.Field(default=None)
"""
Optional title for this workflow run
""" """
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
@@ -23,6 +18,11 @@ class WorkflowRunRequest(UniversalBaseModel):
Parameters to pass to the workflow Parameters to pass to the workflow
""" """
title: typing.Optional[str] = pydantic.Field(default=None)
"""
The title for this workflow run
"""
proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None) proxy_location: typing.Optional[ProxyLocation] = pydantic.Field(default=None)
""" """
Location of proxy to use for this workflow run Location of proxy to use for this workflow run
@@ -30,22 +30,22 @@ class WorkflowRunRequest(UniversalBaseModel):
webhook_url: typing.Optional[str] = pydantic.Field(default=None) webhook_url: typing.Optional[str] = pydantic.Field(default=None)
""" """
URL to send workflow status updates to after a run is finished URL to send workflow status updates to after a run is finished. Refer to https://docs.skyvern.com/running-tasks/webhooks-faq for webhook questions.
""" """
totp_url: typing.Optional[str] = pydantic.Field(default=None) totp_url: typing.Optional[str] = pydantic.Field(default=None)
""" """
URL for TOTP authentication setup if Skyvern should be polling endpoint for 2FA codes URL that serves TOTP/2FA/MFA codes for Skyvern to use during the workflow run. Refer to https://docs.skyvern.com/running-tasks/advanced-features#get-code-from-your-endpoint
""" """
totp_identifier: typing.Optional[str] = pydantic.Field(default=None) totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
""" """
Identifier for TOTP (Time-based One-Time Password) authentication if codes are being pushed to Skyvern Identifier for the TOTP/2FA/MFA code when the code is pushed to Skyvern. Refer to https://docs.skyvern.com/running-tasks/advanced-features#time-based-one-time-password-totp
""" """
browser_session_id: typing.Optional[str] = pydantic.Field(default=None) browser_session_id: typing.Optional[str] = pydantic.Field(default=None)
""" """
ID of an existing browser session to reuse, having it continue from the current screen state ID of a Skyvern browser session to reuse, having it continue from the current screen state
""" """
if IS_PYDANTIC_V2: if IS_PYDANTIC_V2:

View File

@@ -14,7 +14,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
class WorkflowRunResponse(UniversalBaseModel): class WorkflowRunResponse(UniversalBaseModel):
run_id: str = pydantic.Field() run_id: str = pydantic.Field()
""" """
Unique identifier for this run Unique identifier for this run. Run ID starts with `tsk_` for task runs and `wr_` for workflow runs.
""" """
status: RunStatus = pydantic.Field() status: RunStatus = pydantic.Field()
@@ -24,7 +24,7 @@ class WorkflowRunResponse(UniversalBaseModel):
output: typing.Optional[WorkflowRunResponseOutput] = pydantic.Field(default=None) output: typing.Optional[WorkflowRunResponseOutput] = pydantic.Field(default=None)
""" """
Output data from the run, if any. Format depends on the schema in the input Output data from the run, if any. Format/schema depends on the data extracted by the run.
""" """
downloaded_files: typing.Optional[typing.List[FileInfo]] = pydantic.Field(default=None) downloaded_files: typing.Optional[typing.List[FileInfo]] = pydantic.Field(default=None)
@@ -39,7 +39,7 @@ class WorkflowRunResponse(UniversalBaseModel):
failure_reason: typing.Optional[str] = pydantic.Field(default=None) failure_reason: typing.Optional[str] = pydantic.Field(default=None)
""" """
Reason for failure if the run failed Reason for failure if the run failed or terminated
""" """
created_at: dt.datetime = pydantic.Field() created_at: dt.datetime = pydantic.Field()