mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2026-04-28 03:30:10 +00:00
Fern: regenerated Python SDK (#3829)
This commit is contained in:
parent
c12c047768
commit
ba0b25cb4b
150 changed files with 8305 additions and 3701 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,33 +1,91 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .api_error import ApiError
|
||||
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
|
||||
from .http_client import AsyncHttpClient, HttpClient
|
||||
from .jsonable_encoder import jsonable_encoder
|
||||
from .pydantic_utilities import (
|
||||
IS_PYDANTIC_V2,
|
||||
UniversalBaseModel,
|
||||
UniversalRootModel,
|
||||
parse_obj_as,
|
||||
universal_field_validator,
|
||||
universal_root_validator,
|
||||
update_forward_refs,
|
||||
)
|
||||
from .query_encoder import encode_query
|
||||
from .remove_none_from_dict import remove_none_from_dict
|
||||
from .request_options import RequestOptions
|
||||
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
||||
# isort: skip_file
|
||||
|
||||
import typing
|
||||
from importlib import import_module
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from .api_error import ApiError
|
||||
from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
|
||||
from .http_client import AsyncHttpClient, HttpClient
|
||||
from .http_response import AsyncHttpResponse, HttpResponse
|
||||
from .jsonable_encoder import jsonable_encoder
|
||||
from .pydantic_utilities import (
|
||||
IS_PYDANTIC_V2,
|
||||
UniversalBaseModel,
|
||||
UniversalRootModel,
|
||||
parse_obj_as,
|
||||
universal_field_validator,
|
||||
universal_root_validator,
|
||||
update_forward_refs,
|
||||
)
|
||||
from .query_encoder import encode_query
|
||||
from .remove_none_from_dict import remove_none_from_dict
|
||||
from .request_options import RequestOptions
|
||||
from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
|
||||
_dynamic_imports: typing.Dict[str, str] = {
|
||||
"ApiError": ".api_error",
|
||||
"AsyncClientWrapper": ".client_wrapper",
|
||||
"AsyncHttpClient": ".http_client",
|
||||
"AsyncHttpResponse": ".http_response",
|
||||
"BaseClientWrapper": ".client_wrapper",
|
||||
"FieldMetadata": ".serialization",
|
||||
"File": ".file",
|
||||
"HttpClient": ".http_client",
|
||||
"HttpResponse": ".http_response",
|
||||
"IS_PYDANTIC_V2": ".pydantic_utilities",
|
||||
"RequestOptions": ".request_options",
|
||||
"SyncClientWrapper": ".client_wrapper",
|
||||
"UniversalBaseModel": ".pydantic_utilities",
|
||||
"UniversalRootModel": ".pydantic_utilities",
|
||||
"convert_and_respect_annotation_metadata": ".serialization",
|
||||
"convert_file_dict_to_httpx_tuples": ".file",
|
||||
"encode_query": ".query_encoder",
|
||||
"jsonable_encoder": ".jsonable_encoder",
|
||||
"parse_obj_as": ".pydantic_utilities",
|
||||
"remove_none_from_dict": ".remove_none_from_dict",
|
||||
"serialize_datetime": ".datetime_utils",
|
||||
"universal_field_validator": ".pydantic_utilities",
|
||||
"universal_root_validator": ".pydantic_utilities",
|
||||
"update_forward_refs": ".pydantic_utilities",
|
||||
"with_content_type": ".file",
|
||||
}
|
||||
|
||||
|
||||
def __getattr__(attr_name: str) -> typing.Any:
|
||||
module_name = _dynamic_imports.get(attr_name)
|
||||
if module_name is None:
|
||||
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
||||
try:
|
||||
module = import_module(module_name, __package__)
|
||||
if module_name == f".{attr_name}":
|
||||
return module
|
||||
else:
|
||||
return getattr(module, attr_name)
|
||||
except ImportError as e:
|
||||
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
||||
except AttributeError as e:
|
||||
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
||||
|
||||
|
||||
def __dir__():
|
||||
lazy_attrs = list(_dynamic_imports.keys())
|
||||
return sorted(lazy_attrs)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ApiError",
|
||||
"AsyncClientWrapper",
|
||||
"AsyncHttpClient",
|
||||
"AsyncHttpResponse",
|
||||
"BaseClientWrapper",
|
||||
"FieldMetadata",
|
||||
"File",
|
||||
"HttpClient",
|
||||
"HttpResponse",
|
||||
"IS_PYDANTIC_V2",
|
||||
"RequestOptions",
|
||||
"SyncClientWrapper",
|
||||
|
|
|
|||
|
|
@ -1,15 +1,23 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
|
||||
class ApiError(Exception):
|
||||
status_code: typing.Optional[int]
|
||||
body: typing.Any
|
||||
headers: Optional[Dict[str, str]]
|
||||
status_code: Optional[int]
|
||||
body: Any
|
||||
|
||||
def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
headers: Optional[Dict[str, str]] = None,
|
||||
status_code: Optional[int] = None,
|
||||
body: Any = None,
|
||||
) -> None:
|
||||
self.headers = headers
|
||||
self.status_code = status_code
|
||||
self.body = body
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"status_code: {self.status_code}, body: {self.body}"
|
||||
return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
import httpx
|
||||
from .http_client import HttpClient
|
||||
from .http_client import AsyncHttpClient
|
||||
from .http_client import AsyncHttpClient, HttpClient
|
||||
|
||||
|
||||
class BaseClientWrapper:
|
||||
|
|
@ -11,26 +11,30 @@ class BaseClientWrapper:
|
|||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
x_api_key: str,
|
||||
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
):
|
||||
self._api_key = api_key
|
||||
self.x_api_key = x_api_key
|
||||
self._headers = headers
|
||||
self._base_url = base_url
|
||||
self._timeout = timeout
|
||||
|
||||
def get_headers(self) -> typing.Dict[str, str]:
|
||||
headers: typing.Dict[str, str] = {
|
||||
"User-Agent": "skyvern/0.2.20",
|
||||
"X-Fern-Language": "Python",
|
||||
"X-Fern-SDK-Name": "skyvern",
|
||||
"X-Fern-SDK-Version": "0.2.18",
|
||||
"X-Fern-SDK-Version": "0.2.20",
|
||||
**(self.get_custom_headers() or {}),
|
||||
}
|
||||
if self._api_key is not None:
|
||||
headers["x-api-key"] = self._api_key
|
||||
headers["x-api-key"] = self.x_api_key
|
||||
return headers
|
||||
|
||||
def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]:
|
||||
return self._headers
|
||||
|
||||
def get_base_url(self) -> str:
|
||||
return self._base_url
|
||||
|
||||
|
|
@ -43,12 +47,12 @@ class SyncClientWrapper(BaseClientWrapper):
|
|||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
x_api_key: str,
|
||||
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
httpx_client: httpx.Client,
|
||||
):
|
||||
super().__init__(api_key=api_key, x_api_key=x_api_key, base_url=base_url, timeout=timeout)
|
||||
super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = HttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
|
|
@ -62,12 +66,12 @@ class AsyncClientWrapper(BaseClientWrapper):
|
|||
self,
|
||||
*,
|
||||
api_key: typing.Optional[str] = None,
|
||||
x_api_key: str,
|
||||
headers: typing.Optional[typing.Dict[str, str]] = None,
|
||||
base_url: str,
|
||||
timeout: typing.Optional[float] = None,
|
||||
httpx_client: httpx.AsyncClient,
|
||||
):
|
||||
super().__init__(api_key=api_key, x_api_key=x_api_key, base_url=base_url, timeout=timeout)
|
||||
super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout)
|
||||
self.httpx_client = AsyncHttpClient(
|
||||
httpx_client=httpx_client,
|
||||
base_headers=self.get_headers,
|
||||
|
|
|
|||
18
skyvern/client/core/force_multipart.py
Normal file
18
skyvern/client/core/force_multipart.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
class ForceMultipartDict(Dict[str, Any]):
|
||||
"""
|
||||
A dictionary subclass that always evaluates to True in boolean contexts.
|
||||
|
||||
This is used to force multipart/form-data encoding in HTTP requests even when
|
||||
the dictionary is empty, which would normally evaluate to False.
|
||||
"""
|
||||
|
||||
def __bool__(self) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
FORCE_MULTIPART = ForceMultipartDict()
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import asyncio
|
||||
import email.utils
|
||||
import json
|
||||
import re
|
||||
import time
|
||||
import typing
|
||||
|
|
@ -11,12 +10,13 @@ from contextlib import asynccontextmanager, contextmanager
|
|||
from random import random
|
||||
|
||||
import httpx
|
||||
|
||||
from .file import File, convert_file_dict_to_httpx_tuples
|
||||
from .force_multipart import FORCE_MULTIPART
|
||||
from .jsonable_encoder import jsonable_encoder
|
||||
from .query_encoder import encode_query
|
||||
from .remove_none_from_dict import remove_none_from_dict
|
||||
from .request_options import RequestOptions
|
||||
from httpx._types import RequestFiles
|
||||
|
||||
INITIAL_RETRY_DELAY_SECONDS = 0.5
|
||||
MAX_RETRY_DELAY_SECONDS = 10
|
||||
|
|
@ -180,11 +180,17 @@ class HttpClient:
|
|||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
files: typing.Optional[
|
||||
typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
|
||||
typing.List[typing.Tuple[str, File]],
|
||||
]
|
||||
] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 2,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
force_multipart: typing.Optional[bool] = None,
|
||||
) -> httpx.Response:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
|
|
@ -195,6 +201,15 @@ class HttpClient:
|
|||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
request_files: typing.Optional[RequestFiles] = (
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit and isinstance(files, dict))
|
||||
else None
|
||||
)
|
||||
|
||||
if (request_files is None or len(request_files) == 0) and force_multipart:
|
||||
request_files = FORCE_MULTIPART
|
||||
|
||||
response = self.httpx_client.request(
|
||||
method=method,
|
||||
url=urllib.parse.urljoin(f"{base_url}/", path),
|
||||
|
|
@ -227,11 +242,7 @@ class HttpClient:
|
|||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit)
|
||||
else None
|
||||
),
|
||||
files=request_files,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
|
|
@ -266,11 +277,17 @@ class HttpClient:
|
|||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
files: typing.Optional[
|
||||
typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
|
||||
typing.List[typing.Tuple[str, File]],
|
||||
]
|
||||
] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 2,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
force_multipart: typing.Optional[bool] = None,
|
||||
) -> typing.Iterator[httpx.Response]:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
|
|
@ -279,6 +296,15 @@ class HttpClient:
|
|||
else self.base_timeout()
|
||||
)
|
||||
|
||||
request_files: typing.Optional[RequestFiles] = (
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit and isinstance(files, dict))
|
||||
else None
|
||||
)
|
||||
|
||||
if (request_files is None or len(request_files) == 0) and force_multipart:
|
||||
request_files = FORCE_MULTIPART
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
with self.httpx_client.stream(
|
||||
|
|
@ -313,11 +339,7 @@ class HttpClient:
|
|||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit)
|
||||
else None
|
||||
),
|
||||
files=request_files,
|
||||
timeout=timeout,
|
||||
) as stream:
|
||||
yield stream
|
||||
|
|
@ -356,11 +378,17 @@ class AsyncHttpClient:
|
|||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
files: typing.Optional[
|
||||
typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
|
||||
typing.List[typing.Tuple[str, File]],
|
||||
]
|
||||
] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 2,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
force_multipart: typing.Optional[bool] = None,
|
||||
) -> httpx.Response:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
|
|
@ -369,6 +397,15 @@ class AsyncHttpClient:
|
|||
else self.base_timeout()
|
||||
)
|
||||
|
||||
request_files: typing.Optional[RequestFiles] = (
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit and isinstance(files, dict))
|
||||
else None
|
||||
)
|
||||
|
||||
if (request_files is None or len(request_files) == 0) and force_multipart:
|
||||
request_files = FORCE_MULTIPART
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
# Add the input to each of these and do None-safety checks
|
||||
|
|
@ -404,11 +441,7 @@ class AsyncHttpClient:
|
|||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if files is not None
|
||||
else None
|
||||
),
|
||||
files=request_files,
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
|
|
@ -442,11 +475,17 @@ class AsyncHttpClient:
|
|||
json: typing.Optional[typing.Any] = None,
|
||||
data: typing.Optional[typing.Any] = None,
|
||||
content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
|
||||
files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
|
||||
files: typing.Optional[
|
||||
typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]],
|
||||
typing.List[typing.Tuple[str, File]],
|
||||
]
|
||||
] = None,
|
||||
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
|
||||
request_options: typing.Optional[RequestOptions] = None,
|
||||
retries: int = 2,
|
||||
omit: typing.Optional[typing.Any] = None,
|
||||
force_multipart: typing.Optional[bool] = None,
|
||||
) -> typing.AsyncIterator[httpx.Response]:
|
||||
base_url = self.get_base_url(base_url)
|
||||
timeout = (
|
||||
|
|
@ -455,6 +494,15 @@ class AsyncHttpClient:
|
|||
else self.base_timeout()
|
||||
)
|
||||
|
||||
request_files: typing.Optional[RequestFiles] = (
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if (files is not None and files is not omit and isinstance(files, dict))
|
||||
else None
|
||||
)
|
||||
|
||||
if (request_files is None or len(request_files) == 0) and force_multipart:
|
||||
request_files = FORCE_MULTIPART
|
||||
|
||||
json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
|
||||
|
||||
async with self.httpx_client.stream(
|
||||
|
|
@ -489,11 +537,7 @@ class AsyncHttpClient:
|
|||
json=json_body,
|
||||
data=data_body,
|
||||
content=content,
|
||||
files=(
|
||||
convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit))
|
||||
if files is not None
|
||||
else None
|
||||
),
|
||||
files=request_files,
|
||||
timeout=timeout,
|
||||
) as stream:
|
||||
yield stream
|
||||
|
|
|
|||
55
skyvern/client/core/http_response.py
Normal file
55
skyvern/client/core/http_response.py
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import Dict, Generic, TypeVar
|
||||
|
||||
import httpx
|
||||
|
||||
# Generic to represent the underlying type of the data wrapped by the HTTP response.
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class BaseHttpResponse:
|
||||
"""Minimalist HTTP response wrapper that exposes response headers."""
|
||||
|
||||
_response: httpx.Response
|
||||
|
||||
def __init__(self, response: httpx.Response):
|
||||
self._response = response
|
||||
|
||||
@property
|
||||
def headers(self) -> Dict[str, str]:
|
||||
return dict(self._response.headers)
|
||||
|
||||
|
||||
class HttpResponse(Generic[T], BaseHttpResponse):
|
||||
"""HTTP response wrapper that exposes response headers and data."""
|
||||
|
||||
_data: T
|
||||
|
||||
def __init__(self, response: httpx.Response, data: T):
|
||||
super().__init__(response)
|
||||
self._data = data
|
||||
|
||||
@property
|
||||
def data(self) -> T:
|
||||
return self._data
|
||||
|
||||
def close(self) -> None:
|
||||
self._response.close()
|
||||
|
||||
|
||||
class AsyncHttpResponse(Generic[T], BaseHttpResponse):
|
||||
"""HTTP response wrapper that exposes response headers and data."""
|
||||
|
||||
_data: T
|
||||
|
||||
def __init__(self, response: httpx.Response, data: T):
|
||||
super().__init__(response)
|
||||
self._data = data
|
||||
|
||||
@property
|
||||
def data(self) -> T:
|
||||
return self._data
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._response.aclose()
|
||||
42
skyvern/client/core/http_sse/__init__.py
Normal file
42
skyvern/client/core/http_sse/__init__.py
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
# isort: skip_file
|
||||
|
||||
import typing
|
||||
from importlib import import_module
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from ._api import EventSource, aconnect_sse, connect_sse
|
||||
from ._exceptions import SSEError
|
||||
from ._models import ServerSentEvent
|
||||
_dynamic_imports: typing.Dict[str, str] = {
|
||||
"EventSource": "._api",
|
||||
"SSEError": "._exceptions",
|
||||
"ServerSentEvent": "._models",
|
||||
"aconnect_sse": "._api",
|
||||
"connect_sse": "._api",
|
||||
}
|
||||
|
||||
|
||||
def __getattr__(attr_name: str) -> typing.Any:
|
||||
module_name = _dynamic_imports.get(attr_name)
|
||||
if module_name is None:
|
||||
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
||||
try:
|
||||
module = import_module(module_name, __package__)
|
||||
if module_name == f".{attr_name}":
|
||||
return module
|
||||
else:
|
||||
return getattr(module, attr_name)
|
||||
except ImportError as e:
|
||||
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
||||
except AttributeError as e:
|
||||
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
||||
|
||||
|
||||
def __dir__():
|
||||
lazy_attrs = list(_dynamic_imports.keys())
|
||||
return sorted(lazy_attrs)
|
||||
|
||||
|
||||
__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"]
|
||||
112
skyvern/client/core/http_sse/_api.py
Normal file
112
skyvern/client/core/http_sse/_api.py
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import re
|
||||
from contextlib import asynccontextmanager, contextmanager
|
||||
from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast
|
||||
|
||||
import httpx
|
||||
from ._decoders import SSEDecoder
|
||||
from ._exceptions import SSEError
|
||||
from ._models import ServerSentEvent
|
||||
|
||||
|
||||
class EventSource:
|
||||
def __init__(self, response: httpx.Response) -> None:
|
||||
self._response = response
|
||||
|
||||
def _check_content_type(self) -> None:
|
||||
content_type = self._response.headers.get("content-type", "").partition(";")[0]
|
||||
if "text/event-stream" not in content_type:
|
||||
raise SSEError(
|
||||
f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}"
|
||||
)
|
||||
|
||||
def _get_charset(self) -> str:
|
||||
"""Extract charset from Content-Type header, fallback to UTF-8."""
|
||||
content_type = self._response.headers.get("content-type", "")
|
||||
|
||||
# Parse charset parameter using regex
|
||||
charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE)
|
||||
if charset_match:
|
||||
charset = charset_match.group(1).strip("\"'")
|
||||
# Validate that it's a known encoding
|
||||
try:
|
||||
# Test if the charset is valid by trying to encode/decode
|
||||
"test".encode(charset).decode(charset)
|
||||
return charset
|
||||
except (LookupError, UnicodeError):
|
||||
# If charset is invalid, fall back to UTF-8
|
||||
pass
|
||||
|
||||
# Default to UTF-8 if no charset specified or invalid charset
|
||||
return "utf-8"
|
||||
|
||||
@property
|
||||
def response(self) -> httpx.Response:
|
||||
return self._response
|
||||
|
||||
def iter_sse(self) -> Iterator[ServerSentEvent]:
|
||||
self._check_content_type()
|
||||
decoder = SSEDecoder()
|
||||
charset = self._get_charset()
|
||||
|
||||
buffer = ""
|
||||
for chunk in self._response.iter_bytes():
|
||||
# Decode chunk using detected charset
|
||||
text_chunk = chunk.decode(charset, errors="replace")
|
||||
buffer += text_chunk
|
||||
|
||||
# Process complete lines
|
||||
while "\n" in buffer:
|
||||
line, buffer = buffer.split("\n", 1)
|
||||
line = line.rstrip("\r")
|
||||
sse = decoder.decode(line)
|
||||
# when we reach a "\n\n" => line = ''
|
||||
# => decoder will attempt to return an SSE Event
|
||||
if sse is not None:
|
||||
yield sse
|
||||
|
||||
# Process any remaining data in buffer
|
||||
if buffer.strip():
|
||||
line = buffer.rstrip("\r")
|
||||
sse = decoder.decode(line)
|
||||
if sse is not None:
|
||||
yield sse
|
||||
|
||||
async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]:
|
||||
self._check_content_type()
|
||||
decoder = SSEDecoder()
|
||||
lines = cast(AsyncGenerator[str, None], self._response.aiter_lines())
|
||||
try:
|
||||
async for line in lines:
|
||||
line = line.rstrip("\n")
|
||||
sse = decoder.decode(line)
|
||||
if sse is not None:
|
||||
yield sse
|
||||
finally:
|
||||
await lines.aclose()
|
||||
|
||||
|
||||
@contextmanager
|
||||
def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]:
|
||||
headers = kwargs.pop("headers", {})
|
||||
headers["Accept"] = "text/event-stream"
|
||||
headers["Cache-Control"] = "no-store"
|
||||
|
||||
with client.stream(method, url, headers=headers, **kwargs) as response:
|
||||
yield EventSource(response)
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def aconnect_sse(
|
||||
client: httpx.AsyncClient,
|
||||
method: str,
|
||||
url: str,
|
||||
**kwargs: Any,
|
||||
) -> AsyncIterator[EventSource]:
|
||||
headers = kwargs.pop("headers", {})
|
||||
headers["Accept"] = "text/event-stream"
|
||||
headers["Cache-Control"] = "no-store"
|
||||
|
||||
async with client.stream(method, url, headers=headers, **kwargs) as response:
|
||||
yield EventSource(response)
|
||||
61
skyvern/client/core/http_sse/_decoders.py
Normal file
61
skyvern/client/core/http_sse/_decoders.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ._models import ServerSentEvent
|
||||
|
||||
|
||||
class SSEDecoder:
|
||||
def __init__(self) -> None:
|
||||
self._event = ""
|
||||
self._data: List[str] = []
|
||||
self._last_event_id = ""
|
||||
self._retry: Optional[int] = None
|
||||
|
||||
def decode(self, line: str) -> Optional[ServerSentEvent]:
|
||||
# See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501
|
||||
|
||||
if not line:
|
||||
if not self._event and not self._data and not self._last_event_id and self._retry is None:
|
||||
return None
|
||||
|
||||
sse = ServerSentEvent(
|
||||
event=self._event,
|
||||
data="\n".join(self._data),
|
||||
id=self._last_event_id,
|
||||
retry=self._retry,
|
||||
)
|
||||
|
||||
# NOTE: as per the SSE spec, do not reset last_event_id.
|
||||
self._event = ""
|
||||
self._data = []
|
||||
self._retry = None
|
||||
|
||||
return sse
|
||||
|
||||
if line.startswith(":"):
|
||||
return None
|
||||
|
||||
fieldname, _, value = line.partition(":")
|
||||
|
||||
if value.startswith(" "):
|
||||
value = value[1:]
|
||||
|
||||
if fieldname == "event":
|
||||
self._event = value
|
||||
elif fieldname == "data":
|
||||
self._data.append(value)
|
||||
elif fieldname == "id":
|
||||
if "\0" in value:
|
||||
pass
|
||||
else:
|
||||
self._last_event_id = value
|
||||
elif fieldname == "retry":
|
||||
try:
|
||||
self._retry = int(value)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
else:
|
||||
pass # Field is ignored.
|
||||
|
||||
return None
|
||||
7
skyvern/client/core/http_sse/_exceptions.py
Normal file
7
skyvern/client/core/http_sse/_exceptions.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import httpx
|
||||
|
||||
|
||||
class SSEError(httpx.TransportError):
|
||||
pass
|
||||
17
skyvern/client/core/http_sse/_models.py
Normal file
17
skyvern/client/core/http_sse/_models.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Optional
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ServerSentEvent:
|
||||
event: str = "message"
|
||||
data: str = ""
|
||||
id: str = ""
|
||||
retry: Optional[int] = None
|
||||
|
||||
def json(self) -> Any:
|
||||
"""Parse the data field as JSON."""
|
||||
return json.loads(self.data)
|
||||
|
|
@ -17,7 +17,6 @@ from types import GeneratorType
|
|||
from typing import Any, Callable, Dict, List, Optional, Set, Union
|
||||
|
||||
import pydantic
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .pydantic_utilities import (
|
||||
IS_PYDANTIC_V2,
|
||||
|
|
|
|||
|
|
@ -2,90 +2,66 @@
|
|||
|
||||
# nopycln: file
|
||||
import datetime as dt
|
||||
import typing
|
||||
from collections import defaultdict
|
||||
|
||||
import typing_extensions
|
||||
from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast
|
||||
|
||||
import pydantic
|
||||
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .serialization import convert_and_respect_annotation_metadata
|
||||
|
||||
IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
# isort will try to reformat the comments on these imports, which breaks mypy
|
||||
# isort: off
|
||||
from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
parse_date as parse_date,
|
||||
)
|
||||
from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
parse_datetime as parse_datetime,
|
||||
)
|
||||
from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
ENCODERS_BY_TYPE as encoders_by_type,
|
||||
)
|
||||
from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
get_args as get_args,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
get_origin as get_origin,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
is_literal_type as is_literal_type,
|
||||
)
|
||||
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
is_union as is_union,
|
||||
)
|
||||
from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
||||
from pydantic.v1.datetime_parse import parse_date as parse_date
|
||||
from pydantic.v1.datetime_parse import parse_datetime as parse_datetime
|
||||
from pydantic.v1.fields import ModelField as ModelField
|
||||
from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined]
|
||||
from pydantic.v1.typing import get_args as get_args
|
||||
from pydantic.v1.typing import get_origin as get_origin
|
||||
from pydantic.v1.typing import is_literal_type as is_literal_type
|
||||
from pydantic.v1.typing import is_union as is_union
|
||||
else:
|
||||
from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1
|
||||
from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1
|
||||
from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1
|
||||
from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1
|
||||
from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1
|
||||
from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1
|
||||
from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1
|
||||
from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1
|
||||
from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef]
|
||||
from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef]
|
||||
from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef]
|
||||
from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef]
|
||||
from pydantic.typing import get_args as get_args # type: ignore[no-redef]
|
||||
from pydantic.typing import get_origin as get_origin # type: ignore[no-redef]
|
||||
from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef]
|
||||
from pydantic.typing import is_union as is_union # type: ignore[no-redef]
|
||||
|
||||
# isort: on
|
||||
from .datetime_utils import serialize_datetime
|
||||
from .serialization import convert_and_respect_annotation_metadata
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
T = TypeVar("T")
|
||||
Model = TypeVar("Model", bound=pydantic.BaseModel)
|
||||
|
||||
|
||||
T = typing.TypeVar("T")
|
||||
Model = typing.TypeVar("Model", bound=pydantic.BaseModel)
|
||||
|
||||
|
||||
def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T:
|
||||
def parse_obj_as(type_: Type[T], object_: Any) -> T:
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read")
|
||||
if IS_PYDANTIC_V2:
|
||||
adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2
|
||||
adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined]
|
||||
return adapter.validate_python(dealiased_object)
|
||||
else:
|
||||
return pydantic.parse_obj_as(type_, dealiased_object)
|
||||
return pydantic.parse_obj_as(type_, dealiased_object)
|
||||
|
||||
|
||||
def to_jsonable_with_fallback(
|
||||
obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any]
|
||||
) -> typing.Any:
|
||||
def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any:
|
||||
if IS_PYDANTIC_V2:
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
return to_jsonable_python(obj, fallback=fallback_serializer)
|
||||
else:
|
||||
return fallback_serializer(obj)
|
||||
return fallback_serializer(obj)
|
||||
|
||||
|
||||
class UniversalBaseModel(pydantic.BaseModel):
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
||||
model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key]
|
||||
# Allow fields beginning with `model_` to be used in the model
|
||||
protected_namespaces=(),
|
||||
) # type: ignore # Pydantic v2
|
||||
)
|
||||
|
||||
@pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2
|
||||
def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2
|
||||
serialized = handler(self)
|
||||
@pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined]
|
||||
def serialize_model(self) -> Any: # type: ignore[name-defined]
|
||||
serialized = self.dict() # type: ignore[attr-defined]
|
||||
data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()}
|
||||
return data
|
||||
|
||||
|
|
@ -96,34 +72,28 @@ class UniversalBaseModel(pydantic.BaseModel):
|
|||
json_encoders = {dt.datetime: serialize_datetime}
|
||||
|
||||
@classmethod
|
||||
def model_construct(
|
||||
cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
|
||||
) -> "Model":
|
||||
def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model":
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
|
||||
return cls.construct(_fields_set, **dealiased_object)
|
||||
|
||||
@classmethod
|
||||
def construct(
|
||||
cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
|
||||
) -> "Model":
|
||||
def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model":
|
||||
dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
|
||||
if IS_PYDANTIC_V2:
|
||||
return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return super().construct(_fields_set, **dealiased_object)
|
||||
return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc]
|
||||
return super().construct(_fields_set, **dealiased_object)
|
||||
|
||||
def json(self, **kwargs: typing.Any) -> str:
|
||||
kwargs_with_defaults: typing.Any = {
|
||||
def json(self, **kwargs: Any) -> str:
|
||||
kwargs_with_defaults = {
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
**kwargs,
|
||||
}
|
||||
if IS_PYDANTIC_V2:
|
||||
return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return super().json(**kwargs_with_defaults)
|
||||
return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc]
|
||||
return super().json(**kwargs_with_defaults)
|
||||
|
||||
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
||||
def dict(self, **kwargs: Any) -> Dict[str, Any]:
|
||||
"""
|
||||
Override the default dict method to `exclude_unset` by default. This function patches
|
||||
`exclude_unset` to work include fields within non-None default values.
|
||||
|
|
@ -134,21 +104,21 @@ class UniversalBaseModel(pydantic.BaseModel):
|
|||
# We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
|
||||
# that we have less control over, and this is less intrusive than custom serializers for now.
|
||||
if IS_PYDANTIC_V2:
|
||||
kwargs_with_defaults_exclude_unset: typing.Any = {
|
||||
kwargs_with_defaults_exclude_unset = {
|
||||
**kwargs,
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
"exclude_none": False,
|
||||
}
|
||||
kwargs_with_defaults_exclude_none: typing.Any = {
|
||||
kwargs_with_defaults_exclude_none = {
|
||||
**kwargs,
|
||||
"by_alias": True,
|
||||
"exclude_none": True,
|
||||
"exclude_unset": False,
|
||||
}
|
||||
dict_dump = deep_union_pydantic_dicts(
|
||||
super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2
|
||||
super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2
|
||||
super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc]
|
||||
super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc]
|
||||
)
|
||||
|
||||
else:
|
||||
|
|
@ -168,7 +138,7 @@ class UniversalBaseModel(pydantic.BaseModel):
|
|||
if default is not None:
|
||||
self.__fields_set__.add(name)
|
||||
|
||||
kwargs_with_defaults_exclude_unset_include_fields: typing.Any = {
|
||||
kwargs_with_defaults_exclude_unset_include_fields = {
|
||||
"by_alias": True,
|
||||
"exclude_unset": True,
|
||||
"include": _fields_set,
|
||||
|
|
@ -177,15 +147,16 @@ class UniversalBaseModel(pydantic.BaseModel):
|
|||
|
||||
dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields)
|
||||
|
||||
return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write")
|
||||
return cast(
|
||||
Dict[str, Any],
|
||||
convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"),
|
||||
)
|
||||
|
||||
|
||||
def _union_list_of_pydantic_dicts(
|
||||
source: typing.List[typing.Any], destination: typing.List[typing.Any]
|
||||
) -> typing.List[typing.Any]:
|
||||
converted_list: typing.List[typing.Any] = []
|
||||
def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]:
|
||||
converted_list: List[Any] = []
|
||||
for i, item in enumerate(source):
|
||||
destination_value = destination[i] # type: ignore
|
||||
destination_value = destination[i]
|
||||
if isinstance(item, dict):
|
||||
converted_list.append(deep_union_pydantic_dicts(item, destination_value))
|
||||
elif isinstance(item, list):
|
||||
|
|
@ -195,9 +166,7 @@ def _union_list_of_pydantic_dicts(
|
|||
return converted_list
|
||||
|
||||
|
||||
def deep_union_pydantic_dicts(
|
||||
source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any]
|
||||
) -> typing.Dict[str, typing.Any]:
|
||||
def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]:
|
||||
for key, value in source.items():
|
||||
node = destination.setdefault(key, {})
|
||||
if isinstance(value, dict):
|
||||
|
|
@ -215,18 +184,16 @@ def deep_union_pydantic_dicts(
|
|||
|
||||
if IS_PYDANTIC_V2:
|
||||
|
||||
class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2
|
||||
class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg]
|
||||
pass
|
||||
|
||||
UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore
|
||||
UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc]
|
||||
else:
|
||||
UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore
|
||||
UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef]
|
||||
|
||||
|
||||
def encode_by_type(o: typing.Any) -> typing.Any:
|
||||
encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = (
|
||||
defaultdict(tuple)
|
||||
)
|
||||
def encode_by_type(o: Any) -> Any:
|
||||
encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple)
|
||||
for type_, encoder in encoders_by_type.items():
|
||||
encoders_by_class_tuples[encoder] += (type_,)
|
||||
|
||||
|
|
@ -237,54 +204,49 @@ def encode_by_type(o: typing.Any) -> typing.Any:
|
|||
return encoder(o)
|
||||
|
||||
|
||||
def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
|
||||
def update_forward_refs(model: Type["Model"], **localns: Any) -> None:
|
||||
if IS_PYDANTIC_V2:
|
||||
model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2
|
||||
model.model_rebuild(raise_errors=False) # type: ignore[attr-defined]
|
||||
else:
|
||||
model.update_forward_refs(**localns)
|
||||
|
||||
|
||||
# Mirrors Pydantic's internal typing
|
||||
AnyCallable = typing.Callable[..., typing.Any]
|
||||
AnyCallable = Callable[..., Any]
|
||||
|
||||
|
||||
def universal_root_validator(
|
||||
pre: bool = False,
|
||||
) -> typing.Callable[[AnyCallable], AnyCallable]:
|
||||
) -> Callable[[AnyCallable], AnyCallable]:
|
||||
def decorator(func: AnyCallable) -> AnyCallable:
|
||||
if IS_PYDANTIC_V2:
|
||||
return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1
|
||||
return cast(AnyCallable, pydantic.model_validator(mode="before" if pre else "after")(func)) # type: ignore[attr-defined]
|
||||
return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload]
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]:
|
||||
def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]:
|
||||
def decorator(func: AnyCallable) -> AnyCallable:
|
||||
if IS_PYDANTIC_V2:
|
||||
return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
|
||||
else:
|
||||
return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1
|
||||
return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined]
|
||||
return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func))
|
||||
|
||||
return decorator
|
||||
|
||||
|
||||
PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo]
|
||||
PydanticField = Union[ModelField, pydantic.fields.FieldInfo]
|
||||
|
||||
|
||||
def _get_model_fields(
|
||||
model: typing.Type["Model"],
|
||||
) -> typing.Mapping[str, PydanticField]:
|
||||
def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]:
|
||||
if IS_PYDANTIC_V2:
|
||||
return model.model_fields # type: ignore # Pydantic v2
|
||||
else:
|
||||
return model.__fields__ # type: ignore # Pydantic v1
|
||||
return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined]
|
||||
return cast(Mapping[str, PydanticField], model.__fields__)
|
||||
|
||||
|
||||
def _get_field_default(field: PydanticField) -> typing.Any:
|
||||
def _get_field_default(field: PydanticField) -> Any:
|
||||
try:
|
||||
value = field.get_default() # type: ignore # Pydantic < v1.10.15
|
||||
value = field.get_default() # type: ignore[union-attr]
|
||||
except:
|
||||
value = field.default
|
||||
if IS_PYDANTIC_V2:
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@ import collections
|
|||
import inspect
|
||||
import typing
|
||||
|
||||
import typing_extensions
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
|
||||
|
||||
class FieldMetadata:
|
||||
|
|
@ -161,7 +160,12 @@ def _convert_mapping(
|
|||
direction: typing.Literal["read", "write"],
|
||||
) -> typing.Mapping[str, object]:
|
||||
converted_object: typing.Dict[str, object] = {}
|
||||
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
||||
try:
|
||||
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
||||
except NameError:
|
||||
# The TypedDict contains a circular reference, so
|
||||
# we use the __annotations__ attribute directly.
|
||||
annotations = getattr(expected_type, "__annotations__", {})
|
||||
aliases_to_field_names = _get_alias_to_field_name(annotations)
|
||||
for key, value in object_.items():
|
||||
if direction == "read" and key in aliases_to_field_names:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,42 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from .bad_request_error import BadRequestError
|
||||
from .forbidden_error import ForbiddenError
|
||||
from .not_found_error import NotFoundError
|
||||
from .unprocessable_entity_error import UnprocessableEntityError
|
||||
# isort: skip_file
|
||||
|
||||
import typing
|
||||
from importlib import import_module
|
||||
|
||||
if typing.TYPE_CHECKING:
|
||||
from .bad_request_error import BadRequestError
|
||||
from .forbidden_error import ForbiddenError
|
||||
from .not_found_error import NotFoundError
|
||||
from .unprocessable_entity_error import UnprocessableEntityError
|
||||
_dynamic_imports: typing.Dict[str, str] = {
|
||||
"BadRequestError": ".bad_request_error",
|
||||
"ForbiddenError": ".forbidden_error",
|
||||
"NotFoundError": ".not_found_error",
|
||||
"UnprocessableEntityError": ".unprocessable_entity_error",
|
||||
}
|
||||
|
||||
|
||||
def __getattr__(attr_name: str) -> typing.Any:
|
||||
module_name = _dynamic_imports.get(attr_name)
|
||||
if module_name is None:
|
||||
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
||||
try:
|
||||
module = import_module(module_name, __package__)
|
||||
if module_name == f".{attr_name}":
|
||||
return module
|
||||
else:
|
||||
return getattr(module, attr_name)
|
||||
except ImportError as e:
|
||||
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
||||
except AttributeError as e:
|
||||
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
||||
|
||||
|
||||
def __dir__():
|
||||
lazy_attrs = list(_dynamic_imports.keys())
|
||||
return sorted(lazy_attrs)
|
||||
|
||||
|
||||
__all__ = ["BadRequestError", "ForbiddenError", "NotFoundError", "UnprocessableEntityError"]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
import typing
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
|
||||
|
||||
class BadRequestError(ApiError):
|
||||
def __init__(self, body: typing.Optional[typing.Any]):
|
||||
super().__init__(status_code=400, body=body)
|
||||
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
||||
super().__init__(status_code=400, headers=headers, body=body)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
import typing
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
|
||||
|
||||
class ForbiddenError(ApiError):
|
||||
def __init__(self, body: typing.Optional[typing.Any]):
|
||||
super().__init__(status_code=403, body=body)
|
||||
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
||||
super().__init__(status_code=403, headers=headers, body=body)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
import typing
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
|
||||
|
||||
class NotFoundError(ApiError):
|
||||
def __init__(self, body: typing.Optional[typing.Any]):
|
||||
super().__init__(status_code=404, body=body)
|
||||
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
||||
super().__init__(status_code=404, headers=headers, body=body)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
import typing
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
|
||||
|
||||
class UnprocessableEntityError(ApiError):
|
||||
def __init__(self, body: typing.Optional[typing.Any]):
|
||||
super().__init__(status_code=422, body=body)
|
||||
def __init__(self, body: typing.Optional[typing.Any], headers: typing.Optional[typing.Dict[str, str]] = None):
|
||||
super().__init__(status_code=422, headers=headers, body=body)
|
||||
|
|
|
|||
4066
skyvern/client/raw_client.py
Normal file
4066
skyvern/client/raw_client.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +1,4 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
# isort: skip_file
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,26 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.client_wrapper import SyncClientWrapper
|
||||
import typing
|
||||
|
||||
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
||||
from ..core.request_options import RequestOptions
|
||||
from ..core.jsonable_encoder import jsonable_encoder
|
||||
from ..core.pydantic_utilities import parse_obj_as
|
||||
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
||||
from json.decoder import JSONDecodeError
|
||||
from ..core.api_error import ApiError
|
||||
from ..core.client_wrapper import AsyncClientWrapper
|
||||
from .raw_client import AsyncRawScriptsClient, RawScriptsClient
|
||||
|
||||
|
||||
class ScriptsClient:
|
||||
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
self._raw_client = RawScriptsClient(client_wrapper=client_wrapper)
|
||||
|
||||
@property
|
||||
def with_raw_response(self) -> RawScriptsClient:
|
||||
"""
|
||||
Retrieves a raw implementation of this client that returns raw responses.
|
||||
|
||||
Returns
|
||||
-------
|
||||
RawScriptsClient
|
||||
"""
|
||||
return self._raw_client
|
||||
|
||||
def run_script(
|
||||
self, script_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
|
|
@ -40,45 +47,29 @@ class ScriptsClient:
|
|||
|
||||
client = Skyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
x_api_key="YOUR_X_API_KEY",
|
||||
)
|
||||
client.scripts.run_script(
|
||||
script_id="s_abc123",
|
||||
)
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/scripts/{jsonable_encoder(script_id)}/run",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return 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(
|
||||
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)
|
||||
_response = self._raw_client.run_script(script_id, request_options=request_options)
|
||||
return _response.data
|
||||
|
||||
|
||||
class AsyncScriptsClient:
|
||||
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
self._raw_client = AsyncRawScriptsClient(client_wrapper=client_wrapper)
|
||||
|
||||
@property
|
||||
def with_raw_response(self) -> AsyncRawScriptsClient:
|
||||
"""
|
||||
Retrieves a raw implementation of this client that returns raw responses.
|
||||
|
||||
Returns
|
||||
-------
|
||||
AsyncRawScriptsClient
|
||||
"""
|
||||
return self._raw_client
|
||||
|
||||
async def run_script(
|
||||
self, script_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
|
|
@ -107,7 +98,6 @@ class AsyncScriptsClient:
|
|||
|
||||
client = AsyncSkyvern(
|
||||
api_key="YOUR_API_KEY",
|
||||
x_api_key="YOUR_X_API_KEY",
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -119,31 +109,5 @@ class AsyncScriptsClient:
|
|||
|
||||
asyncio.run(main())
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/scripts/{jsonable_encoder(script_id)}/run",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if 200 <= _response.status_code < 300:
|
||||
return 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(
|
||||
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)
|
||||
_response = await self._raw_client.run_script(script_id, request_options=request_options)
|
||||
return _response.data
|
||||
|
|
|
|||
126
skyvern/client/scripts/raw_client.py
Normal file
126
skyvern/client/scripts/raw_client.py
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
from json.decoder import JSONDecodeError
|
||||
|
||||
from ..core.api_error import ApiError
|
||||
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
||||
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
||||
from ..core.jsonable_encoder import jsonable_encoder
|
||||
from ..core.pydantic_utilities import parse_obj_as
|
||||
from ..core.request_options import RequestOptions
|
||||
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
||||
|
||||
|
||||
class RawScriptsClient:
|
||||
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
|
||||
def run_script(
|
||||
self, script_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> HttpResponse[typing.Optional[typing.Any]]:
|
||||
"""
|
||||
Run a script
|
||||
|
||||
Parameters
|
||||
----------
|
||||
script_id : str
|
||||
The unique identifier of the script
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
HttpResponse[typing.Optional[typing.Any]]
|
||||
Successful Response
|
||||
"""
|
||||
_response = self._client_wrapper.httpx_client.request(
|
||||
f"v1/scripts/{jsonable_encoder(script_id)}/run",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if _response is None or not _response.text.strip():
|
||||
return HttpResponse(response=_response, data=None)
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return HttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
),
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
|
||||
|
||||
class AsyncRawScriptsClient:
|
||||
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
||||
self._client_wrapper = client_wrapper
|
||||
|
||||
async def run_script(
|
||||
self, script_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
||||
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
||||
"""
|
||||
Run a script
|
||||
|
||||
Parameters
|
||||
----------
|
||||
script_id : str
|
||||
The unique identifier of the script
|
||||
|
||||
request_options : typing.Optional[RequestOptions]
|
||||
Request-specific configuration.
|
||||
|
||||
Returns
|
||||
-------
|
||||
AsyncHttpResponse[typing.Optional[typing.Any]]
|
||||
Successful Response
|
||||
"""
|
||||
_response = await self._client_wrapper.httpx_client.request(
|
||||
f"v1/scripts/{jsonable_encoder(script_id)}/run",
|
||||
method="POST",
|
||||
request_options=request_options,
|
||||
)
|
||||
try:
|
||||
if _response is None or not _response.text.strip():
|
||||
return AsyncHttpResponse(response=_response, data=None)
|
||||
if 200 <= _response.status_code < 300:
|
||||
_data = typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
)
|
||||
return AsyncHttpResponse(response=_response, data=_data)
|
||||
if _response.status_code == 422:
|
||||
raise UnprocessableEntityError(
|
||||
headers=dict(_response.headers),
|
||||
body=typing.cast(
|
||||
typing.Optional[typing.Any],
|
||||
parse_obj_as(
|
||||
type_=typing.Optional[typing.Any], # type: ignore
|
||||
object_=_response.json(),
|
||||
),
|
||||
),
|
||||
)
|
||||
_response_json = _response.json()
|
||||
except JSONDecodeError:
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
||||
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .action_type import ActionType
|
||||
import datetime as dt
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .action_status import ActionStatus
|
||||
from .user_defined_error import UserDefinedError
|
||||
from .action_type import ActionType
|
||||
from .input_or_select_context import InputOrSelectContext
|
||||
from .select_option import SelectOption
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .user_defined_error import UserDefinedError
|
||||
|
||||
|
||||
class Action(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .action_block_data_schema import ActionBlockDataSchema
|
||||
from .action_block_parameters_item import ActionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class ActionBlock(UniversalBaseModel):
|
||||
|
|
@ -47,3 +48,8 @@ class ActionBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(ActionBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class ActionBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class ActionBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ActionBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class ActionBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ ActionType = typing.Union[
|
|||
"terminate",
|
||||
"complete",
|
||||
"reload_page",
|
||||
"close_page",
|
||||
"extract",
|
||||
"verification_code",
|
||||
"goto_url",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
from .artifact_type import ArtifactType
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .artifact_type import ArtifactType
|
||||
|
||||
|
||||
class Artifact(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class AwsSecretParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class AwsSecretParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class AzureSecretParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class AzureVaultCredentialParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class AzureVaultCredentialParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenCreditCardDataParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenCreditCardDataParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenLoginCredentialParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenLoginCredentialParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenSensitiveInformationParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class BitwardenSensitiveInformationParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ BlockType = typing.Union[
|
|||
"goto_url",
|
||||
"pdf_parser",
|
||||
"http_request",
|
||||
"human_interaction",
|
||||
],
|
||||
typing.Any,
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
import typing
|
||||
from .file_info import FileInfo
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .file_info import FileInfo
|
||||
|
||||
|
||||
class BrowserSessionResponse(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .code_block_parameters_item import CodeBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .code_block_parameters_item import CodeBlockParametersItem
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class CodeBlock(UniversalBaseModel):
|
||||
|
|
@ -26,3 +27,8 @@ class CodeBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(CodeBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class CodeBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class CodeBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class CodeBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class CodeBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
|
||||
import typing
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
|
||||
|
||||
class ContextParameter(UniversalBaseModel):
|
||||
|
|
@ -25,6 +25,6 @@ class ContextParameter(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(ContextParameter)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class ContextParameterSource_Workflow(UniversalBaseModel):
|
||||
|
|
@ -51,7 +51,7 @@ class ContextParameterSource_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ContextParameterSource_AwsSecret(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class ContextParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
from .non_empty_password_credential import NonEmptyPasswordCredential
|
||||
|
||||
from .non_empty_credit_card_credential import NonEmptyCreditCardCredential
|
||||
from .non_empty_password_credential import NonEmptyPasswordCredential
|
||||
|
||||
CreateCredentialRequestCredential = typing.Union[NonEmptyPasswordCredential, NonEmptyCreditCardCredential]
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
import typing
|
||||
from .file_node import FileNode
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
|
||||
|
||||
class CreateScriptResponse(UniversalBaseModel):
|
||||
|
|
@ -29,7 +30,7 @@ class CreateScriptResponse(UniversalBaseModel):
|
|||
Total number of files in the script
|
||||
"""
|
||||
|
||||
file_tree: typing.Dict[str, FileNode] = pydantic.Field()
|
||||
file_tree: typing.Dict[str, "FileNode"] = pydantic.Field()
|
||||
"""
|
||||
Hierarchical file tree structure
|
||||
"""
|
||||
|
|
@ -47,3 +48,8 @@ class CreateScriptResponse(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .file_node import FileNode # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(CreateScriptResponse)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class CredentialParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class CredentialParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .credential_response_credential import CredentialResponseCredential
|
||||
from .credential_type_output import CredentialTypeOutput
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
|
||||
class CredentialResponse(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
from .password_credential_response import PasswordCredentialResponse
|
||||
|
||||
from .credit_card_credential_response import CreditCardCredentialResponse
|
||||
from .password_credential_response import PasswordCredentialResponse
|
||||
|
||||
CredentialResponseCredential = typing.Union[PasswordCredentialResponse, CreditCardCredentialResponse]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class CreditCardCredentialResponse(UniversalBaseModel):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class DownloadToS3Block(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class DownloadToS3BlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import ExtractionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class ExtractionBlock(UniversalBaseModel):
|
||||
|
|
@ -47,3 +48,8 @@ class ExtractionBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(ExtractionBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class ExtractionBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ExtractionBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
from .extraction_block_yaml_data_schema import ExtractionBlockYamlDataSchema
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .extraction_block_yaml_data_schema import ExtractionBlockYamlDataSchema
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class ExtractionBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .file_download_block_data_schema import FileDownloadBlockDataSchema
|
||||
from .file_download_block_parameters_item import FileDownloadBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class FileDownloadBlock(UniversalBaseModel):
|
||||
|
|
@ -47,3 +48,8 @@ class FileDownloadBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(FileDownloadBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class FileDownloadBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class FileDownloadBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class FileDownloadBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# 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
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class FileInfo(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
|
||||
|
||||
class FileNode(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .file_type import FileType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .file_type import FileType
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class FileParserBlock(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .file_type import FileType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .file_type import FileType
|
||||
|
||||
|
||||
class FileParserBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .output_parameter import OutputParameter
|
||||
import typing
|
||||
from .file_storage_type import FileStorageType
|
||||
import typing_extensions
|
||||
from ..core.serialization import FieldMetadata
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .file_storage_type import FileStorageType
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class FileUploadBlock(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .file_storage_type import FileStorageType
|
||||
import typing_extensions
|
||||
from ..core.serialization import FieldMetadata
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .file_storage_type import FileStorageType
|
||||
|
||||
|
||||
class FileUploadBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
import typing
|
||||
from .for_loop_block_loop_over import ForLoopBlockLoopOver
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .for_loop_block_loop_over import ForLoopBlockLoopOver
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class ForLoopBlock(UniversalBaseModel):
|
||||
|
|
@ -32,6 +31,7 @@ class ForLoopBlock(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block_loop_blocks_item import ForLoopBlockLoopBlocksItem # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .for_loop_block_loop_blocks_item import ForLoopBlockLoopBlocksItem # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(ForLoopBlock)
|
||||
|
|
|
|||
|
|
@ -1,40 +1,41 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
|
||||
import typing
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .action_block_data_schema import ActionBlockDataSchema
|
||||
from .action_block_parameters_item import ActionBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .aws_secret_parameter import AwsSecretParameter
|
||||
from .code_block_parameters_item import CodeBlockParametersItem
|
||||
from .extraction_block_data_schema import ExtractionBlockDataSchema
|
||||
from .extraction_block_parameters_item import ExtractionBlockParametersItem
|
||||
from .file_download_block_data_schema import FileDownloadBlockDataSchema
|
||||
from .file_download_block_parameters_item import FileDownloadBlockParametersItem
|
||||
from .file_storage_type import FileStorageType
|
||||
import typing_extensions
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .file_type import FileType
|
||||
from .for_loop_block_loop_over import ForLoopBlockLoopOver
|
||||
from .url_block_data_schema import UrlBlockDataSchema
|
||||
from .url_block_parameters_item import UrlBlockParametersItem
|
||||
from .http_request_block_parameters_item import HttpRequestBlockParametersItem
|
||||
from .human_interaction_block_data_schema import HumanInteractionBlockDataSchema
|
||||
from .human_interaction_block_parameters_item import HumanInteractionBlockParametersItem
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import LoginBlockParametersItem
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import NavigationBlockParametersItem
|
||||
from .aws_secret_parameter import AwsSecretParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
from .task_block_data_schema import TaskBlockDataSchema
|
||||
from .task_block_parameters_item import TaskBlockParametersItem
|
||||
from .text_prompt_block_parameters_item import TextPromptBlockParametersItem
|
||||
from .url_block_data_schema import UrlBlockDataSchema
|
||||
from .url_block_parameters_item import UrlBlockParametersItem
|
||||
from .validation_block_data_schema import ValidationBlockDataSchema
|
||||
from .validation_block_parameters_item import ValidationBlockParametersItem
|
||||
from .wait_block_parameters_item import WaitBlockParametersItem
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Action(UniversalBaseModel):
|
||||
|
|
@ -263,7 +264,7 @@ class ForLoopBlockLoopBlocksItem_ForLoop(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block import ForLoopBlock # noqa: E402
|
||||
from .for_loop_block import ForLoopBlock # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_GotoUrl(UniversalBaseModel):
|
||||
|
|
@ -330,6 +331,53 @@ class ForLoopBlockLoopBlocksItem_HttpRequest(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_HumanInteraction(UniversalBaseModel):
|
||||
block_type: typing.Literal["human_interaction"] = "human_interaction"
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
model: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
disable_cache: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
engine: typing.Optional[RunEngine] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[HumanInteractionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[HumanInteractionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
complete_verification: typing.Optional[bool] = None
|
||||
include_action_history_in_verification: typing.Optional[bool] = None
|
||||
download_timeout: typing.Optional[float] = None
|
||||
instructions: typing.Optional[str] = None
|
||||
positive_descriptor: typing.Optional[str] = None
|
||||
negative_descriptor: typing.Optional[str] = None
|
||||
timeout_seconds: typing.Optional[int] = None
|
||||
sender: typing.Optional[str] = None
|
||||
recipients: typing.Optional[typing.List[str]] = None
|
||||
subject: typing.Optional[str] = None
|
||||
body: typing.Optional[str] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockLoopBlocksItem_Login(UniversalBaseModel):
|
||||
block_type: typing.Literal["login"] = "login"
|
||||
label: str
|
||||
|
|
@ -618,6 +666,8 @@ class ForLoopBlockLoopBlocksItem_Wait(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
ForLoopBlockLoopBlocksItem = typing.Union[
|
||||
ForLoopBlockLoopBlocksItem_Action,
|
||||
ForLoopBlockLoopBlocksItem_Code,
|
||||
|
|
@ -629,6 +679,7 @@ ForLoopBlockLoopBlocksItem = typing.Union[
|
|||
ForLoopBlockLoopBlocksItem_ForLoop,
|
||||
ForLoopBlockLoopBlocksItem_GotoUrl,
|
||||
ForLoopBlockLoopBlocksItem_HttpRequest,
|
||||
ForLoopBlockLoopBlocksItem_HumanInteraction,
|
||||
ForLoopBlockLoopBlocksItem_Login,
|
||||
ForLoopBlockLoopBlocksItem_Navigation,
|
||||
ForLoopBlockLoopBlocksItem_PdfParser,
|
||||
|
|
@ -640,4 +691,17 @@ ForLoopBlockLoopBlocksItem = typing.Union[
|
|||
ForLoopBlockLoopBlocksItem_Validation,
|
||||
ForLoopBlockLoopBlocksItem_Wait,
|
||||
]
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Action)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Code)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Extraction)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_FileDownload)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_ForLoop)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_GotoUrl)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_HttpRequest)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_HumanInteraction)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Login)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Navigation)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Task)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_TextPrompt)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Validation)
|
||||
update_forward_refs(ForLoopBlockLoopBlocksItem_Wait)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class ForLoopBlockLoopOver_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ForLoopBlockLoopOver_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlockYaml(UniversalBaseModel):
|
||||
|
|
@ -27,6 +27,6 @@ class ForLoopBlockYaml(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block_yaml_loop_blocks_item import ForLoopBlockYamlLoopBlocksItem # noqa: E402
|
||||
from .for_loop_block_yaml_loop_blocks_item import ForLoopBlockYamlLoopBlocksItem # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(ForLoopBlockYaml)
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
import typing_extensions
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .extraction_block_yaml_data_schema import ExtractionBlockYamlDataSchema
|
||||
from .file_storage_type import FileStorageType
|
||||
from .file_type import FileType
|
||||
from .run_engine import RunEngine
|
||||
from .task_block_yaml_data_schema import TaskBlockYamlDataSchema
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .file_storage_type import FileStorageType
|
||||
import typing_extensions
|
||||
from ..core.serialization import FieldMetadata
|
||||
from .file_type import FileType
|
||||
from .extraction_block_yaml_data_schema import ExtractionBlockYamlDataSchema
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
|
||||
|
||||
class ForLoopBlockYamlLoopBlocksItem_Task(UniversalBaseModel):
|
||||
|
|
@ -71,7 +71,7 @@ class ForLoopBlockYamlLoopBlocksItem_ForLoop(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .for_loop_block_yaml import ForLoopBlockYaml # noqa: E402
|
||||
from .for_loop_block_yaml import ForLoopBlockYaml # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class ForLoopBlockYamlLoopBlocksItem_Code(UniversalBaseModel):
|
||||
|
|
@ -374,6 +374,30 @@ class ForLoopBlockYamlLoopBlocksItem_Wait(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class ForLoopBlockYamlLoopBlocksItem_HumanInteraction(UniversalBaseModel):
|
||||
block_type: typing.Literal["human_interaction"] = "human_interaction"
|
||||
label: str
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
model: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
instructions: typing.Optional[str] = None
|
||||
positive_descriptor: typing.Optional[str] = None
|
||||
negative_descriptor: typing.Optional[str] = None
|
||||
timeout_seconds: int
|
||||
sender: str
|
||||
recipients: typing.List[str]
|
||||
subject: str
|
||||
body: str
|
||||
|
||||
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 ForLoopBlockYamlLoopBlocksItem_FileDownload(UniversalBaseModel):
|
||||
block_type: typing.Literal["file_download"] = "file_download"
|
||||
label: str
|
||||
|
|
@ -501,6 +525,7 @@ ForLoopBlockYamlLoopBlocksItem = typing.Union[
|
|||
ForLoopBlockYamlLoopBlocksItem_Extraction,
|
||||
ForLoopBlockYamlLoopBlocksItem_Login,
|
||||
ForLoopBlockYamlLoopBlocksItem_Wait,
|
||||
ForLoopBlockYamlLoopBlocksItem_HumanInteraction,
|
||||
ForLoopBlockYamlLoopBlocksItem_FileDownload,
|
||||
ForLoopBlockYamlLoopBlocksItem_GotoUrl,
|
||||
ForLoopBlockYamlLoopBlocksItem_PdfParser,
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_status import RunStatus
|
||||
from .task_run_response_output import TaskRunResponseOutput
|
||||
from .file_info import FileInfo
|
||||
|
||||
import datetime as dt
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .file_info import FileInfo
|
||||
from .run_status import RunStatus
|
||||
from .script_run_response import ScriptRunResponse
|
||||
from .task_run_request import TaskRunRequest
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .workflow_run_response_output import WorkflowRunResponseOutput
|
||||
from .task_run_response_output import TaskRunResponseOutput
|
||||
from .workflow_run_request import WorkflowRunRequest
|
||||
from .workflow_run_response_output import WorkflowRunResponseOutput
|
||||
|
||||
|
||||
class GetRunResponse_TaskV1(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .http_request_block_parameters_item import HttpRequestBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .http_request_block_parameters_item import HttpRequestBlockParametersItem
|
||||
from .output_parameter import OutputParameter
|
||||
|
||||
|
||||
class HttpRequestBlock(UniversalBaseModel):
|
||||
|
|
@ -31,3 +32,8 @@ class HttpRequestBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(HttpRequestBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class HttpRequestBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class HttpRequestBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class HttpRequestBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class HttpRequestBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .validation_error import ValidationError
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .validation_error import ValidationError
|
||||
|
||||
|
||||
class HttpValidationError(UniversalBaseModel):
|
||||
|
|
|
|||
75
skyvern/client/types/human_interaction_block.py
Normal file
75
skyvern/client/types/human_interaction_block.py
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# 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, update_forward_refs
|
||||
from .human_interaction_block_data_schema import HumanInteractionBlockDataSchema
|
||||
from .human_interaction_block_parameters_item import HumanInteractionBlockParametersItem
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class HumanInteractionBlock(UniversalBaseModel):
|
||||
"""
|
||||
A block for human/agent interaction.
|
||||
|
||||
For the first pass at this, the implicit behaviour is that the user is given a single binary
|
||||
choice (a go//no-go).
|
||||
|
||||
If the human:
|
||||
- chooses positively, the workflow continues
|
||||
- chooses negatively, the workflow is terminated
|
||||
- does not respond within the timeout period, the workflow terminates
|
||||
"""
|
||||
|
||||
label: str
|
||||
output_parameter: OutputParameter
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
model: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
disable_cache: typing.Optional[bool] = None
|
||||
task_type: typing.Optional[str] = None
|
||||
url: typing.Optional[str] = None
|
||||
title: typing.Optional[str] = None
|
||||
engine: typing.Optional[RunEngine] = None
|
||||
complete_criterion: typing.Optional[str] = None
|
||||
terminate_criterion: typing.Optional[str] = None
|
||||
navigation_goal: typing.Optional[str] = None
|
||||
data_extraction_goal: typing.Optional[str] = None
|
||||
data_schema: typing.Optional[HumanInteractionBlockDataSchema] = None
|
||||
error_code_mapping: typing.Optional[typing.Dict[str, typing.Optional[str]]] = None
|
||||
max_retries: typing.Optional[int] = None
|
||||
max_steps_per_run: typing.Optional[int] = None
|
||||
parameters: typing.Optional[typing.List[HumanInteractionBlockParametersItem]] = None
|
||||
complete_on_download: typing.Optional[bool] = None
|
||||
download_suffix: typing.Optional[str] = None
|
||||
totp_verification_url: typing.Optional[str] = None
|
||||
totp_identifier: typing.Optional[str] = None
|
||||
cache_actions: typing.Optional[bool] = None
|
||||
complete_verification: typing.Optional[bool] = None
|
||||
include_action_history_in_verification: typing.Optional[bool] = None
|
||||
download_timeout: typing.Optional[float] = None
|
||||
instructions: typing.Optional[str] = None
|
||||
positive_descriptor: typing.Optional[str] = None
|
||||
negative_descriptor: typing.Optional[str] = None
|
||||
timeout_seconds: typing.Optional[int] = None
|
||||
sender: typing.Optional[str] = None
|
||||
recipients: typing.Optional[typing.List[str]] = None
|
||||
subject: typing.Optional[str] = None
|
||||
body: typing.Optional[str] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(HumanInteractionBlock)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
import typing
|
||||
|
||||
HumanInteractionBlockDataSchema = typing.Union[
|
||||
typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]], str
|
||||
]
|
||||
277
skyvern/client/types/human_interaction_block_parameters_item.py
Normal file
277
skyvern/client/types/human_interaction_block_parameters_item.py
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime as dt
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["aws_secret"] = "aws_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
aws_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
aws_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_AzureSecret(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["azure_secret"] = "azure_secret"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
azure_secret_parameter_id: str
|
||||
workflow_id: str
|
||||
azure_key: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_AzureVaultCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["azure_vault_credential"] = "azure_vault_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
azure_vault_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
vault_name: str
|
||||
username_key: str
|
||||
password_key: str
|
||||
totp_secret_key: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_BitwardenCreditCardData(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_credit_card_data"] = "bitwarden_credit_card_data"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_credit_card_data_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_BitwardenLoginCredential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_login_credential"] = "bitwarden_login_credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_login_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
url_parameter_key: typing.Optional[str] = None
|
||||
bitwarden_collection_id: typing.Optional[str] = None
|
||||
bitwarden_item_id: typing.Optional[str] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_BitwardenSensitiveInformation(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["bitwarden_sensitive_information"] = "bitwarden_sensitive_information"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
bitwarden_sensitive_information_parameter_id: str
|
||||
workflow_id: str
|
||||
bitwarden_client_id_aws_secret_key: str
|
||||
bitwarden_client_secret_aws_secret_key: str
|
||||
bitwarden_master_password_aws_secret_key: str
|
||||
bitwarden_collection_id: str
|
||||
bitwarden_identity_key: str
|
||||
bitwarden_identity_fields: typing.List[str]
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_Context(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["context"] = "context"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
source: "ContextParameterSource"
|
||||
value: typing.Optional[ContextParameterValue] = 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
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_Credential(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["credential"] = "credential"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
credential_parameter_id: str
|
||||
workflow_id: str
|
||||
credential_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_Onepassword(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["onepassword"] = "onepassword"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
onepassword_credential_parameter_id: str
|
||||
workflow_id: str
|
||||
vault_id: str
|
||||
item_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_Output(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["output"] = "output"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
output_parameter_id: str
|
||||
workflow_id: str
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
class HumanInteractionBlockParametersItem_Workflow(UniversalBaseModel):
|
||||
parameter_type: typing.Literal["workflow"] = "workflow"
|
||||
key: str
|
||||
description: typing.Optional[str] = None
|
||||
workflow_parameter_id: str
|
||||
workflow_parameter_type: WorkflowParameterType
|
||||
workflow_id: str
|
||||
default_value: typing.Optional[WorkflowParameterDefaultValue] = None
|
||||
created_at: dt.datetime
|
||||
modified_at: dt.datetime
|
||||
deleted_at: typing.Optional[dt.datetime] = None
|
||||
|
||||
if IS_PYDANTIC_V2:
|
||||
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
||||
else:
|
||||
|
||||
class Config:
|
||||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
HumanInteractionBlockParametersItem = typing.Union[
|
||||
HumanInteractionBlockParametersItem_AwsSecret,
|
||||
HumanInteractionBlockParametersItem_AzureSecret,
|
||||
HumanInteractionBlockParametersItem_AzureVaultCredential,
|
||||
HumanInteractionBlockParametersItem_BitwardenCreditCardData,
|
||||
HumanInteractionBlockParametersItem_BitwardenLoginCredential,
|
||||
HumanInteractionBlockParametersItem_BitwardenSensitiveInformation,
|
||||
HumanInteractionBlockParametersItem_Context,
|
||||
HumanInteractionBlockParametersItem_Credential,
|
||||
HumanInteractionBlockParametersItem_Onepassword,
|
||||
HumanInteractionBlockParametersItem_Output,
|
||||
HumanInteractionBlockParametersItem_Workflow,
|
||||
]
|
||||
update_forward_refs(HumanInteractionBlockParametersItem_Context)
|
||||
29
skyvern/client/types/human_interaction_block_yaml.py
Normal file
29
skyvern/client/types/human_interaction_block_yaml.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# 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 HumanInteractionBlockYaml(UniversalBaseModel):
|
||||
label: str
|
||||
continue_on_failure: typing.Optional[bool] = None
|
||||
model: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
||||
instructions: typing.Optional[str] = None
|
||||
positive_descriptor: typing.Optional[str] = None
|
||||
negative_descriptor: typing.Optional[str] = None
|
||||
timeout_seconds: int
|
||||
sender: str
|
||||
recipients: typing.List[str]
|
||||
subject: str
|
||||
body: str
|
||||
|
||||
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
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class InputOrSelectContext(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .login_block_data_schema import LoginBlockDataSchema
|
||||
from .login_block_parameters_item import LoginBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class LoginBlock(UniversalBaseModel):
|
||||
|
|
@ -47,3 +48,8 @@ class LoginBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(LoginBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class LoginBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class LoginBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class LoginBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class LoginBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
from .context_parameter import ContextParameter
|
||||
from .output_parameter import OutputParameter
|
||||
from __future__ import annotations
|
||||
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .navigation_block_data_schema import NavigationBlockDataSchema
|
||||
from .navigation_block_parameters_item import NavigationBlockParametersItem
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import pydantic
|
||||
from .output_parameter import OutputParameter
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class NavigationBlock(UniversalBaseModel):
|
||||
|
|
@ -47,3 +48,8 @@ class NavigationBlock(UniversalBaseModel):
|
|||
frozen = True
|
||||
smart_union = True
|
||||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
|
||||
update_forward_refs(NavigationBlock)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from __future__ import annotations
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
||||
from .context_parameter_value import ContextParameterValue
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
from .workflow_parameter_default_value import WorkflowParameterDefaultValue
|
||||
from ..core.pydantic_utilities import update_forward_refs
|
||||
from .workflow_parameter_type import WorkflowParameterType
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_AwsSecret(UniversalBaseModel):
|
||||
|
|
@ -172,8 +172,8 @@ class NavigationBlockParametersItem_Context(UniversalBaseModel):
|
|||
extra = pydantic.Extra.allow
|
||||
|
||||
|
||||
from .context_parameter import ContextParameter # noqa: E402
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402
|
||||
from .context_parameter import ContextParameter # noqa: E402, F401, I001
|
||||
from .context_parameter_source import ContextParameterSource # noqa: E402, F401, I001
|
||||
|
||||
|
||||
class NavigationBlockParametersItem_Credential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from .run_engine import RunEngine
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .run_engine import RunEngine
|
||||
|
||||
|
||||
class NavigationBlockYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class NonEmptyCreditCardCredential(UniversalBaseModel):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .totp_type import TotpType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class NonEmptyPasswordCredential(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class OnePasswordCredentialParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class OnePasswordCredentialParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
import datetime as dt
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class OutputParameter(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import typing
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
|
||||
|
||||
class OutputParameterYaml(UniversalBaseModel):
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file was auto-generated by Fern from our API Definition.
|
||||
|
||||
from ..core.pydantic_utilities import UniversalBaseModel
|
||||
import pydantic
|
||||
import typing
|
||||
|
||||
import pydantic
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
||||
from .totp_type import TotpType
|
||||
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
||||
|
||||
|
||||
class PasswordCredentialResponse(UniversalBaseModel):
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue