Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
only ignore skyvern/artifacts folder (#2449)
Shuchang Zheng7ab5617b98ce
diff --git a/.gitignore b/.gitignoreindex a88e841b2..c6a50e725 100644--- a/.gitignore+++ b/.gitignore@@ -160,7 +160,7 @@ ig_*# Skyvern ignoresvideos/-artifacts/+skyvern/artifacts/traces/*.pklhar/diff --git a/skyvern/client/artifacts/__init__.py b/skyvern/client/artifacts/__init__.pynew file mode 100644index 000000000..f3ea2659b--- /dev/null+++ b/skyvern/client/artifacts/__init__.py@@ -0,0 +1,2 @@+# This file was auto-generated by Fern from our API Definition.+diff --git a/skyvern/client/artifacts/client.py b/skyvern/client/artifacts/client.pynew file mode 100644index 000000000..1749accb8--- /dev/null+++ b/skyvern/client/artifacts/client.py@@ -0,0 +1,165 @@+# This file was auto-generated by Fern from our API Definition.++from ..core.client_wrapper import SyncClientWrapper+import typing+from ..core.request_options import RequestOptions+from ..types.artifact import Artifact+from ..core.jsonable_encoder import jsonable_encoder+from ..core.pydantic_utilities import parse_obj_as+from ..errors.not_found_error import NotFoundError+from ..errors.unprocessable_entity_error import UnprocessableEntityError+from json.decoder import JSONDecodeError+from ..core.api_error import ApiError+from ..core.client_wrapper import AsyncClientWrapper+++class ArtifactsClient:+ def __init__(self, *, client_wrapper: SyncClientWrapper):+ self._client_wrapper = client_wrapper++ def get_artifact(self, artifact_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Artifact:+ """+ Get an artifact++ Parameters+ ----------+ artifact_id : str++ request_options : typing.Optional[RequestOptions]+ Request-specific configuration.++ Returns+ -------+ Artifact+ Successfully retrieved artifact++ Examples+ --------+ from skyvern import Skyvern++ client = Skyvern(+ api_key="YOUR_API_KEY",+ )+ client.artifacts.get_artifact(+ artifact_id="artifact_id",+ )+ """+ _response = self._client_wrapper.httpx_client.request(+ f"v1/artifacts/{jsonable_encoder(artifact_id)}",+ method="GET",+ request_options=request_options,+ )+ try:+ if 200 <= _response.status_code < 300:+ return typing.cast(+ Artifact,+ parse_obj_as(+ type_=Artifact, # type: ignore+ object_=_response.json(),+ ),+ )+ if _response.status_code == 404:+ raise NotFoundError(+ 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)+++class AsyncArtifactsClient:+ def __init__(self, *, client_wrapper: AsyncClientWrapper):+ self._client_wrapper = client_wrapper++ async def get_artifact(+ self, artifact_id: str, *, request_options: typing.Optional[RequestOptions] = None+ ) -> Artifact:+ """+ Get an artifact++ Parameters+ ----------+ artifact_id : str++ request_options : typing.Optional[RequestOptions]+ Request-specific configuration.++ Returns+ -------+ Artifact+ Successfully retrieved artifact++ Examples+ --------+ import asyncio++ from skyvern import AsyncSkyvern++ client = AsyncSkyvern(+ api_key="YOUR_API_KEY",+ )+++ async def main() -> None:+ await client.artifacts.get_artifact(+ artifact_id="artifact_id",+ )+++ asyncio.run(main())+ """+ _response = await self._client_wrapper.httpx_client.request(+ f"v1/artifacts/{jsonable_encoder(artifact_id)}",+ method="GET",+ request_options=request_options,+ )+ try:+ if 200 <= _response.status_code < 300:+ return typing.cast(+ Artifact,+ parse_obj_as(+ type_=Artifact, # type: ignore+ object_=_response.json(),+ ),+ )+ if _response.status_code == 404:+ raise NotFoundError(+ 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)