Skip to content

Commit 3ec2a1e

Browse files
feat(api): keep backwards compatible models
1 parent d699e24 commit 3ec2a1e

File tree

9 files changed

+111
-103
lines changed

9 files changed

+111
-103
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: 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: d65d8b7a05f302e164ef9ba7fe72b277
4+
config_hash: 5bd184c2e406dcf4485d6df328642824

api.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,9 @@ from agentex.types import (
1515
AgentRpcRequest,
1616
AgentRpcResponse,
1717
AgentRpcResult,
18-
CancelTaskRequest,
19-
CreateTaskRequest,
2018
DataDelta,
2119
ReasoningContentDelta,
2220
ReasoningSummaryDelta,
23-
SendEventRequest,
24-
SendMessageRequest,
2521
TaskMessageContent,
2622
TaskMessageDelta,
2723
TaskMessageUpdate,

src/agentex/types/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@
6363
from .reasoning_content_param import ReasoningContentParam as ReasoningContentParam
6464
from .reasoning_summary_delta import ReasoningSummaryDelta as ReasoningSummaryDelta
6565
from .agent_rpc_by_name_params import AgentRpcByNameParams as AgentRpcByNameParams
66-
from .send_event_request_param import SendEventRequestParam as SendEventRequestParam
6766
from .task_update_by_id_params import TaskUpdateByIDParams as TaskUpdateByIDParams
68-
from .cancel_task_request_param import CancelTaskRequestParam as CancelTaskRequestParam
69-
from .create_task_request_param import CreateTaskRequestParam as CreateTaskRequestParam
70-
from .send_message_request_param import SendMessageRequestParam as SendMessageRequestParam
7167
from .task_message_content_param import TaskMessageContentParam as TaskMessageContentParam
7268
from .task_update_by_name_params import TaskUpdateByNameParams as TaskUpdateByNameParams
7369
from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam

src/agentex/types/agent_rpc_by_name_params.py

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

33
from __future__ import annotations
44

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

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
8+
from .task_message_content_param import TaskMessageContentParam
129

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

1519

1620
class AgentRpcByNameParams(TypedDict, total=False):
@@ -24,6 +28,50 @@ class AgentRpcByNameParams(TypedDict, total=False):
2428
jsonrpc: Literal["2.0"]
2529

2630

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+
39+
class ParamsCancelTaskRequest(TypedDict, total=False):
40+
task_id: Optional[str]
41+
"""The ID of the task to cancel. Either this or task_name must be provided."""
42+
43+
task_name: Optional[str]
44+
"""The name of the task to cancel. Either this or task_id must be provided."""
45+
46+
47+
class ParamsSendMessageRequest(TypedDict, total=False):
48+
content: Required[TaskMessageContentParam]
49+
"""The message that was sent to the agent"""
50+
51+
stream: bool
52+
"""Whether to stream the response message back to the client"""
53+
54+
task_id: Optional[str]
55+
"""The ID of the task that the message was sent to"""
56+
57+
task_name: Optional[str]
58+
"""The name of the task that the message was sent to"""
59+
60+
task_params: Optional[Dict[str, object]]
61+
"""The parameters for the task (only used when creating new tasks)"""
62+
63+
64+
class ParamsSendEventRequest(TypedDict, total=False):
65+
content: Optional[TaskMessageContentParam]
66+
"""The content to send to the event"""
67+
68+
task_id: Optional[str]
69+
"""The ID of the task that the event was sent to"""
70+
71+
task_name: Optional[str]
72+
"""The name of the task that the event was sent to"""
73+
74+
2775
Params: TypeAlias = Union[
28-
CreateTaskRequestParam, CancelTaskRequestParam, SendMessageRequestParam, SendEventRequestParam
76+
ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest
2977
]

src/agentex/types/agent_rpc_params.py

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

33
from __future__ import annotations
44

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

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
8+
from .task_message_content_param import TaskMessageContentParam
129

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

1519

1620
class AgentRpcParams(TypedDict, total=False):
@@ -24,6 +28,50 @@ class AgentRpcParams(TypedDict, total=False):
2428
jsonrpc: Literal["2.0"]
2529

2630

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+
39+
class ParamsCancelTaskRequest(TypedDict, total=False):
40+
task_id: Optional[str]
41+
"""The ID of the task to cancel. Either this or task_name must be provided."""
42+
43+
task_name: Optional[str]
44+
"""The name of the task to cancel. Either this or task_id must be provided."""
45+
46+
47+
class ParamsSendMessageRequest(TypedDict, total=False):
48+
content: Required[TaskMessageContentParam]
49+
"""The message that was sent to the agent"""
50+
51+
stream: bool
52+
"""Whether to stream the response message back to the client"""
53+
54+
task_id: Optional[str]
55+
"""The ID of the task that the message was sent to"""
56+
57+
task_name: Optional[str]
58+
"""The name of the task that the message was sent to"""
59+
60+
task_params: Optional[Dict[str, object]]
61+
"""The parameters for the task (only used when creating new tasks)"""
62+
63+
64+
class ParamsSendEventRequest(TypedDict, total=False):
65+
content: Optional[TaskMessageContentParam]
66+
"""The content to send to the event"""
67+
68+
task_id: Optional[str]
69+
"""The ID of the task that the event was sent to"""
70+
71+
task_name: Optional[str]
72+
"""The name of the task that the event was sent to"""
73+
74+
2775
Params: TypeAlias = Union[
28-
CreateTaskRequestParam, CancelTaskRequestParam, SendMessageRequestParam, SendEventRequestParam
76+
ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest
2977
]

src/agentex/types/cancel_task_request_param.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/agentex/types/create_task_request_param.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/agentex/types/send_event_request_param.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/agentex/types/send_message_request_param.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)