22
33from __future__ import annotations
44
5- from typing import Dict , Union , Optional
5+ from typing import Union
66from 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
2016class 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-
8227Params : TypeAlias = Union [
83- ParamsCreateTaskRequest , ParamsCancelTaskRequest , ParamsSendMessageRequest , ParamsSendEventRequest
28+ CreateTaskRequestParam , CancelTaskRequestParam , SendMessageRequestParam , SendEventRequestParam
8429]
0 commit comments