Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.4.9 - 2025-11-18

- Add delete_agent_run method

## Version 0.4.8 - 2025-11-17

- Add delete_validation method
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cradl"
version = "0.4.8"
version = "0.4.9"
description = "Python SDK for Cradl"
authors = [{ name = "Cradl", email = "[email protected]" }]
readme = "README.md"
Expand Down
21 changes: 18 additions & 3 deletions src/cradl/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2881,7 +2881,7 @@ def list_agents(self, *, max_results: Optional[int] = None, next_token: Optional
return self._make_request(requests.get, '/agents', params=params)

def create_agent_run(self, agent_id: str, *, variables: dict = None) -> Dict:
"""Get agent, calls the POST /agents/{agentId}/runs endpoint.
"""Create agent run, calls the POST /agents/{agentId}/runs endpoint.

:param agent_id: Id of the agent
:type agent_id: str
Expand All @@ -2905,7 +2905,7 @@ def list_agent_runs(
max_results: Optional[int] = None,
next_token: Optional[str] = None,
) -> Dict:
"""List agents available, calls the GET /agents/{agentId}/runs endpoint.
"""List agent runs available, calls the GET /agents/{agentId}/runs endpoint.

:param agent_id: Id of the agent
:type agent_id: str
Expand All @@ -2927,7 +2927,7 @@ def list_agent_runs(
return self._make_request(requests.get, f'/agents/{agent_id}/runs', params=params)

def get_agent_run(self, agent_id: str, run_id: str, *, get_variables: bool = False) -> Dict:
"""Get agent, calls the GET /agents/{agentId}/runs/{runId} endpoint.
"""Get agent run, calls the GET /agents/{agentId}/runs/{runId} endpoint.

:param agent_id: Id of the agent
:type agent_id: str
Expand All @@ -2948,6 +2948,21 @@ def get_agent_run(self, agent_id: str, run_id: str, *, get_variables: bool = Fal
).decode())
return agent_run

def delete_agent_run(self, agent_id: str, run_id: str) -> Dict:
"""Delete agent run, calls the DELETE /agents/{agentId}/runs/{runId} endpoint.

:param agent_id: Id of the agent
:type agent_id: str
:param run_id: Id of the run
:type run_id: str
:return: Agent response from REST API
:rtype: dict

:raises: :py:class:`~cradl.InvalidCredentialsException`, :py:class:`~cradl.TooManyRequestsException`,\
:py:class:`~cradl.LimitExceededException`, :py:class:`requests.exception.RequestException`
"""
return self._make_request(requests.delete, f'/agents/{agent_id}/runs/{run_id}')

def list_hooks(self, *, max_results: Optional[int] = None, next_token: Optional[str] = None) -> Dict:
"""List hooks available, calls the GET /hooks endpoint.

Expand Down
Loading