77
88import 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
1111from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
1212from .._utils import maybe_transform , async_maybe_transform
1313from .._compat import cached_property
2020)
2121from ..types .agent import Agent
2222from .._base_client import make_request_options
23+ from ..types .agent_rpc_params import AgentRpcParams
24+ from ..types .agent_rpc_response import AgentRpcResponse
2325from ..types .agent_list_response import AgentListResponse
2426
2527__all__ = ["AgentsResource" , "AsyncAgentsResource" ]
@@ -219,7 +221,7 @@ def rpc(
219221 agent_id : str ,
220222 * ,
221223 method : Literal ["event/send" , "task/create" , "message/send" , "task/cancel" ],
222- params : agent_rpc_params . Params ,
224+ params : AgentRpcParams ,
223225 id : Union [int , str , None ] | NotGiven = NOT_GIVEN ,
224226 jsonrpc : Literal ["2.0" ] | NotGiven = NOT_GIVEN ,
225227 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -228,11 +230,13 @@ def rpc(
228230 extra_query : Query | None = None ,
229231 extra_body : Body | None = None ,
230232 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
231- ) -> object :
233+ ) -> AgentRpcResponse :
232234 """
233235 Handle JSON-RPC requests for an agent by its unique ID.
234236
235237 Args:
238+ params: The parameters for the agent RPC request
239+
236240 extra_headers: Send extra headers
237241
238242 extra_query: Add additional query parameters to the request
@@ -257,15 +261,15 @@ def rpc(
257261 options = make_request_options (
258262 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
259263 ),
260- cast_to = object ,
264+ cast_to = AgentRpcResponse ,
261265 )
262266
263267 def rpc_by_name (
264268 self ,
265269 agent_name : str ,
266270 * ,
267271 method : Literal ["event/send" , "task/create" , "message/send" , "task/cancel" ],
268- params : agent_rpc_by_name_params . Params ,
272+ params : AgentRpcParams ,
269273 id : Union [int , str , None ] | NotGiven = NOT_GIVEN ,
270274 jsonrpc : Literal ["2.0" ] | NotGiven = NOT_GIVEN ,
271275 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -274,11 +278,13 @@ def rpc_by_name(
274278 extra_query : Query | None = None ,
275279 extra_body : Body | None = None ,
276280 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
277- ) -> object :
281+ ) -> AgentRpcResponse :
278282 """
279283 Handle JSON-RPC requests for an agent by its unique name.
280284
281285 Args:
286+ params: The parameters for the agent RPC request
287+
282288 extra_headers: Send extra headers
283289
284290 extra_query: Add additional query parameters to the request
@@ -303,7 +309,7 @@ def rpc_by_name(
303309 options = make_request_options (
304310 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
305311 ),
306- cast_to = object ,
312+ cast_to = AgentRpcResponse ,
307313 )
308314
309315
@@ -501,7 +507,7 @@ async def rpc(
501507 agent_id : str ,
502508 * ,
503509 method : Literal ["event/send" , "task/create" , "message/send" , "task/cancel" ],
504- params : agent_rpc_params . Params ,
510+ params : AgentRpcParams ,
505511 id : Union [int , str , None ] | NotGiven = NOT_GIVEN ,
506512 jsonrpc : Literal ["2.0" ] | NotGiven = NOT_GIVEN ,
507513 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -510,11 +516,13 @@ async def rpc(
510516 extra_query : Query | None = None ,
511517 extra_body : Body | None = None ,
512518 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
513- ) -> object :
519+ ) -> AgentRpcResponse :
514520 """
515521 Handle JSON-RPC requests for an agent by its unique ID.
516522
517523 Args:
524+ params: The parameters for the agent RPC request
525+
518526 extra_headers: Send extra headers
519527
520528 extra_query: Add additional query parameters to the request
@@ -539,15 +547,15 @@ async def rpc(
539547 options = make_request_options (
540548 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
541549 ),
542- cast_to = object ,
550+ cast_to = AgentRpcResponse ,
543551 )
544552
545553 async def rpc_by_name (
546554 self ,
547555 agent_name : str ,
548556 * ,
549557 method : Literal ["event/send" , "task/create" , "message/send" , "task/cancel" ],
550- params : agent_rpc_by_name_params . Params ,
558+ params : AgentRpcParams ,
551559 id : Union [int , str , None ] | NotGiven = NOT_GIVEN ,
552560 jsonrpc : Literal ["2.0" ] | NotGiven = NOT_GIVEN ,
553561 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -556,11 +564,13 @@ async def rpc_by_name(
556564 extra_query : Query | None = None ,
557565 extra_body : Body | None = None ,
558566 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
559- ) -> object :
567+ ) -> AgentRpcResponse :
560568 """
561569 Handle JSON-RPC requests for an agent by its unique name.
562570
563571 Args:
572+ params: The parameters for the agent RPC request
573+
564574 extra_headers: Send extra headers
565575
566576 extra_query: Add additional query parameters to the request
@@ -585,7 +595,7 @@ async def rpc_by_name(
585595 options = make_request_options (
586596 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
587597 ),
588- cast_to = object ,
598+ cast_to = AgentRpcResponse ,
589599 )
590600
591601
0 commit comments