Skip to content

Commit 1d0e041

Browse files
feat(api): add task state update methods
1 parent deabba2 commit 1d0e041

26 files changed

Lines changed: 2431 additions & 193 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 35
1+
configured_endpoints: 45
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-5fa3cb3c867281c804913c7c3e6d2143b5606d4924d42119f4b2b246f33e3db3.yml
33
openapi_spec_hash: 8ec711692f3ed7cd34a7a3b9d3e33f7c
4-
config_hash: 32eb65911c08ac84d117cecdf2759869
4+
config_hash: d65d8b7a05f302e164ef9ba7fe72b277

api.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ from agentex.types import (
1515
AgentRpcRequest,
1616
AgentRpcResponse,
1717
AgentRpcResult,
18+
CancelTaskRequest,
19+
CreateTaskRequest,
1820
DataDelta,
1921
ReasoningContentDelta,
2022
ReasoningSummaryDelta,
23+
SendEventRequest,
24+
SendMessageRequest,
2125
TaskMessageContent,
2226
TaskMessageDelta,
2327
TaskMessageUpdate,
@@ -43,18 +47,32 @@ Methods:
4347
Types:
4448

4549
```python
46-
from agentex.types import Task, TaskRetrieveResponse, TaskListResponse, TaskRetrieveByNameResponse
50+
from agentex.types import (
51+
Task,
52+
TaskRetrieveResponse,
53+
TaskListResponse,
54+
TaskQueryWorkflowResponse,
55+
TaskRetrieveByNameResponse,
56+
)
4757
```
4858

4959
Methods:
5060

5161
- <code title="get /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">retrieve</a>(task_id, \*\*<a href="src/agentex/types/task_retrieve_params.py">params</a>) -> <a href="./src/agentex/types/task_retrieve_response.py">TaskRetrieveResponse</a></code>
5262
- <code title="get /tasks">client.tasks.<a href="./src/agentex/resources/tasks.py">list</a>(\*\*<a href="src/agentex/types/task_list_params.py">params</a>) -> <a href="./src/agentex/types/task_list_response.py">TaskListResponse</a></code>
5363
- <code title="delete /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete</a>(task_id) -> <a href="./src/agentex/types/shared/delete_response.py">DeleteResponse</a></code>
64+
- <code title="post /tasks/{task_id}/cancel">client.tasks.<a href="./src/agentex/resources/tasks.py">cancel</a>(task_id, \*\*<a href="src/agentex/types/task_cancel_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
65+
- <code title="post /tasks/{task_id}/complete">client.tasks.<a href="./src/agentex/resources/tasks.py">complete</a>(task_id, \*\*<a href="src/agentex/types/task_complete_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
5466
- <code title="delete /tasks/name/{task_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete_by_name</a>(task_name) -> <a href="./src/agentex/types/shared/delete_response.py">DeleteResponse</a></code>
67+
- <code title="post /tasks/{task_id}/fail">client.tasks.<a href="./src/agentex/resources/tasks.py">fail</a>(task_id, \*\*<a href="src/agentex/types/task_fail_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
68+
- <code title="get /tasks/{task_id}/query/{query_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">query_workflow</a>(query_name, \*, task_id) -> <a href="./src/agentex/types/task_query_workflow_response.py">TaskQueryWorkflowResponse</a></code>
5569
- <code title="get /tasks/name/{task_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">retrieve_by_name</a>(task_name, \*\*<a href="src/agentex/types/task_retrieve_by_name_params.py">params</a>) -> <a href="./src/agentex/types/task_retrieve_by_name_response.py">TaskRetrieveByNameResponse</a></code>
5670
- <code title="get /tasks/{task_id}/stream">client.tasks.<a href="./src/agentex/resources/tasks.py">stream_events</a>(task_id) -> object</code>
5771
- <code title="get /tasks/name/{task_name}/stream">client.tasks.<a href="./src/agentex/resources/tasks.py">stream_events_by_name</a>(task_name) -> object</code>
72+
- <code title="post /tasks/{task_id}/terminate">client.tasks.<a href="./src/agentex/resources/tasks.py">terminate</a>(task_id, \*\*<a href="src/agentex/types/task_terminate_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
73+
- <code title="post /tasks/{task_id}/timeout">client.tasks.<a href="./src/agentex/resources/tasks.py">timeout</a>(task_id, \*\*<a href="src/agentex/types/task_timeout_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
74+
- <code title="put /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">update_by_id</a>(task_id, \*\*<a href="src/agentex/types/task_update_by_id_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
75+
- <code title="put /tasks/name/{task_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">update_by_name</a>(task_name, \*\*<a href="src/agentex/types/task_update_by_name_params.py">params</a>) -> <a href="./src/agentex/types/task.py">Task</a></code>
5876

5977
# Messages
6078

@@ -154,3 +172,16 @@ Methods:
154172
- <code title="get /tracker/{tracker_id}">client.tracker.<a href="./src/agentex/resources/tracker.py">retrieve</a>(tracker_id) -> <a href="./src/agentex/types/agent_task_tracker.py">AgentTaskTracker</a></code>
155173
- <code title="put /tracker/{tracker_id}">client.tracker.<a href="./src/agentex/resources/tracker.py">update</a>(tracker_id, \*\*<a href="src/agentex/types/tracker_update_params.py">params</a>) -> <a href="./src/agentex/types/agent_task_tracker.py">AgentTaskTracker</a></code>
156174
- <code title="get /tracker">client.tracker.<a href="./src/agentex/resources/tracker.py">list</a>(\*\*<a href="src/agentex/types/tracker_list_params.py">params</a>) -> <a href="./src/agentex/types/tracker_list_response.py">TrackerListResponse</a></code>
175+
176+
# DeploymentHistory
177+
178+
Types:
179+
180+
```python
181+
from agentex.types import DeploymentHistoryRetrieveResponse, DeploymentHistoryListResponse
182+
```
183+
184+
Methods:
185+
186+
- <code title="get /deployment-history/{deployment_id}">client.deployment_history.<a href="./src/agentex/resources/deployment_history.py">retrieve</a>(deployment_id) -> <a href="./src/agentex/types/deployment_history_retrieve_response.py">DeploymentHistoryRetrieveResponse</a></code>
187+
- <code title="get /deployment-history">client.deployment_history.<a href="./src/agentex/resources/deployment_history.py">list</a>(\*\*<a href="src/agentex/types/deployment_history_list_params.py">params</a>) -> <a href="./src/agentex/types/deployment_history_list_response.py">DeploymentHistoryListResponse</a></code>

src/agentex/_client.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
)
3232

3333
if TYPE_CHECKING:
34-
from .resources import spans, tasks, agents, events, states, tracker, messages
34+
from .resources import spans, tasks, agents, events, states, tracker, messages, deployment_history
3535
from .resources.spans import SpansResource, AsyncSpansResource
3636
from .resources.tasks import TasksResource, AsyncTasksResource
3737
from .resources.agents import AgentsResource, AsyncAgentsResource
3838
from .resources.events import EventsResource, AsyncEventsResource
3939
from .resources.states import StatesResource, AsyncStatesResource
4040
from .resources.tracker import TrackerResource, AsyncTrackerResource
4141
from .resources.messages.messages import MessagesResource, AsyncMessagesResource
42+
from .resources.deployment_history import DeploymentHistoryResource, AsyncDeploymentHistoryResource
4243

4344
__all__ = [
4445
"ENVIRONMENTS",
@@ -175,6 +176,12 @@ def tracker(self) -> TrackerResource:
175176

176177
return TrackerResource(self)
177178

179+
@cached_property
180+
def deployment_history(self) -> DeploymentHistoryResource:
181+
from .resources.deployment_history import DeploymentHistoryResource
182+
183+
return DeploymentHistoryResource(self)
184+
178185
@cached_property
179186
def with_raw_response(self) -> AgentexWithRawResponse:
180187
return AgentexWithRawResponse(self)
@@ -409,6 +416,12 @@ def tracker(self) -> AsyncTrackerResource:
409416

410417
return AsyncTrackerResource(self)
411418

419+
@cached_property
420+
def deployment_history(self) -> AsyncDeploymentHistoryResource:
421+
from .resources.deployment_history import AsyncDeploymentHistoryResource
422+
423+
return AsyncDeploymentHistoryResource(self)
424+
412425
@cached_property
413426
def with_raw_response(self) -> AsyncAgentexWithRawResponse:
414427
return AsyncAgentexWithRawResponse(self)
@@ -574,6 +587,12 @@ def tracker(self) -> tracker.TrackerResourceWithRawResponse:
574587

575588
return TrackerResourceWithRawResponse(self._client.tracker)
576589

590+
@cached_property
591+
def deployment_history(self) -> deployment_history.DeploymentHistoryResourceWithRawResponse:
592+
from .resources.deployment_history import DeploymentHistoryResourceWithRawResponse
593+
594+
return DeploymentHistoryResourceWithRawResponse(self._client.deployment_history)
595+
577596

578597
class AsyncAgentexWithRawResponse:
579598
_client: AsyncAgentex
@@ -623,6 +642,12 @@ def tracker(self) -> tracker.AsyncTrackerResourceWithRawResponse:
623642

624643
return AsyncTrackerResourceWithRawResponse(self._client.tracker)
625644

645+
@cached_property
646+
def deployment_history(self) -> deployment_history.AsyncDeploymentHistoryResourceWithRawResponse:
647+
from .resources.deployment_history import AsyncDeploymentHistoryResourceWithRawResponse
648+
649+
return AsyncDeploymentHistoryResourceWithRawResponse(self._client.deployment_history)
650+
626651

627652
class AgentexWithStreamedResponse:
628653
_client: Agentex
@@ -672,6 +697,12 @@ def tracker(self) -> tracker.TrackerResourceWithStreamingResponse:
672697

673698
return TrackerResourceWithStreamingResponse(self._client.tracker)
674699

700+
@cached_property
701+
def deployment_history(self) -> deployment_history.DeploymentHistoryResourceWithStreamingResponse:
702+
from .resources.deployment_history import DeploymentHistoryResourceWithStreamingResponse
703+
704+
return DeploymentHistoryResourceWithStreamingResponse(self._client.deployment_history)
705+
675706

676707
class AsyncAgentexWithStreamedResponse:
677708
_client: AsyncAgentex
@@ -721,6 +752,12 @@ def tracker(self) -> tracker.AsyncTrackerResourceWithStreamingResponse:
721752

722753
return AsyncTrackerResourceWithStreamingResponse(self._client.tracker)
723754

755+
@cached_property
756+
def deployment_history(self) -> deployment_history.AsyncDeploymentHistoryResourceWithStreamingResponse:
757+
from .resources.deployment_history import AsyncDeploymentHistoryResourceWithStreamingResponse
758+
759+
return AsyncDeploymentHistoryResourceWithStreamingResponse(self._client.deployment_history)
760+
724761

725762
Client = Agentex
726763

src/agentex/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
MessagesResourceWithStreamingResponse,
5757
AsyncMessagesResourceWithStreamingResponse,
5858
)
59+
from .deployment_history import (
60+
DeploymentHistoryResource,
61+
AsyncDeploymentHistoryResource,
62+
DeploymentHistoryResourceWithRawResponse,
63+
AsyncDeploymentHistoryResourceWithRawResponse,
64+
DeploymentHistoryResourceWithStreamingResponse,
65+
AsyncDeploymentHistoryResourceWithStreamingResponse,
66+
)
5967

6068
__all__ = [
6169
"AgentsResource",
@@ -100,4 +108,10 @@
100108
"AsyncTrackerResourceWithRawResponse",
101109
"TrackerResourceWithStreamingResponse",
102110
"AsyncTrackerResourceWithStreamingResponse",
111+
"DeploymentHistoryResource",
112+
"AsyncDeploymentHistoryResource",
113+
"DeploymentHistoryResourceWithRawResponse",
114+
"AsyncDeploymentHistoryResourceWithRawResponse",
115+
"DeploymentHistoryResourceWithStreamingResponse",
116+
"AsyncDeploymentHistoryResourceWithStreamingResponse",
103117
]

0 commit comments

Comments
 (0)