Skip to content

Commit af18034

Browse files
feat(api): api update
1 parent be9b603 commit af18034

32 files changed

+529
-277
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-021b55c88964b7a5bfc9d692d32a52c6b0150445656d2407c4cb8e9dd1e5f100.yml
3-
openapi_spec_hash: ed92c0d5d6bed9cb5617f8a776ac42c9
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-62a09183a027c64707ad1b9d7a5ccc66c8abf3965e6075282cb5ab72f742a2b3.yml
3+
openapi_spec_hash: 47f43703822077a82e2edf82d4b7e0e5
44
config_hash: 2e4b423af3db79ebd8170c401ea9093a

api.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
1+
# Shared Types
2+
3+
```python
4+
from agentex.types import TaskMessageUpdate
5+
```
6+
17
# Agents
28

39
Types:
410

511
```python
6-
from agentex.types import AcpType, Agent, AgentRpcRequest, AgentListResponse
12+
from agentex.types import (
13+
AcpType,
14+
Agent,
15+
AgentRpcParams,
16+
AgentRpcRequest,
17+
AgentRpcResponse,
18+
AgentRpcResult,
19+
DataDelta,
20+
TaskMessageContent,
21+
TaskMessageDelta,
22+
TaskMessageUpdate,
23+
TextDelta,
24+
ToolRequestDelta,
25+
ToolResponseDelta,
26+
AgentListResponse,
27+
)
728
```
829

930
Methods:
@@ -13,23 +34,23 @@ Methods:
1334
- <code title="delete /agents/{agent_id}">client.agents.<a href="./src/agentex/resources/agents.py">delete</a>(agent_id) -> <a href="./src/agentex/types/agent.py">Agent</a></code>
1435
- <code title="delete /agents/name/{agent_name}">client.agents.<a href="./src/agentex/resources/agents.py">delete_by_name</a>(agent_name) -> <a href="./src/agentex/types/agent.py">Agent</a></code>
1536
- <code title="get /agents/name/{agent_name}">client.agents.<a href="./src/agentex/resources/agents.py">retrieve_by_name</a>(agent_name) -> <a href="./src/agentex/types/agent.py">Agent</a></code>
16-
- <code title="post /agents/{agent_id}/rpc">client.agents.<a href="./src/agentex/resources/agents.py">rpc</a>(agent_id, \*\*<a href="src/agentex/types/agent_rpc_params.py">params</a>) -> object</code>
17-
- <code title="post /agents/name/{agent_name}/rpc">client.agents.<a href="./src/agentex/resources/agents.py">rpc_by_name</a>(agent_name, \*\*<a href="src/agentex/types/agent_rpc_by_name_params.py">params</a>) -> object</code>
37+
- <code title="post /agents/{agent_id}/rpc">client.agents.<a href="./src/agentex/resources/agents.py">rpc</a>(agent_id, \*\*<a href="src/agentex/types/agent_rpc_params.py">params</a>) -> <a href="./src/agentex/types/agent_rpc_response.py">AgentRpcResponse</a></code>
38+
- <code title="post /agents/name/{agent_name}/rpc">client.agents.<a href="./src/agentex/resources/agents.py">rpc_by_name</a>(agent_name, \*\*<a href="src/agentex/types/agent_rpc_by_name_params.py">params</a>) -> <a href="./src/agentex/types/agent_rpc_response.py">AgentRpcResponse</a></code>
1839

1940
# Tasks
2041

2142
Types:
2243

2344
```python
24-
from agentex.types import Task, TaskListResponse
45+
from agentex.types import Task, TaskListResponse, TaskDeleteResponse, TaskDeleteByNameResponse
2546
```
2647

2748
Methods:
2849

2950
- <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.py">Task</a></code>
3051
- <code title="get /tasks">client.tasks.<a href="./src/agentex/resources/tasks.py">list</a>() -> <a href="./src/agentex/types/task_list_response.py">TaskListResponse</a></code>
31-
- <code title="delete /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete</a>(task_id) -> <a href="./src/agentex/types/task.py">Task</a></code>
32-
- <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/task.py">Task</a></code>
52+
- <code title="delete /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete</a>(task_id) -> <a href="./src/agentex/types/task_delete_response.py">TaskDeleteResponse</a></code>
53+
- <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/task_delete_by_name_response.py">TaskDeleteByNameResponse</a></code>
3354
- <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.py">Task</a></code>
3455
- <code title="get /tasks/{task_id}/stream">client.tasks.<a href="./src/agentex/resources/tasks.py">stream_events</a>(task_id) -> object</code>
3556
- <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>
@@ -43,7 +64,6 @@ from agentex.types import (
4364
DataContent,
4465
MessageAuthor,
4566
MessageStyle,
46-
StreamingStatus,
4767
TaskMessage,
4868
TextContent,
4969
ToolRequestContent,

src/agentex/resources/agents.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import httpx
99

10-
from ..types import agent_rpc_params, agent_list_params, agent_rpc_by_name_params
10+
from ..types import AgentRpcParams, agent_rpc_params, agent_list_params, agent_rpc_by_name_params
1111
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1212
from .._utils import maybe_transform, async_maybe_transform
1313
from .._compat import cached_property
@@ -20,6 +20,8 @@
2020
)
2121
from ..types.agent import Agent
2222
from .._base_client import make_request_options
23+
from ..types.agent_rpc_params import AgentRpcParams
24+
from ..types.agent_rpc_response import AgentRpcResponse
2325
from ..types.agent_list_response import AgentListResponse
2426

2527
__all__ = ["AgentsResource", "AsyncAgentsResource"]
@@ -219,7 +221,7 @@ def rpc(
219221
agent_id: str,
220222
*,
221223
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
222-
params: agent_rpc_params.Params,
224+
params: AgentRpcParams,
223225
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
224226
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
225227
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -228,11 +230,13 @@ def rpc(
228230
extra_query: Query | None = None,
229231
extra_body: Body | None = None,
230232
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
231-
) -> object:
233+
) -> AgentRpcResponse:
232234
"""
233235
Handle JSON-RPC requests for an agent by its unique ID.
234236
235237
Args:
238+
params: The parameters for the agent RPC request
239+
236240
extra_headers: Send extra headers
237241
238242
extra_query: Add additional query parameters to the request
@@ -257,15 +261,15 @@ def rpc(
257261
options=make_request_options(
258262
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
259263
),
260-
cast_to=object,
264+
cast_to=AgentRpcResponse,
261265
)
262266

263267
def rpc_by_name(
264268
self,
265269
agent_name: str,
266270
*,
267271
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
268-
params: agent_rpc_by_name_params.Params,
272+
params: AgentRpcParams,
269273
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
270274
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
271275
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -274,11 +278,13 @@ def rpc_by_name(
274278
extra_query: Query | None = None,
275279
extra_body: Body | None = None,
276280
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
277-
) -> object:
281+
) -> AgentRpcResponse:
278282
"""
279283
Handle JSON-RPC requests for an agent by its unique name.
280284
281285
Args:
286+
params: The parameters for the agent RPC request
287+
282288
extra_headers: Send extra headers
283289
284290
extra_query: Add additional query parameters to the request
@@ -303,7 +309,7 @@ def rpc_by_name(
303309
options=make_request_options(
304310
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
305311
),
306-
cast_to=object,
312+
cast_to=AgentRpcResponse,
307313
)
308314

309315

@@ -501,7 +507,7 @@ async def rpc(
501507
agent_id: str,
502508
*,
503509
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
504-
params: agent_rpc_params.Params,
510+
params: AgentRpcParams,
505511
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
506512
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
507513
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -510,11 +516,13 @@ async def rpc(
510516
extra_query: Query | None = None,
511517
extra_body: Body | None = None,
512518
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
513-
) -> object:
519+
) -> AgentRpcResponse:
514520
"""
515521
Handle JSON-RPC requests for an agent by its unique ID.
516522
517523
Args:
524+
params: The parameters for the agent RPC request
525+
518526
extra_headers: Send extra headers
519527
520528
extra_query: Add additional query parameters to the request
@@ -539,15 +547,15 @@ async def rpc(
539547
options=make_request_options(
540548
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
541549
),
542-
cast_to=object,
550+
cast_to=AgentRpcResponse,
543551
)
544552

545553
async def rpc_by_name(
546554
self,
547555
agent_name: str,
548556
*,
549557
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
550-
params: agent_rpc_by_name_params.Params,
558+
params: AgentRpcParams,
551559
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
552560
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
553561
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -556,11 +564,13 @@ async def rpc_by_name(
556564
extra_query: Query | None = None,
557565
extra_body: Body | None = None,
558566
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
559-
) -> object:
567+
) -> AgentRpcResponse:
560568
"""
561569
Handle JSON-RPC requests for an agent by its unique name.
562570
563571
Args:
572+
params: The parameters for the agent RPC request
573+
564574
extra_headers: Send extra headers
565575
566576
extra_query: Add additional query parameters to the request
@@ -585,7 +595,7 @@ async def rpc_by_name(
585595
options=make_request_options(
586596
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
587597
),
588-
cast_to=object,
598+
cast_to=AgentRpcResponse,
589599
)
590600

591601

src/agentex/resources/messages/batch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
)
1919
from ..._base_client import make_request_options
2020
from ...types.messages import batch_create_params, batch_update_params
21+
from ...types.task_message_content_param import TaskMessageContentParam
2122
from ...types.messages.batch_create_response import BatchCreateResponse
2223
from ...types.messages.batch_update_response import BatchUpdateResponse
2324

@@ -47,7 +48,7 @@ def with_streaming_response(self) -> BatchResourceWithStreamingResponse:
4748
def create(
4849
self,
4950
*,
50-
contents: Iterable[batch_create_params.Content],
51+
contents: Iterable[TaskMessageContentParam],
5152
task_id: str,
5253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5354
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -87,7 +88,7 @@ def update(
8788
self,
8889
*,
8990
task_id: str,
90-
updates: Dict[str, batch_update_params.Updates],
91+
updates: Dict[str, TaskMessageContentParam],
9192
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9293
# The extra values given here take precedence over values defined on the client or passed to this method.
9394
extra_headers: Headers | None = None,
@@ -146,7 +147,7 @@ def with_streaming_response(self) -> AsyncBatchResourceWithStreamingResponse:
146147
async def create(
147148
self,
148149
*,
149-
contents: Iterable[batch_create_params.Content],
150+
contents: Iterable[TaskMessageContentParam],
150151
task_id: str,
151152
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
152153
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -186,7 +187,7 @@ async def update(
186187
self,
187188
*,
188189
task_id: str,
189-
updates: Dict[str, batch_update_params.Updates],
190+
updates: Dict[str, TaskMessageContentParam],
190191
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
191192
# The extra values given here take precedence over values defined on the client or passed to this method.
192193
extra_headers: Headers | None = None,

src/agentex/resources/messages/messages.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Optional
6+
from typing_extensions import Literal
67

78
import httpx
89

@@ -14,7 +15,7 @@
1415
BatchResourceWithStreamingResponse,
1516
AsyncBatchResourceWithStreamingResponse,
1617
)
17-
from ...types import StreamingStatus, message_list_params, message_create_params, message_update_params
18+
from ...types import message_list_params, message_create_params, message_update_params
1819
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
1920
from ..._utils import maybe_transform, async_maybe_transform
2021
from ..._compat import cached_property
@@ -27,8 +28,8 @@
2728
)
2829
from ..._base_client import make_request_options
2930
from ...types.task_message import TaskMessage
30-
from ...types.streaming_status import StreamingStatus
3131
from ...types.message_list_response import MessageListResponse
32+
from ...types.task_message_content_param import TaskMessageContentParam
3233

3334
__all__ = ["MessagesResource", "AsyncMessagesResource"]
3435

@@ -60,9 +61,9 @@ def with_streaming_response(self) -> MessagesResourceWithStreamingResponse:
6061
def create(
6162
self,
6263
*,
63-
content: message_create_params.Content,
64+
content: TaskMessageContentParam,
6465
task_id: str,
65-
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
66+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
6667
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6768
# The extra values given here take precedence over values defined on the client or passed to this method.
6869
extra_headers: Headers | None = None,
@@ -135,9 +136,9 @@ def update(
135136
self,
136137
message_id: str,
137138
*,
138-
content: message_update_params.Content,
139+
content: TaskMessageContentParam,
139140
task_id: str,
140-
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
141+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
141142
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
142143
# The extra values given here take precedence over values defined on the client or passed to this method.
143144
extra_headers: Headers | None = None,
@@ -245,9 +246,9 @@ def with_streaming_response(self) -> AsyncMessagesResourceWithStreamingResponse:
245246
async def create(
246247
self,
247248
*,
248-
content: message_create_params.Content,
249+
content: TaskMessageContentParam,
249250
task_id: str,
250-
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
251+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
251252
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
252253
# The extra values given here take precedence over values defined on the client or passed to this method.
253254
extra_headers: Headers | None = None,
@@ -320,9 +321,9 @@ async def update(
320321
self,
321322
message_id: str,
322323
*,
323-
content: message_update_params.Content,
324+
content: TaskMessageContentParam,
324325
task_id: str,
325-
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
326+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
326327
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
327328
# The extra values given here take precedence over values defined on the client or passed to this method.
328329
extra_headers: Headers | None = None,

0 commit comments

Comments
 (0)