Skip to content

Commit d999a43

Browse files
feat(api): manual updates
1 parent a885d8d commit d999a43

28 files changed

+414
-532
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-1d08fb2290b5310c91801d7575d356628d372fd5434e15d3b9cead48eadb893f.yml
33
openapi_spec_hash: c07c588fb8429fbf024189df62f20fa4
4-
config_hash: 5a41a91d658dffbd60d617eb02e945f6
4+
config_hash: 2e4b423af3db79ebd8170c401ea9093a

api.md

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

39
Types:
@@ -6,10 +12,18 @@ Types:
612
from agentex.types import (
713
AcpType,
814
Agent,
15+
AgentRpcParams,
916
AgentRpcRequest,
10-
AgentListResponse,
1117
AgentRpcResponse,
12-
AgentRpcByNameResponse,
18+
AgentRpcResult,
19+
DataDelta,
20+
TaskMessageContent,
21+
TaskMessageDelta,
22+
TaskMessageUpdate,
23+
TextDelta,
24+
ToolRequestDelta,
25+
ToolResponseDelta,
26+
AgentListResponse,
1327
)
1428
```
1529

@@ -21,7 +35,7 @@ Methods:
2135
- <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>
2236
- <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>
2337
- <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>
24-
- <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_by_name_response.py">AgentRpcByNameResponse</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>
2539

2640
# Tasks
2741

src/agentex/resources/agents.py

Lines changed: 10 additions & 10 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,9 +20,9 @@
2020
)
2121
from ..types.agent import Agent
2222
from .._base_client import make_request_options
23+
from ..types.agent_rpc_params import AgentRpcParams
2324
from ..types.agent_rpc_response import AgentRpcResponse
2425
from ..types.agent_list_response import AgentListResponse
25-
from ..types.agent_rpc_by_name_response import AgentRpcByNameResponse
2626

2727
__all__ = ["AgentsResource", "AsyncAgentsResource"]
2828

@@ -221,7 +221,7 @@ def rpc(
221221
agent_id: str,
222222
*,
223223
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
224-
params: agent_rpc_params.Params,
224+
params: AgentRpcParams,
225225
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
226226
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
227227
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -269,7 +269,7 @@ def rpc_by_name(
269269
agent_name: str,
270270
*,
271271
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
272-
params: agent_rpc_by_name_params.Params,
272+
params: AgentRpcParams,
273273
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
274274
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
275275
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -278,7 +278,7 @@ def rpc_by_name(
278278
extra_query: Query | None = None,
279279
extra_body: Body | None = None,
280280
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
281-
) -> AgentRpcByNameResponse:
281+
) -> AgentRpcResponse:
282282
"""
283283
Handle JSON-RPC requests for an agent by its unique name.
284284
@@ -309,7 +309,7 @@ def rpc_by_name(
309309
options=make_request_options(
310310
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
311311
),
312-
cast_to=AgentRpcByNameResponse,
312+
cast_to=AgentRpcResponse,
313313
)
314314

315315

@@ -507,7 +507,7 @@ async def rpc(
507507
agent_id: str,
508508
*,
509509
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
510-
params: agent_rpc_params.Params,
510+
params: AgentRpcParams,
511511
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
512512
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
513513
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -555,7 +555,7 @@ async def rpc_by_name(
555555
agent_name: str,
556556
*,
557557
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
558-
params: agent_rpc_by_name_params.Params,
558+
params: AgentRpcParams,
559559
id: Union[int, str, None] | NotGiven = NOT_GIVEN,
560560
jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN,
561561
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -564,7 +564,7 @@ async def rpc_by_name(
564564
extra_query: Query | None = None,
565565
extra_body: Body | None = None,
566566
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
567-
) -> AgentRpcByNameResponse:
567+
) -> AgentRpcResponse:
568568
"""
569569
Handle JSON-RPC requests for an agent by its unique name.
570570
@@ -595,7 +595,7 @@ async def rpc_by_name(
595595
options=make_request_options(
596596
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
597597
),
598-
cast_to=AgentRpcByNameResponse,
598+
cast_to=AgentRpcResponse,
599599
)
600600

601601

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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from ..._base_client import make_request_options
3030
from ...types.task_message import TaskMessage
3131
from ...types.message_list_response import MessageListResponse
32+
from ...types.task_message_content_param import TaskMessageContentParam
3233

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

@@ -60,7 +61,7 @@ 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,
6566
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.
@@ -135,7 +136,7 @@ def update(
135136
self,
136137
message_id: str,
137138
*,
138-
content: message_update_params.Content,
139+
content: TaskMessageContentParam,
139140
task_id: str,
140141
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.
@@ -245,7 +246,7 @@ 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,
250251
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.
@@ -320,7 +321,7 @@ async def update(
320321
self,
321322
message_id: str,
322323
*,
323-
content: message_update_params.Content,
324+
content: TaskMessageContentParam,
324325
task_id: str,
325326
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.

src/agentex/types/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
from .agent import Agent as Agent
88
from .event import Event as Event
99
from .state import State as State
10+
from .shared import TaskMessageUpdate as TaskMessageUpdate
1011
from .acp_type import AcpType as AcpType
12+
from .data_delta import DataDelta as DataDelta
13+
from .text_delta import TextDelta as TextDelta
1114
from .data_content import DataContent as DataContent
1215
from .task_message import TaskMessage as TaskMessage
1316
from .text_content import TextContent as TextContent
1417
from .message_style import MessageStyle as MessageStyle
1518
from .message_author import MessageAuthor as MessageAuthor
1619
from .agent_rpc_params import AgentRpcParams as AgentRpcParams
20+
from .agent_rpc_result import AgentRpcResult as AgentRpcResult
1721
from .span_list_params import SpanListParams as SpanListParams
1822
from .agent_list_params import AgentListParams as AgentListParams
1923
from .event_list_params import EventListParams as EventListParams
@@ -25,14 +29,18 @@
2529
from .span_list_response import SpanListResponse as SpanListResponse
2630
from .span_update_params import SpanUpdateParams as SpanUpdateParams
2731
from .task_list_response import TaskListResponse as TaskListResponse
32+
from .task_message_delta import TaskMessageDelta as TaskMessageDelta
2833
from .text_content_param import TextContentParam as TextContentParam
34+
from .tool_request_delta import ToolRequestDelta as ToolRequestDelta
2935
from .agent_list_response import AgentListResponse as AgentListResponse
3036
from .event_list_response import EventListResponse as EventListResponse
3137
from .message_list_params import MessageListParams as MessageListParams
3238
from .state_create_params import StateCreateParams as StateCreateParams
3339
from .state_list_response import StateListResponse as StateListResponse
3440
from .state_update_params import StateUpdateParams as StateUpdateParams
41+
from .tool_response_delta import ToolResponseDelta as ToolResponseDelta
3542
from .tracker_list_params import TrackerListParams as TrackerListParams
43+
from .task_message_content import TaskMessageContent as TaskMessageContent
3644
from .tool_request_content import ToolRequestContent as ToolRequestContent
3745
from .message_create_params import MessageCreateParams as MessageCreateParams
3846
from .message_list_response import MessageListResponse as MessageListResponse
@@ -41,6 +49,6 @@
4149
from .tracker_list_response import TrackerListResponse as TrackerListResponse
4250
from .tracker_update_params import TrackerUpdateParams as TrackerUpdateParams
4351
from .agent_rpc_by_name_params import AgentRpcByNameParams as AgentRpcByNameParams
44-
from .agent_rpc_by_name_response import AgentRpcByNameResponse as AgentRpcByNameResponse
52+
from .task_message_content_param import TaskMessageContentParam as TaskMessageContentParam
4553
from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam
4654
from .tool_response_content_param import ToolResponseContentParam as ToolResponseContentParam

src/agentex/types/agent_rpc_by_name_params.py

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,20 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union, Optional
6-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
5+
from typing import Union
6+
from typing_extensions import Literal, Required, TypedDict
77

8-
from .data_content_param import DataContentParam
9-
from .text_content_param import TextContentParam
10-
from .tool_request_content_param import ToolRequestContentParam
11-
from .tool_response_content_param import ToolResponseContentParam
8+
from .agent_rpc_params import AgentRpcParams
129

13-
__all__ = [
14-
"AgentRpcByNameParams",
15-
"Params",
16-
"ParamsCreateTaskRequest",
17-
"ParamsCancelTaskRequest",
18-
"ParamsSendMessageRequest",
19-
"ParamsSendMessageRequestContent",
20-
"ParamsSendEventRequest",
21-
"ParamsSendEventRequestContent",
22-
]
10+
__all__ = ["AgentRpcByNameParams"]
2311

2412

2513
class AgentRpcByNameParams(TypedDict, total=False):
2614
method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]]
2715

28-
params: Required[Params]
16+
params: Required[AgentRpcParams]
2917
"""The parameters for the agent RPC request"""
3018

3119
id: Union[int, str, None]
3220

3321
jsonrpc: Literal["2.0"]
34-
35-
36-
class ParamsCreateTaskRequest(TypedDict, total=False):
37-
name: Optional[str]
38-
"""The name of the task to create"""
39-
40-
params: Optional[Dict[str, object]]
41-
"""The parameters for the task"""
42-
43-
44-
class ParamsCancelTaskRequest(TypedDict, total=False):
45-
task_id: Optional[str]
46-
"""The ID of the task to cancel. Either this or task_name must be provided."""
47-
48-
task_name: Optional[str]
49-
"""The name of the task to cancel. Either this or task_id must be provided."""
50-
51-
52-
ParamsSendMessageRequestContent: TypeAlias = Union[
53-
TextContentParam, DataContentParam, ToolRequestContentParam, ToolResponseContentParam
54-
]
55-
56-
57-
class ParamsSendMessageRequest(TypedDict, total=False):
58-
content: Required[ParamsSendMessageRequestContent]
59-
"""The message that was sent to the agent"""
60-
61-
stream: bool
62-
"""Whether to stream the response message back to the client"""
63-
64-
task_id: Optional[str]
65-
"""The ID of the task that the message was sent to"""
66-
67-
68-
ParamsSendEventRequestContent: TypeAlias = Union[
69-
TextContentParam, DataContentParam, ToolRequestContentParam, ToolResponseContentParam
70-
]
71-
72-
73-
class ParamsSendEventRequest(TypedDict, total=False):
74-
content: Optional[ParamsSendEventRequestContent]
75-
"""The content to send to the event"""
76-
77-
task_id: Optional[str]
78-
"""The ID of the task that the event was sent to"""
79-
80-
task_name: Optional[str]
81-
"""The name of the task that the event was sent to"""
82-
83-
84-
Params: TypeAlias = Union[
85-
ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest
86-
]

0 commit comments

Comments
 (0)