Skip to content

Commit 1998d73

Browse files
feat(api): add models for event requests, surface created_at for messages
1 parent da06505 commit 1998d73

9 files changed

Lines changed: 111 additions & 126 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 45
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-9ab4b375245291b8e37dd1cbc054fa65f17b7e7db28729126ea9f1289dc99214.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-d8e0ed10d4e646d74d9f7b19b57e762c1d0497c07d79b78b304ba7f6bbaff6f6.yml
33
openapi_spec_hash: d31d828c46635cbc20165177c7187a70
4-
config_hash: fb079ef7936611b032568661b8165f19
4+
config_hash: a28c5bb7b4fadff7aadcf2b8e3aa4964

api.md

Lines changed: 4 additions & 0 deletions
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,

src/agentex/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464
from .reasoning_content_param import ReasoningContentParam as ReasoningContentParam
6565
from .reasoning_summary_delta import ReasoningSummaryDelta as ReasoningSummaryDelta
6666
from .agent_rpc_by_name_params import AgentRpcByNameParams as AgentRpcByNameParams
67+
from .send_event_request_param import SendEventRequestParam as SendEventRequestParam
6768
from .task_update_by_id_params import TaskUpdateByIDParams as TaskUpdateByIDParams
69+
from .cancel_task_request_param import CancelTaskRequestParam as CancelTaskRequestParam
70+
from .create_task_request_param import CreateTaskRequestParam as CreateTaskRequestParam
71+
from .send_message_request_param import SendMessageRequestParam as SendMessageRequestParam
6872
from .task_message_content_param import TaskMessageContentParam as TaskMessageContentParam
6973
from .task_update_by_name_params import TaskUpdateByNameParams as TaskUpdateByNameParams
7074
from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam

src/agentex/types/agent_rpc_by_name_params.py

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22

33
from __future__ import annotations
44

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

8-
from .task_message_content_param import TaskMessageContentParam
8+
from .send_event_request_param import SendEventRequestParam
9+
from .cancel_task_request_param import CancelTaskRequestParam
10+
from .create_task_request_param import CreateTaskRequestParam
11+
from .send_message_request_param import SendMessageRequestParam
912

10-
__all__ = [
11-
"AgentRpcByNameParams",
12-
"Params",
13-
"ParamsCreateTaskRequest",
14-
"ParamsCancelTaskRequest",
15-
"ParamsSendMessageRequest",
16-
"ParamsSendEventRequest",
17-
]
13+
__all__ = ["AgentRpcByNameParams", "Params"]
1814

1915

2016
class AgentRpcByNameParams(TypedDict, total=False):
@@ -28,57 +24,6 @@ class AgentRpcByNameParams(TypedDict, total=False):
2824
jsonrpc: Literal["2.0"]
2925

3026

31-
class ParamsCreateTaskRequest(TypedDict, total=False):
32-
name: Optional[str]
33-
"""The name of the task to create"""
34-
35-
params: Optional[Dict[str, object]]
36-
"""The parameters for the task"""
37-
38-
task_metadata: Optional[Dict[str, object]]
39-
"""Caller-provided metadata to persist on the task row.
40-
41-
Only applied at task creation; ignored if a task with this name already exists.
42-
Forwarded to the agent inside the ACP payload for backward compatibility.
43-
"""
44-
45-
46-
class ParamsCancelTaskRequest(TypedDict, total=False):
47-
task_id: Optional[str]
48-
"""The ID of the task to cancel. Either this or task_name must be provided."""
49-
50-
task_name: Optional[str]
51-
"""The name of the task to cancel. Either this or task_id must be provided."""
52-
53-
54-
class ParamsSendMessageRequest(TypedDict, total=False):
55-
content: Required[TaskMessageContentParam]
56-
"""The message that was sent to the agent"""
57-
58-
stream: bool
59-
"""Whether to stream the response message back to the client"""
60-
61-
task_id: Optional[str]
62-
"""The ID of the task that the message was sent to"""
63-
64-
task_name: Optional[str]
65-
"""The name of the task that the message was sent to"""
66-
67-
task_params: Optional[Dict[str, object]]
68-
"""The parameters for the task (only used when creating new tasks)"""
69-
70-
71-
class ParamsSendEventRequest(TypedDict, total=False):
72-
content: Optional[TaskMessageContentParam]
73-
"""The content to send to the event"""
74-
75-
task_id: Optional[str]
76-
"""The ID of the task that the event was sent to"""
77-
78-
task_name: Optional[str]
79-
"""The name of the task that the event was sent to"""
80-
81-
8227
Params: TypeAlias = Union[
83-
ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest
28+
CreateTaskRequestParam, CancelTaskRequestParam, SendMessageRequestParam, SendEventRequestParam
8429
]

src/agentex/types/agent_rpc_params.py

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@
22

33
from __future__ import annotations
44

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

8-
from .task_message_content_param import TaskMessageContentParam
8+
from .send_event_request_param import SendEventRequestParam
9+
from .cancel_task_request_param import CancelTaskRequestParam
10+
from .create_task_request_param import CreateTaskRequestParam
11+
from .send_message_request_param import SendMessageRequestParam
912

10-
__all__ = [
11-
"AgentRpcParams",
12-
"Params",
13-
"ParamsCreateTaskRequest",
14-
"ParamsCancelTaskRequest",
15-
"ParamsSendMessageRequest",
16-
"ParamsSendEventRequest",
17-
]
13+
__all__ = ["AgentRpcParams", "Params"]
1814

1915

2016
class AgentRpcParams(TypedDict, total=False):
@@ -28,57 +24,6 @@ class AgentRpcParams(TypedDict, total=False):
2824
jsonrpc: Literal["2.0"]
2925

3026

31-
class ParamsCreateTaskRequest(TypedDict, total=False):
32-
name: Optional[str]
33-
"""The name of the task to create"""
34-
35-
params: Optional[Dict[str, object]]
36-
"""The parameters for the task"""
37-
38-
task_metadata: Optional[Dict[str, object]]
39-
"""Caller-provided metadata to persist on the task row.
40-
41-
Only applied at task creation; ignored if a task with this name already exists.
42-
Forwarded to the agent inside the ACP payload for backward compatibility.
43-
"""
44-
45-
46-
class ParamsCancelTaskRequest(TypedDict, total=False):
47-
task_id: Optional[str]
48-
"""The ID of the task to cancel. Either this or task_name must be provided."""
49-
50-
task_name: Optional[str]
51-
"""The name of the task to cancel. Either this or task_id must be provided."""
52-
53-
54-
class ParamsSendMessageRequest(TypedDict, total=False):
55-
content: Required[TaskMessageContentParam]
56-
"""The message that was sent to the agent"""
57-
58-
stream: bool
59-
"""Whether to stream the response message back to the client"""
60-
61-
task_id: Optional[str]
62-
"""The ID of the task that the message was sent to"""
63-
64-
task_name: Optional[str]
65-
"""The name of the task that the message was sent to"""
66-
67-
task_params: Optional[Dict[str, object]]
68-
"""The parameters for the task (only used when creating new tasks)"""
69-
70-
71-
class ParamsSendEventRequest(TypedDict, total=False):
72-
content: Optional[TaskMessageContentParam]
73-
"""The content to send to the event"""
74-
75-
task_id: Optional[str]
76-
"""The ID of the task that the event was sent to"""
77-
78-
task_name: Optional[str]
79-
"""The name of the task that the event was sent to"""
80-
81-
8227
Params: TypeAlias = Union[
83-
ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest
28+
CreateTaskRequestParam, CancelTaskRequestParam, SendMessageRequestParam, SendEventRequestParam
8429
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from typing_extensions import TypedDict
7+
8+
__all__ = ["CancelTaskRequestParam"]
9+
10+
11+
class CancelTaskRequestParam(TypedDict, total=False):
12+
task_id: Optional[str]
13+
"""The ID of the task to cancel. Either this or task_name must be provided."""
14+
15+
task_name: Optional[str]
16+
"""The name of the task to cancel. Either this or task_id must be provided."""
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Dict, Optional
6+
from typing_extensions import TypedDict
7+
8+
__all__ = ["CreateTaskRequestParam"]
9+
10+
11+
class CreateTaskRequestParam(TypedDict, total=False):
12+
name: Optional[str]
13+
"""The name of the task to create"""
14+
15+
params: Optional[Dict[str, object]]
16+
"""The parameters for the task"""
17+
18+
task_metadata: Optional[Dict[str, object]]
19+
"""Caller-provided metadata to persist on the task row.
20+
21+
Only applied at task creation; ignored if a task with this name already exists.
22+
Forwarded to the agent inside the ACP payload for backward compatibility.
23+
"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
from typing_extensions import TypedDict
7+
8+
from .task_message_content_param import TaskMessageContentParam
9+
10+
__all__ = ["SendEventRequestParam"]
11+
12+
13+
class SendEventRequestParam(TypedDict, total=False):
14+
content: Optional[TaskMessageContentParam]
15+
"""The content to send to the event"""
16+
17+
task_id: Optional[str]
18+
"""The ID of the task that the event was sent to"""
19+
20+
task_name: Optional[str]
21+
"""The name of the task that the event was sent to"""
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Dict, Optional
6+
from typing_extensions import Required, TypedDict
7+
8+
from .task_message_content_param import TaskMessageContentParam
9+
10+
__all__ = ["SendMessageRequestParam"]
11+
12+
13+
class SendMessageRequestParam(TypedDict, total=False):
14+
content: Required[TaskMessageContentParam]
15+
"""The message that was sent to the agent"""
16+
17+
stream: bool
18+
"""Whether to stream the response message back to the client"""
19+
20+
task_id: Optional[str]
21+
"""The ID of the task that the message was sent to"""
22+
23+
task_name: Optional[str]
24+
"""The name of the task that the message was sent to"""
25+
26+
task_params: Optional[Dict[str, object]]
27+
"""The parameters for the task (only used when creating new tasks)"""

0 commit comments

Comments
 (0)