doc update - add run tasks page (#2425)

This commit is contained in:
Shuchang Zheng
2025-05-24 23:46:31 -07:00
committed by GitHub
parent 601cd099f7
commit 6f83978937
27 changed files with 1168 additions and 48 deletions

View File

@@ -429,6 +429,65 @@ class AgentClient:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)
def retry_run_webhook(
self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.Optional[typing.Any]:
"""
Retry sending the webhook for a run
Parameters
----------
run_id : str
The id of the task run or the workflow run.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
from skyvern import Skyvern
client = Skyvern(
api_key="YOUR_API_KEY",
)
client.agent.retry_run_webhook(
run_id="tsk_123",
)
"""
_response = self._client_wrapper.httpx_client.request(
f"v1/runs/{jsonable_encoder(run_id)}/retry_webhook",
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)
class AsyncAgentClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -869,3 +928,70 @@ class AsyncAgentClient:
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)
async def retry_run_webhook(
self, run_id: str, *, request_options: typing.Optional[RequestOptions] = None
) -> typing.Optional[typing.Any]:
"""
Retry sending the webhook for a run
Parameters
----------
run_id : str
The id of the task run or the workflow run.
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
typing.Optional[typing.Any]
Successful Response
Examples
--------
import asyncio
from skyvern import AsyncSkyvern
client = AsyncSkyvern(
api_key="YOUR_API_KEY",
)
async def main() -> None:
await client.agent.retry_run_webhook(
run_id="tsk_123",
)
asyncio.run(main())
"""
_response = await self._client_wrapper.httpx_client.request(
f"v1/runs/{jsonable_encoder(run_id)}/retry_webhook",
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)