11from http import HTTPStatus
2- from typing import Any , Optional , Union , cast
2+ from typing import Any , cast
33
44import httpx
55
@@ -17,13 +17,13 @@ def _get_kwargs(
1717 graph_id : str ,
1818 * ,
1919 body : AgentRequest ,
20- mode : Union [ None , ResponseMode , Unset ] = UNSET ,
20+ mode : None | ResponseMode | Unset = UNSET ,
2121) -> dict [str , Any ]:
2222 headers : dict [str , Any ] = {}
2323
2424 params : dict [str , Any ] = {}
2525
26- json_mode : Union [ None , Unset , str ]
26+ json_mode : None | str | Unset
2727 if isinstance (mode , Unset ):
2828 json_mode = UNSET
2929 elif isinstance (mode , ResponseMode ):
@@ -49,8 +49,8 @@ def _get_kwargs(
4949
5050
5151def _parse_response (
52- * , client : Union [ AuthenticatedClient , Client ] , response : httpx .Response
53- ) -> Optional [ Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ]] :
52+ * , client : AuthenticatedClient | Client , response : httpx .Response
53+ ) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None :
5454 if response .status_code == 200 :
5555 response_200 = AgentResponse .from_dict (response .json ())
5656
@@ -89,8 +89,8 @@ def _parse_response(
8989
9090
9191def _build_response (
92- * , client : Union [ AuthenticatedClient , Client ] , response : httpx .Response
93- ) -> Response [Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ] ]:
92+ * , client : AuthenticatedClient | Client , response : httpx .Response
93+ ) -> Response [AgentResponse | Any | ErrorResponse | HTTPValidationError ]:
9494 return Response (
9595 status_code = HTTPStatus (response .status_code ),
9696 content = response .content ,
@@ -104,8 +104,8 @@ def sync_detailed(
104104 * ,
105105 client : AuthenticatedClient ,
106106 body : AgentRequest ,
107- mode : Union [ None , ResponseMode , Unset ] = UNSET ,
108- ) -> Response [Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ] ]:
107+ mode : None | ResponseMode | Unset = UNSET ,
108+ ) -> Response [AgentResponse | Any | ErrorResponse | HTTPValidationError ]:
109109 r"""Auto-select agent for query
110110
111111 Automatically select the best agent for your query with intelligent execution strategy.
@@ -169,16 +169,15 @@ def sync_detailed(
169169
170170 Args:
171171 graph_id (str):
172- mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
173- auto
172+ mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
174173 body (AgentRequest): Request model for agent interactions.
175174
176175 Raises:
177176 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
178177 httpx.TimeoutException: If the request takes longer than Client.timeout.
179178
180179 Returns:
181- Response[Union[ AgentResponse, Any, ErrorResponse, HTTPValidationError] ]
180+ Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]
182181 """
183182
184183 kwargs = _get_kwargs (
@@ -199,8 +198,8 @@ def sync(
199198 * ,
200199 client : AuthenticatedClient ,
201200 body : AgentRequest ,
202- mode : Union [ None , ResponseMode , Unset ] = UNSET ,
203- ) -> Optional [ Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ]] :
201+ mode : None | ResponseMode | Unset = UNSET ,
202+ ) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None :
204203 r"""Auto-select agent for query
205204
206205 Automatically select the best agent for your query with intelligent execution strategy.
@@ -264,16 +263,15 @@ def sync(
264263
265264 Args:
266265 graph_id (str):
267- mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
268- auto
266+ mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
269267 body (AgentRequest): Request model for agent interactions.
270268
271269 Raises:
272270 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
273271 httpx.TimeoutException: If the request takes longer than Client.timeout.
274272
275273 Returns:
276- Union[ AgentResponse, Any, ErrorResponse, HTTPValidationError]
274+ AgentResponse | Any | ErrorResponse | HTTPValidationError
277275 """
278276
279277 return sync_detailed (
@@ -289,8 +287,8 @@ async def asyncio_detailed(
289287 * ,
290288 client : AuthenticatedClient ,
291289 body : AgentRequest ,
292- mode : Union [ None , ResponseMode , Unset ] = UNSET ,
293- ) -> Response [Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ] ]:
290+ mode : None | ResponseMode | Unset = UNSET ,
291+ ) -> Response [AgentResponse | Any | ErrorResponse | HTTPValidationError ]:
294292 r"""Auto-select agent for query
295293
296294 Automatically select the best agent for your query with intelligent execution strategy.
@@ -354,16 +352,15 @@ async def asyncio_detailed(
354352
355353 Args:
356354 graph_id (str):
357- mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
358- auto
355+ mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
359356 body (AgentRequest): Request model for agent interactions.
360357
361358 Raises:
362359 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
363360 httpx.TimeoutException: If the request takes longer than Client.timeout.
364361
365362 Returns:
366- Response[Union[ AgentResponse, Any, ErrorResponse, HTTPValidationError] ]
363+ Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]
367364 """
368365
369366 kwargs = _get_kwargs (
@@ -382,8 +379,8 @@ async def asyncio(
382379 * ,
383380 client : AuthenticatedClient ,
384381 body : AgentRequest ,
385- mode : Union [ None , ResponseMode , Unset ] = UNSET ,
386- ) -> Optional [ Union [ AgentResponse , Any , ErrorResponse , HTTPValidationError ]] :
382+ mode : None | ResponseMode | Unset = UNSET ,
383+ ) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None :
387384 r"""Auto-select agent for query
388385
389386 Automatically select the best agent for your query with intelligent execution strategy.
@@ -447,16 +444,15 @@ async def asyncio(
447444
448445 Args:
449446 graph_id (str):
450- mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
451- auto
447+ mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
452448 body (AgentRequest): Request model for agent interactions.
453449
454450 Raises:
455451 errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
456452 httpx.TimeoutException: If the request takes longer than Client.timeout.
457453
458454 Returns:
459- Union[ AgentResponse, Any, ErrorResponse, HTTPValidationError]
455+ AgentResponse | Any | ErrorResponse | HTTPValidationError
460456 """
461457
462458 return (
0 commit comments