SDK: support actions skeleton (#3817)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d2d7b8e4b0
commit
33ad4cfcd1
@@ -40,6 +40,8 @@ if typing.TYPE_CHECKING:
|
||||
BitwardenSensitiveInformationParameterYaml,
|
||||
BlockType,
|
||||
BrowserSessionResponse,
|
||||
ClickAction,
|
||||
ClickActionData,
|
||||
CodeBlock,
|
||||
CodeBlockParametersItem,
|
||||
CodeBlockParametersItem_AwsSecret,
|
||||
@@ -79,6 +81,9 @@ if typing.TYPE_CHECKING:
|
||||
CreditCardCredentialResponse,
|
||||
DownloadToS3Block,
|
||||
DownloadToS3BlockYaml,
|
||||
ExtractAction,
|
||||
ExtractActionData,
|
||||
ExtractActionExtractSchema,
|
||||
ExtractionBlock,
|
||||
ExtractionBlockDataSchema,
|
||||
ExtractionBlockParametersItem,
|
||||
@@ -215,6 +220,8 @@ if typing.TYPE_CHECKING:
|
||||
HumanInteractionBlockParametersItem_Workflow,
|
||||
HumanInteractionBlockYaml,
|
||||
InputOrSelectContext,
|
||||
InputTextAction,
|
||||
InputTextActionData,
|
||||
LoginBlock,
|
||||
LoginBlockDataSchema,
|
||||
LoginBlockParametersItem,
|
||||
@@ -257,11 +264,19 @@ if typing.TYPE_CHECKING:
|
||||
PdfParserBlockYaml,
|
||||
ProxyLocation,
|
||||
RunEngine,
|
||||
RunSdkActionResponse,
|
||||
RunStatus,
|
||||
Script,
|
||||
ScriptFileCreate,
|
||||
ScriptRunResponse,
|
||||
SdkAction,
|
||||
SdkAction_AiClick,
|
||||
SdkAction_AiInputText,
|
||||
SdkAction_AiSelectOption,
|
||||
SdkAction_Extract,
|
||||
SelectOption,
|
||||
SelectOptionAction,
|
||||
SelectOptionActionData,
|
||||
SendEmailBlock,
|
||||
SendEmailBlockYaml,
|
||||
SkyvernForgeSdkSchemasCredentialsCredentialType,
|
||||
@@ -485,6 +500,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"BitwardenSensitiveInformationParameterYaml": ".types",
|
||||
"BlockType": ".types",
|
||||
"BrowserSessionResponse": ".types",
|
||||
"ClickAction": ".types",
|
||||
"ClickActionData": ".types",
|
||||
"CodeBlock": ".types",
|
||||
"CodeBlockParametersItem": ".types",
|
||||
"CodeBlockParametersItem_AwsSecret": ".types",
|
||||
@@ -524,6 +541,9 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"CreditCardCredentialResponse": ".types",
|
||||
"DownloadToS3Block": ".types",
|
||||
"DownloadToS3BlockYaml": ".types",
|
||||
"ExtractAction": ".types",
|
||||
"ExtractActionData": ".types",
|
||||
"ExtractActionExtractSchema": ".types",
|
||||
"ExtractionBlock": ".types",
|
||||
"ExtractionBlockDataSchema": ".types",
|
||||
"ExtractionBlockParametersItem": ".types",
|
||||
@@ -661,6 +681,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"HumanInteractionBlockParametersItem_Workflow": ".types",
|
||||
"HumanInteractionBlockYaml": ".types",
|
||||
"InputOrSelectContext": ".types",
|
||||
"InputTextAction": ".types",
|
||||
"InputTextActionData": ".types",
|
||||
"LoginBlock": ".types",
|
||||
"LoginBlockDataSchema": ".types",
|
||||
"LoginBlockParametersItem": ".types",
|
||||
@@ -704,11 +726,19 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"PdfParserBlockYaml": ".types",
|
||||
"ProxyLocation": ".types",
|
||||
"RunEngine": ".types",
|
||||
"RunSdkActionResponse": ".types",
|
||||
"RunStatus": ".types",
|
||||
"Script": ".types",
|
||||
"ScriptFileCreate": ".types",
|
||||
"ScriptRunResponse": ".types",
|
||||
"SdkAction": ".types",
|
||||
"SdkAction_AiClick": ".types",
|
||||
"SdkAction_AiInputText": ".types",
|
||||
"SdkAction_AiSelectOption": ".types",
|
||||
"SdkAction_Extract": ".types",
|
||||
"SelectOption": ".types",
|
||||
"SelectOptionAction": ".types",
|
||||
"SelectOptionActionData": ".types",
|
||||
"SendEmailBlock": ".types",
|
||||
"SendEmailBlockYaml": ".types",
|
||||
"Skyvern": ".client",
|
||||
@@ -955,6 +985,8 @@ __all__ = [
|
||||
"BitwardenSensitiveInformationParameterYaml",
|
||||
"BlockType",
|
||||
"BrowserSessionResponse",
|
||||
"ClickAction",
|
||||
"ClickActionData",
|
||||
"CodeBlock",
|
||||
"CodeBlockParametersItem",
|
||||
"CodeBlockParametersItem_AwsSecret",
|
||||
@@ -994,6 +1026,9 @@ __all__ = [
|
||||
"CreditCardCredentialResponse",
|
||||
"DownloadToS3Block",
|
||||
"DownloadToS3BlockYaml",
|
||||
"ExtractAction",
|
||||
"ExtractActionData",
|
||||
"ExtractActionExtractSchema",
|
||||
"ExtractionBlock",
|
||||
"ExtractionBlockDataSchema",
|
||||
"ExtractionBlockParametersItem",
|
||||
@@ -1131,6 +1166,8 @@ __all__ = [
|
||||
"HumanInteractionBlockParametersItem_Workflow",
|
||||
"HumanInteractionBlockYaml",
|
||||
"InputOrSelectContext",
|
||||
"InputTextAction",
|
||||
"InputTextActionData",
|
||||
"LoginBlock",
|
||||
"LoginBlockDataSchema",
|
||||
"LoginBlockParametersItem",
|
||||
@@ -1174,11 +1211,19 @@ __all__ = [
|
||||
"PdfParserBlockYaml",
|
||||
"ProxyLocation",
|
||||
"RunEngine",
|
||||
"RunSdkActionResponse",
|
||||
"RunStatus",
|
||||
"Script",
|
||||
"ScriptFileCreate",
|
||||
"ScriptRunResponse",
|
||||
"SdkAction",
|
||||
"SdkAction_AiClick",
|
||||
"SdkAction_AiInputText",
|
||||
"SdkAction_AiSelectOption",
|
||||
"SdkAction_Extract",
|
||||
"SelectOption",
|
||||
"SelectOptionAction",
|
||||
"SelectOptionActionData",
|
||||
"SendEmailBlock",
|
||||
"SendEmailBlockYaml",
|
||||
"Skyvern",
|
||||
|
||||
@@ -19,8 +19,10 @@ from .types.credential_response import CredentialResponse
|
||||
from .types.get_run_response import GetRunResponse
|
||||
from .types.proxy_location import ProxyLocation
|
||||
from .types.run_engine import RunEngine
|
||||
from .types.run_sdk_action_response import RunSdkActionResponse
|
||||
from .types.script import Script
|
||||
from .types.script_file_create import ScriptFileCreate
|
||||
from .types.sdk_action import SdkAction
|
||||
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
|
||||
@@ -1494,6 +1496,71 @@ class Skyvern:
|
||||
_response = self._raw_client.deploy_script(script_id, files=files, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
def run_sdk_action(
|
||||
self,
|
||||
*,
|
||||
url: str,
|
||||
action: SdkAction,
|
||||
user_agent: typing.Optional[str] = None,
|
||||
browser_session_id: typing.Optional[str] = OMIT,
|
||||
browser_address: typing.Optional[str] = OMIT,
|
||||
workflow_run_id: typing.Optional[str] = OMIT,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> RunSdkActionResponse:
|
||||
"""
|
||||
Execute a single SDK action with the specified parameters
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url : str
|
||||
The URL where the action should be executed
|
||||
|
||||
action : SdkAction
|
||||
The action to execute with its specific parameters
|
||||
|
||||
user_agent : typing.Optional[str]
|
||||
|
||||
browser_session_id : typing.Optional[str]
|
||||
The browser session ID
|
||||
|
||||
browser_address : typing.Optional[str]
|
||||
The browser address
|
||||
|
||||
workflow_run_id : typing.Optional[str]
|
||||
Optional workflow run ID to continue an existing workflow run
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
RunSdkActionResponse
|
||||
Successfully executed SDK action
|
||||
|
||||
Examples
|
||||
--------
|
||||
from skyvern import SdkAction_AiClick, Skyvern
|
||||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
client.run_sdk_action(
|
||||
user_agent="x-user-agent",
|
||||
url="url",
|
||||
action=SdkAction_AiClick(),
|
||||
)
|
||||
"""
|
||||
_response = self._raw_client.run_sdk_action(
|
||||
url=url,
|
||||
action=action,
|
||||
user_agent=user_agent,
|
||||
browser_session_id=browser_session_id,
|
||||
browser_address=browser_address,
|
||||
workflow_run_id=workflow_run_id,
|
||||
request_options=request_options,
|
||||
)
|
||||
return _response.data
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
if self._scripts is None:
|
||||
@@ -3174,6 +3241,79 @@ class AsyncSkyvern:
|
||||
_response = await self._raw_client.deploy_script(script_id, files=files, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
async def run_sdk_action(
|
||||
self,
|
||||
*,
|
||||
url: str,
|
||||
action: SdkAction,
|
||||
user_agent: typing.Optional[str] = None,
|
||||
browser_session_id: typing.Optional[str] = OMIT,
|
||||
browser_address: typing.Optional[str] = OMIT,
|
||||
workflow_run_id: typing.Optional[str] = OMIT,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> RunSdkActionResponse:
|
||||
"""
|
||||
Execute a single SDK action with the specified parameters
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url : str
|
||||
The URL where the action should be executed
|
||||
|
||||
action : SdkAction
|
||||
The action to execute with its specific parameters
|
||||
|
||||
user_agent : typing.Optional[str]
|
||||
|
||||
browser_session_id : typing.Optional[str]
|
||||
The browser session ID
|
||||
|
||||
browser_address : typing.Optional[str]
|
||||
The browser address
|
||||
|
||||
workflow_run_id : typing.Optional[str]
|
||||
Optional workflow run ID to continue an existing workflow run
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
RunSdkActionResponse
|
||||
Successfully executed SDK action
|
||||
|
||||
Examples
|
||||
--------
|
||||
import asyncio
|
||||
|
||||
from skyvern import AsyncSkyvern, SdkAction_AiClick
|
||||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
await client.run_sdk_action(
|
||||
user_agent="x-user-agent",
|
||||
url="url",
|
||||
action=SdkAction_AiClick(),
|
||||
)
|
||||
|
||||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._raw_client.run_sdk_action(
|
||||
url=url,
|
||||
action=action,
|
||||
user_agent=user_agent,
|
||||
browser_session_id=browser_session_id,
|
||||
browser_address=browser_address,
|
||||
workflow_run_id=workflow_run_id,
|
||||
request_options=request_options,
|
||||
)
|
||||
return _response.data
|
||||
|
||||
@property
|
||||
def scripts(self):
|
||||
if self._scripts is None:
|
||||
|
||||
@@ -24,8 +24,10 @@ from .types.credential_response import CredentialResponse
|
||||
from .types.get_run_response import GetRunResponse
|
||||
from .types.proxy_location import ProxyLocation
|
||||
from .types.run_engine import RunEngine
|
||||
from .types.run_sdk_action_response import RunSdkActionResponse
|
||||
from .types.script import Script
|
||||
from .types.script_file_create import ScriptFileCreate
|
||||
from .types.sdk_action import SdkAction
|
||||
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
|
||||
@@ -2052,6 +2054,114 @@ class RawSkyvern:
|
||||
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 run_sdk_action(
|
||||
self,
|
||||
*,
|
||||
url: str,
|
||||
action: SdkAction,
|
||||
user_agent: typing.Optional[str] = None,
|
||||
browser_session_id: typing.Optional[str] = OMIT,
|
||||
browser_address: typing.Optional[str] = OMIT,
|
||||
workflow_run_id: typing.Optional[str] = OMIT,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> HttpResponse[RunSdkActionResponse]:
|
||||
"""
|
||||
Execute a single SDK action with the specified parameters
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url : str
|
||||
The URL where the action should be executed
|
||||
|
||||
action : SdkAction
|
||||
The action to execute with its specific parameters
|
||||
|
||||
user_agent : typing.Optional[str]
|
||||
|
||||
browser_session_id : typing.Optional[str]
|
||||
The browser session ID
|
||||
|
||||
browser_address : typing.Optional[str]
|
||||
The browser address
|
||||
|
||||
workflow_run_id : typing.Optional[str]
|
||||
Optional workflow run ID to continue an existing workflow run
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
HttpResponse[RunSdkActionResponse]
|
||||
Successfully executed SDK action
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
"v1/sdk/run_action",
|
||||
method="POST",
|
||||
json={
|
||||
"url": url,
|
||||
"browser_session_id": browser_session_id,
|
||||
"browser_address": browser_address,
|
||||
"workflow_run_id": workflow_run_id,
|
||||
"action": convert_and_respect_annotation_metadata(
|
||||
object_=action, annotation=SdkAction, direction="write"
|
||||
),
|
||||
},
|
||||
headers={
|
||||
"content-type": "application/json",
|
||||
"x-user-agent": str(user_agent) if user_agent is not None else None,
|
||||
},
|
||||
request_options=request_options,
|
||||
omit=OMIT,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
RunSdkActionResponse,
|
||||
parse_obj_as(
|
||||
type_=RunSdkActionResponse, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return HttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 400:
|
||||
raise BadRequestError(
|
||||
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 == 403:
|
||||
raise ForbiddenError(
|
||||
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 AsyncRawSkyvern:
|
||||
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
||||
@@ -4064,3 +4174,111 @@ class AsyncRawSkyvern:
|
||||
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 run_sdk_action(
|
||||
self,
|
||||
*,
|
||||
url: str,
|
||||
action: SdkAction,
|
||||
user_agent: typing.Optional[str] = None,
|
||||
browser_session_id: typing.Optional[str] = OMIT,
|
||||
browser_address: typing.Optional[str] = OMIT,
|
||||
workflow_run_id: typing.Optional[str] = OMIT,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
) -> AsyncHttpResponse[RunSdkActionResponse]:
|
||||
"""
|
||||
Execute a single SDK action with the specified parameters
|
||||
|
||||
Parameters
|
||||
----------
|
||||
url : str
|
||||
The URL where the action should be executed
|
||||
|
||||
action : SdkAction
|
||||
The action to execute with its specific parameters
|
||||
|
||||
user_agent : typing.Optional[str]
|
||||
|
||||
browser_session_id : typing.Optional[str]
|
||||
The browser session ID
|
||||
|
||||
browser_address : typing.Optional[str]
|
||||
The browser address
|
||||
|
||||
workflow_run_id : typing.Optional[str]
|
||||
Optional workflow run ID to continue an existing workflow run
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
AsyncHttpResponse[RunSdkActionResponse]
|
||||
Successfully executed SDK action
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
"v1/sdk/run_action",
|
||||
method="POST",
|
||||
json={
|
||||
"url": url,
|
||||
"browser_session_id": browser_session_id,
|
||||
"browser_address": browser_address,
|
||||
"workflow_run_id": workflow_run_id,
|
||||
"action": convert_and_respect_annotation_metadata(
|
||||
object_=action, annotation=SdkAction, direction="write"
|
||||
),
|
||||
},
|
||||
headers={
|
||||
"content-type": "application/json",
|
||||
"x-user-agent": str(user_agent) if user_agent is not None else None,
|
||||
},
|
||||
request_options=request_options,
|
||||
omit=OMIT,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
RunSdkActionResponse,
|
||||
parse_obj_as(
|
||||
type_=RunSdkActionResponse, # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return AsyncHttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 400:
|
||||
raise BadRequestError(
|
||||
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 == 403:
|
||||
raise ForbiddenError(
|
||||
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)
|
||||
|
||||
@@ -41,6 +41,8 @@ if typing.TYPE_CHECKING:
|
||||
from .bitwarden_sensitive_information_parameter_yaml import BitwardenSensitiveInformationParameterYaml
|
||||
from .block_type import BlockType
|
||||
from .browser_session_response import BrowserSessionResponse
|
||||
from .click_action import ClickAction
|
||||
from .click_action_data import ClickActionData
|
||||
from .code_block import CodeBlock
|
||||
from .code_block_parameters_item import (
|
||||
CodeBlockParametersItem,
|
||||
@@ -84,6 +86,9 @@ if typing.TYPE_CHECKING:
|
||||
from .credit_card_credential_response import CreditCardCredentialResponse
|
||||
from .download_to_s3block import DownloadToS3Block
|
||||
from .download_to_s3block_yaml import DownloadToS3BlockYaml
|
||||
from .extract_action import ExtractAction
|
||||
from .extract_action_data import ExtractActionData
|
||||
from .extract_action_extract_schema import ExtractActionExtractSchema
|
||||
from .extraction_block import ExtractionBlock
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import (
|
||||
@@ -236,6 +241,8 @@ if typing.TYPE_CHECKING:
|
||||
)
|
||||
from .human_interaction_block_yaml import HumanInteractionBlockYaml
|
||||
from .input_or_select_context import InputOrSelectContext
|
||||
from .input_text_action import InputTextAction
|
||||
from .input_text_action_data import InputTextActionData
|
||||
from .login_block import LoginBlock
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import (
|
||||
@@ -282,11 +289,21 @@ if typing.TYPE_CHECKING:
|
||||
from .pdf_parser_block_yaml import PdfParserBlockYaml
|
||||
from .proxy_location import ProxyLocation
|
||||
from .run_engine import RunEngine
|
||||
from .run_sdk_action_response import RunSdkActionResponse
|
||||
from .run_status import RunStatus
|
||||
from .script import Script
|
||||
from .script_file_create import ScriptFileCreate
|
||||
from .script_run_response import ScriptRunResponse
|
||||
from .sdk_action import (
|
||||
SdkAction,
|
||||
SdkAction_AiClick,
|
||||
SdkAction_AiInputText,
|
||||
SdkAction_AiSelectOption,
|
||||
SdkAction_Extract,
|
||||
)
|
||||
from .select_option import SelectOption
|
||||
from .select_option_action import SelectOptionAction
|
||||
from .select_option_action_data import SelectOptionActionData
|
||||
from .send_email_block import SendEmailBlock
|
||||
from .send_email_block_yaml import SendEmailBlockYaml
|
||||
from .skyvern_forge_sdk_schemas_credentials_credential_type import SkyvernForgeSdkSchemasCredentialsCredentialType
|
||||
@@ -520,6 +537,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"BitwardenSensitiveInformationParameterYaml": ".bitwarden_sensitive_information_parameter_yaml",
|
||||
"BlockType": ".block_type",
|
||||
"BrowserSessionResponse": ".browser_session_response",
|
||||
"ClickAction": ".click_action",
|
||||
"ClickActionData": ".click_action_data",
|
||||
"CodeBlock": ".code_block",
|
||||
"CodeBlockParametersItem": ".code_block_parameters_item",
|
||||
"CodeBlockParametersItem_AwsSecret": ".code_block_parameters_item",
|
||||
@@ -559,6 +578,9 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"CreditCardCredentialResponse": ".credit_card_credential_response",
|
||||
"DownloadToS3Block": ".download_to_s3block",
|
||||
"DownloadToS3BlockYaml": ".download_to_s3block_yaml",
|
||||
"ExtractAction": ".extract_action",
|
||||
"ExtractActionData": ".extract_action_data",
|
||||
"ExtractActionExtractSchema": ".extract_action_extract_schema",
|
||||
"ExtractionBlock": ".extraction_block",
|
||||
"ExtractionBlockDataSchema": ".extraction_block_data_schema",
|
||||
"ExtractionBlockParametersItem": ".extraction_block_parameters_item",
|
||||
@@ -695,6 +717,8 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"HumanInteractionBlockParametersItem_Workflow": ".human_interaction_block_parameters_item",
|
||||
"HumanInteractionBlockYaml": ".human_interaction_block_yaml",
|
||||
"InputOrSelectContext": ".input_or_select_context",
|
||||
"InputTextAction": ".input_text_action",
|
||||
"InputTextActionData": ".input_text_action_data",
|
||||
"LoginBlock": ".login_block",
|
||||
"LoginBlockDataSchema": ".login_block_data_schema",
|
||||
"LoginBlockParametersItem": ".login_block_parameters_item",
|
||||
@@ -737,11 +761,19 @@ _dynamic_imports: typing.Dict[str, str] = {
|
||||
"PdfParserBlockYaml": ".pdf_parser_block_yaml",
|
||||
"ProxyLocation": ".proxy_location",
|
||||
"RunEngine": ".run_engine",
|
||||
"RunSdkActionResponse": ".run_sdk_action_response",
|
||||
"RunStatus": ".run_status",
|
||||
"Script": ".script",
|
||||
"ScriptFileCreate": ".script_file_create",
|
||||
"ScriptRunResponse": ".script_run_response",
|
||||
"SdkAction": ".sdk_action",
|
||||
"SdkAction_AiClick": ".sdk_action",
|
||||
"SdkAction_AiInputText": ".sdk_action",
|
||||
"SdkAction_AiSelectOption": ".sdk_action",
|
||||
"SdkAction_Extract": ".sdk_action",
|
||||
"SelectOption": ".select_option",
|
||||
"SelectOptionAction": ".select_option_action",
|
||||
"SelectOptionActionData": ".select_option_action_data",
|
||||
"SendEmailBlock": ".send_email_block",
|
||||
"SendEmailBlockYaml": ".send_email_block_yaml",
|
||||
"SkyvernForgeSdkSchemasCredentialsCredentialType": ".skyvern_forge_sdk_schemas_credentials_credential_type",
|
||||
@@ -981,6 +1013,8 @@ __all__ = [
|
||||
"BitwardenSensitiveInformationParameterYaml",
|
||||
"BlockType",
|
||||
"BrowserSessionResponse",
|
||||
"ClickAction",
|
||||
"ClickActionData",
|
||||
"CodeBlock",
|
||||
"CodeBlockParametersItem",
|
||||
"CodeBlockParametersItem_AwsSecret",
|
||||
@@ -1020,6 +1054,9 @@ __all__ = [
|
||||
"CreditCardCredentialResponse",
|
||||
"DownloadToS3Block",
|
||||
"DownloadToS3BlockYaml",
|
||||
"ExtractAction",
|
||||
"ExtractActionData",
|
||||
"ExtractActionExtractSchema",
|
||||
"ExtractionBlock",
|
||||
"ExtractionBlockDataSchema",
|
||||
"ExtractionBlockParametersItem",
|
||||
@@ -1156,6 +1193,8 @@ __all__ = [
|
||||
"HumanInteractionBlockParametersItem_Workflow",
|
||||
"HumanInteractionBlockYaml",
|
||||
"InputOrSelectContext",
|
||||
"InputTextAction",
|
||||
"InputTextActionData",
|
||||
"LoginBlock",
|
||||
"LoginBlockDataSchema",
|
||||
"LoginBlockParametersItem",
|
||||
@@ -1198,11 +1237,19 @@ __all__ = [
|
||||
"PdfParserBlockYaml",
|
||||
"ProxyLocation",
|
||||
"RunEngine",
|
||||
"RunSdkActionResponse",
|
||||
"RunStatus",
|
||||
"Script",
|
||||
"ScriptFileCreate",
|
||||
"ScriptRunResponse",
|
||||
"SdkAction",
|
||||
"SdkAction_AiClick",
|
||||
"SdkAction_AiInputText",
|
||||
"SdkAction_AiSelectOption",
|
||||
"SdkAction_Extract",
|
||||
"SelectOption",
|
||||
"SelectOptionAction",
|
||||
"SelectOptionActionData",
|
||||
"SendEmailBlock",
|
||||
"SendEmailBlockYaml",
|
||||
"SkyvernForgeSdkSchemasCredentialsCredentialType",
|
||||
|
||||
38
skyvern/client/types/click_action.py
Normal file
38
skyvern/client/types/click_action.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .click_action_data import ClickActionData
|
||||
|
||||
|
||||
class ClickAction(UniversalBaseModel):
|
||||
selector: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
CSS selector for the element
|
||||
"""
|
||||
|
||||
intention: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The intention or goal of the click
|
||||
"""
|
||||
|
||||
data: typing.Optional[ClickActionData] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional context data
|
||||
"""
|
||||
|
||||
timeout: typing.Optional[float] = pydantic.Field(default=None)
|
||||
"""
|
||||
Timeout in milliseconds
|
||||
"""
|
||||
|
||||
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
|
||||
5
skyvern/client/types/click_action_data.py
Normal file
5
skyvern/client/types/click_action_data.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ClickActionData = typing.Union[str, typing.Dict[str, typing.Optional[typing.Any]]]
|
||||
44
skyvern/client/types/extract_action.py
Normal file
44
skyvern/client/types/extract_action.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .extract_action_data import ExtractActionData
|
||||
from .extract_action_extract_schema import ExtractActionExtractSchema
|
||||
|
||||
|
||||
class ExtractAction(UniversalBaseModel):
|
||||
prompt: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Extraction prompt
|
||||
"""
|
||||
|
||||
extract_schema: typing.Optional[ExtractActionExtractSchema] = pydantic.Field(default=None)
|
||||
"""
|
||||
Schema for extraction
|
||||
"""
|
||||
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
|
||||
"""
|
||||
Error code mapping for extraction
|
||||
"""
|
||||
|
||||
intention: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The intention or goal of the extraction
|
||||
"""
|
||||
|
||||
data: typing.Optional[ExtractActionData] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional context data
|
||||
"""
|
||||
|
||||
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
|
||||
5
skyvern/client/types/extract_action_data.py
Normal file
5
skyvern/client/types/extract_action_data.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ExtractActionData = typing.Union[str, typing.Dict[str, typing.Optional[typing.Any]]]
|
||||
7
skyvern/client/types/extract_action_extract_schema.py
Normal file
7
skyvern/client/types/extract_action_extract_schema.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
ExtractActionExtractSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
53
skyvern/client/types/input_text_action.py
Normal file
53
skyvern/client/types/input_text_action.py
Normal file
@@ -0,0 +1,53 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .input_text_action_data import InputTextActionData
|
||||
|
||||
|
||||
class InputTextAction(UniversalBaseModel):
|
||||
selector: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
CSS selector for the element
|
||||
"""
|
||||
|
||||
value: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Value to input
|
||||
"""
|
||||
|
||||
intention: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The intention or goal of the input
|
||||
"""
|
||||
|
||||
data: typing.Optional[InputTextActionData] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional context data
|
||||
"""
|
||||
|
||||
totp_identifier: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
TOTP identifier for input_text actions
|
||||
"""
|
||||
|
||||
totp_url: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
TOTP URL for input_text actions
|
||||
"""
|
||||
|
||||
timeout: typing.Optional[float] = pydantic.Field(default=None)
|
||||
"""
|
||||
Timeout in milliseconds
|
||||
"""
|
||||
|
||||
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
|
||||
5
skyvern/client/types/input_text_action_data.py
Normal file
5
skyvern/client/types/input_text_action_data.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
InputTextActionData = typing.Union[str, typing.Dict[str, typing.Optional[typing.Any]]]
|
||||
27
skyvern/client/types/run_sdk_action_response.py
Normal file
27
skyvern/client/types/run_sdk_action_response.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class RunSdkActionResponse(UniversalBaseModel):
|
||||
workflow_run_id: str = pydantic.Field()
|
||||
"""
|
||||
The workflow run ID used for this action
|
||||
"""
|
||||
|
||||
result: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None)
|
||||
"""
|
||||
The result from the action (e.g., selector, value, extracted data)
|
||||
"""
|
||||
|
||||
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
|
||||
89
skyvern/client/types/sdk_action.py
Normal file
89
skyvern/client/types/sdk_action.py
Normal file
@@ -0,0 +1,89 @@
|
||||
# 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
|
||||
|
||||
|
||||
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_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_Extract]
|
||||
43
skyvern/client/types/select_option_action.py
Normal file
43
skyvern/client/types/select_option_action.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .select_option_action_data import SelectOptionActionData
|
||||
|
||||
|
||||
class SelectOptionAction(UniversalBaseModel):
|
||||
selector: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
CSS selector for the element
|
||||
"""
|
||||
|
||||
value: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
Value to select
|
||||
"""
|
||||
|
||||
intention: typing.Optional[str] = pydantic.Field(default=None)
|
||||
"""
|
||||
The intention or goal of the selection
|
||||
"""
|
||||
|
||||
data: typing.Optional[SelectOptionActionData] = pydantic.Field(default=None)
|
||||
"""
|
||||
Additional context data
|
||||
"""
|
||||
|
||||
timeout: typing.Optional[float] = pydantic.Field(default=None)
|
||||
"""
|
||||
Timeout in milliseconds
|
||||
"""
|
||||
|
||||
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
|
||||
5
skyvern/client/types/select_option_action_data.py
Normal file
5
skyvern/client/types/select_option_action_data.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
SelectOptionActionData = typing.Union[str, typing.Dict[str, typing.Optional[typing.Any]]]
|
||||
Reference in New Issue
Block a user