Skip to content

Commit afedf45

Browse files
feat(api): api update
1 parent 3b10c89 commit afedf45

26 files changed

+253
-392
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-1d08fb2290b5310c91801d7575d356628d372fd5434e15d3b9cead48eadb893f.yml
3-
openapi_spec_hash: 216a0edbf4e1a3cde23329d4f385faed
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-021b55c88964b7a5bfc9d692d32a52c6b0150445656d2407c4cb8e9dd1e5f100.yml
3+
openapi_spec_hash: ed92c0d5d6bed9cb5617f8a776ac42c9
44
config_hash: 7661726e3cccf9f6349179841153601d

api.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,7 @@
33
Types:
44

55
```python
6-
from agentex.types import (
7-
AcpType,
8-
Agent,
9-
AgentRpcParams,
10-
AgentRpcRequest,
11-
AgentRpcResponse,
12-
AgentRpcResult,
13-
DataDelta,
14-
TaskMessageContent,
15-
TaskMessageDelta,
16-
TaskMessageUpdate,
17-
TextDelta,
18-
ToolRequestDelta,
19-
ToolResponseDelta,
20-
AgentListResponse,
21-
)
6+
from agentex.types import AcpType, Agent, AgentRpcRequest, AgentListResponse
227
```
238

249
Methods:
@@ -28,8 +13,8 @@ Methods:
2813
- <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>
2914
- <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>
3015
- <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>
31-
- <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>
32-
- <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>
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>
3318

3419
# Tasks
3520

@@ -58,6 +43,7 @@ from agentex.types import (
5843
DataContent,
5944
MessageAuthor,
6045
MessageStyle,
46+
StreamingStatus,
6147
TaskMessage,
6248
TextContent,
6349
ToolRequestContent,

src/agentex/resources/agents.py

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

88
import httpx
99

10-
from ..types import AgentRpcParams, agent_rpc_params, agent_list_params, agent_rpc_by_name_params
10+
from ..types import 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,8 +20,6 @@
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
2523
from ..types.agent_list_response import AgentListResponse
2624

2725
__all__ = ["AgentsResource", "AsyncAgentsResource"]
@@ -221,7 +219,7 @@ def rpc(
221219
agent_id: str,
222220
*,
223221
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
224-
params: AgentRpcParams,
222+
params: agent_rpc_params.Params,
225223
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
226224
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
227225
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -230,13 +228,11 @@ def rpc(
230228
extra_query: Query | None = None,
231229
extra_body: Body | None = None,
232230
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
233-
) -> AgentRpcResponse:
231+
) -> object:
234232
"""
235233
Handle JSON-RPC requests for an agent by its unique ID.
236234
237235
Args:
238-
params: The parameters for the agent RPC request
239-
240236
extra_headers: Send extra headers
241237
242238
extra_query: Add additional query parameters to the request
@@ -261,15 +257,15 @@ def rpc(
261257
options=make_request_options(
262258
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
263259
),
264-
cast_to=AgentRpcResponse,
260+
cast_to=object,
265261
)
266262

267263
def rpc_by_name(
268264
self,
269265
agent_name: str,
270266
*,
271267
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
272-
params: AgentRpcParams,
268+
params: agent_rpc_by_name_params.Params,
273269
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
274270
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
275271
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -278,13 +274,11 @@ def rpc_by_name(
278274
extra_query: Query | None = None,
279275
extra_body: Body | None = None,
280276
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
281-
) -> AgentRpcResponse:
277+
) -> object:
282278
"""
283279
Handle JSON-RPC requests for an agent by its unique name.
284280
285281
Args:
286-
params: The parameters for the agent RPC request
287-
288282
extra_headers: Send extra headers
289283
290284
extra_query: Add additional query parameters to the request
@@ -309,7 +303,7 @@ def rpc_by_name(
309303
options=make_request_options(
310304
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
311305
),
312-
cast_to=AgentRpcResponse,
306+
cast_to=object,
313307
)
314308

315309

@@ -507,7 +501,7 @@ async def rpc(
507501
agent_id: str,
508502
*,
509503
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
510-
params: AgentRpcParams,
504+
params: agent_rpc_params.Params,
511505
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
512506
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
513507
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -516,13 +510,11 @@ async def rpc(
516510
extra_query: Query | None = None,
517511
extra_body: Body | None = None,
518512
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
519-
) -> AgentRpcResponse:
513+
) -> object:
520514
"""
521515
Handle JSON-RPC requests for an agent by its unique ID.
522516
523517
Args:
524-
params: The parameters for the agent RPC request
525-
526518
extra_headers: Send extra headers
527519
528520
extra_query: Add additional query parameters to the request
@@ -547,15 +539,15 @@ async def rpc(
547539
options=make_request_options(
548540
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
549541
),
550-
cast_to=AgentRpcResponse,
542+
cast_to=object,
551543
)
552544

553545
async def rpc_by_name(
554546
self,
555547
agent_name: str,
556548
*,
557549
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
558-
params: AgentRpcParams,
550+
params: agent_rpc_by_name_params.Params,
559551
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
560552
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
561553
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -564,13 +556,11 @@ async def rpc_by_name(
564556
extra_query: Query | None = None,
565557
extra_body: Body | None = None,
566558
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
567-
) -> AgentRpcResponse:
559+
) -> object:
568560
"""
569561
Handle JSON-RPC requests for an agent by its unique name.
570562
571563
Args:
572-
params: The parameters for the agent RPC request
573-
574564
extra_headers: Send extra headers
575565
576566
extra_query: Add additional query parameters to the request
@@ -595,7 +585,7 @@ async def rpc_by_name(
595585
options=make_request_options(
596586
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
597587
),
598-
cast_to=AgentRpcResponse,
588+
cast_to=object,
599589
)
600590

601591

src/agentex/resources/messages/batch.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
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
2221
from ...types.messages.batch_create_response import BatchCreateResponse
2322
from ...types.messages.batch_update_response import BatchUpdateResponse
2423

@@ -48,7 +47,7 @@ def with_streaming_response(self) -> BatchResourceWithStreamingResponse:
4847
def create(
4948
self,
5049
*,
51-
contents: Iterable[TaskMessageContentParam],
50+
contents: Iterable[batch_create_params.Content],
5251
task_id: str,
5352
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5453
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -88,7 +87,7 @@ def update(
8887
self,
8988
*,
9089
task_id: str,
91-
updates: Dict[str, TaskMessageContentParam],
90+
updates: Dict[str, batch_update_params.Updates],
9291
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9392
# The extra values given here take precedence over values defined on the client or passed to this method.
9493
extra_headers: Headers | None = None,
@@ -147,7 +146,7 @@ def with_streaming_response(self) -> AsyncBatchResourceWithStreamingResponse:
147146
async def create(
148147
self,
149148
*,
150-
contents: Iterable[TaskMessageContentParam],
149+
contents: Iterable[batch_create_params.Content],
151150
task_id: str,
152151
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153152
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -187,7 +186,7 @@ async def update(
187186
self,
188187
*,
189188
task_id: str,
190-
updates: Dict[str, TaskMessageContentParam],
189+
updates: Dict[str, batch_update_params.Updates],
191190
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
192191
# The extra values given here take precedence over values defined on the client or passed to this method.
193192
extra_headers: Headers | None = None,

src/agentex/resources/messages/messages.py

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

55
from typing import Optional
6-
from typing_extensions import Literal
76

87
import httpx
98

@@ -15,7 +14,7 @@
1514
BatchResourceWithStreamingResponse,
1615
AsyncBatchResourceWithStreamingResponse,
1716
)
18-
from ...types import message_list_params, message_create_params, message_update_params
17+
from ...types import StreamingStatus, message_list_params, message_create_params, message_update_params
1918
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
2019
from ..._utils import maybe_transform, async_maybe_transform
2120
from ..._compat import cached_property
@@ -28,8 +27,8 @@
2827
)
2928
from ..._base_client import make_request_options
3029
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
3332

3433
__all__ = ["MessagesResource", "AsyncMessagesResource"]
3534

@@ -61,9 +60,9 @@ def with_streaming_response(self) -> MessagesResourceWithStreamingResponse:
6160
def create(
6261
self,
6362
*,
64-
content: TaskMessageContentParam,
63+
content: message_create_params.Content,
6564
task_id: str,
66-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
65+
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
6766
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6867
# The extra values given here take precedence over values defined on the client or passed to this method.
6968
extra_headers: Headers | None = None,
@@ -136,9 +135,9 @@ def update(
136135
self,
137136
message_id: str,
138137
*,
139-
content: TaskMessageContentParam,
138+
content: message_update_params.Content,
140139
task_id: str,
141-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
140+
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
142141
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143142
# The extra values given here take precedence over values defined on the client or passed to this method.
144143
extra_headers: Headers | None = None,
@@ -246,9 +245,9 @@ def with_streaming_response(self) -> AsyncMessagesResourceWithStreamingResponse:
246245
async def create(
247246
self,
248247
*,
249-
content: TaskMessageContentParam,
248+
content: message_create_params.Content,
250249
task_id: str,
251-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
250+
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
252251
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
253252
# The extra values given here take precedence over values defined on the client or passed to this method.
254253
extra_headers: Headers | None = None,
@@ -321,9 +320,9 @@ async def update(
321320
self,
322321
message_id: str,
323322
*,
324-
content: TaskMessageContentParam,
323+
content: message_update_params.Content,
325324
task_id: str,
326-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | NotGiven = NOT_GIVEN,
325+
streaming_status: Optional[StreamingStatus] | NotGiven = NOT_GIVEN,
327326
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
328327
# The extra values given here take precedence over values defined on the client or passed to this method.
329328
extra_headers: Headers | None = None,

src/agentex/types/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,31 @@
88
from .event import Event as Event
99
from .state import State as State
1010
from .acp_type import AcpType as AcpType
11-
from .data_delta import DataDelta as DataDelta
12-
from .text_delta import TextDelta as TextDelta
1311
from .data_content import DataContent as DataContent
1412
from .task_message import TaskMessage as TaskMessage
1513
from .text_content import TextContent as TextContent
1614
from .message_style import MessageStyle as MessageStyle
1715
from .message_author import MessageAuthor as MessageAuthor
1816
from .agent_rpc_params import AgentRpcParams as AgentRpcParams
19-
from .agent_rpc_result import AgentRpcResult as AgentRpcResult
2017
from .span_list_params import SpanListParams as SpanListParams
18+
from .streaming_status import StreamingStatus as StreamingStatus
2119
from .agent_list_params import AgentListParams as AgentListParams
2220
from .event_list_params import EventListParams as EventListParams
2321
from .state_list_params import StateListParams as StateListParams
24-
from .agent_rpc_response import AgentRpcResponse as AgentRpcResponse
2522
from .agent_task_tracker import AgentTaskTracker as AgentTaskTracker
2623
from .data_content_param import DataContentParam as DataContentParam
2724
from .span_create_params import SpanCreateParams as SpanCreateParams
2825
from .span_list_response import SpanListResponse as SpanListResponse
2926
from .span_update_params import SpanUpdateParams as SpanUpdateParams
3027
from .task_list_response import TaskListResponse as TaskListResponse
31-
from .task_message_delta import TaskMessageDelta as TaskMessageDelta
3228
from .text_content_param import TextContentParam as TextContentParam
33-
from .tool_request_delta import ToolRequestDelta as ToolRequestDelta
3429
from .agent_list_response import AgentListResponse as AgentListResponse
3530
from .event_list_response import EventListResponse as EventListResponse
3631
from .message_list_params import MessageListParams as MessageListParams
3732
from .state_create_params import StateCreateParams as StateCreateParams
3833
from .state_list_response import StateListResponse as StateListResponse
3934
from .state_update_params import StateUpdateParams as StateUpdateParams
40-
from .tool_response_delta import ToolResponseDelta as ToolResponseDelta
4135
from .tracker_list_params import TrackerListParams as TrackerListParams
42-
from .task_message_content import TaskMessageContent as TaskMessageContent
4336
from .tool_request_content import ToolRequestContent as ToolRequestContent
4437
from .message_create_params import MessageCreateParams as MessageCreateParams
4538
from .message_list_response import MessageListResponse as MessageListResponse
@@ -48,6 +41,5 @@
4841
from .tracker_list_response import TrackerListResponse as TrackerListResponse
4942
from .tracker_update_params import TrackerUpdateParams as TrackerUpdateParams
5043
from .agent_rpc_by_name_params import AgentRpcByNameParams as AgentRpcByNameParams
51-
from .task_message_content_param import TaskMessageContentParam as TaskMessageContentParam
5244
from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam
5345
from .tool_response_content_param import ToolResponseContentParam as ToolResponseContentParam

0 commit comments

Comments
 (0)