Skip to content

Commit f23bae3

Browse files
committed
Refactor and enhance API functionality across multiple modules
This commit introduces significant improvements and refactoring across various API modules, including: - **Agent API Enhancements**: Improved functionality in agent selection, execution, and metadata retrieval. - **Auth API Updates**: Streamlined user authentication processes, including password strength checks and session management. - **Backup and Billing API Improvements**: Enhanced backup creation and retrieval processes, along with updates to billing session management. - **Subgraph Management**: Refined subgraph operations, including creation, deletion, and information retrieval. - **Model Updates**: Various model definitions have been updated for consistency and clarity. These changes aim to improve overall API performance, usability, and maintainability without introducing breaking changes.
1 parent 0ce1178 commit f23bae3

352 files changed

Lines changed: 7565 additions & 3273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎robosystems_client/api/agent/auto_select_agent.py‎

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union, cast
2+
from typing import Any, cast
33

44
import 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

5151
def _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

9191
def _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 (

‎robosystems_client/api/agent/batch_process_queries.py‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from http import HTTPStatus
2-
from typing import Any, Optional, Union, cast
2+
from typing import Any, cast
33

44
import httpx
55

@@ -32,8 +32,8 @@ def _get_kwargs(
3232

3333

3434
def _parse_response(
35-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
36-
) -> Optional[Union[Any, BatchAgentResponse, HTTPValidationError]]:
35+
*, client: AuthenticatedClient | Client, response: httpx.Response
36+
) -> Any | BatchAgentResponse | HTTPValidationError | None:
3737
if response.status_code == 200:
3838
response_200 = BatchAgentResponse.from_dict(response.json())
3939

@@ -63,8 +63,8 @@ def _parse_response(
6363

6464

6565
def _build_response(
66-
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
67-
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
66+
*, client: AuthenticatedClient | Client, response: httpx.Response
67+
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
6868
return Response(
6969
status_code=HTTPStatus(response.status_code),
7070
content=response.content,
@@ -78,7 +78,7 @@ def sync_detailed(
7878
*,
7979
client: AuthenticatedClient,
8080
body: BatchAgentRequest,
81-
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
81+
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
8282
"""Batch process multiple queries
8383
8484
Process multiple queries either sequentially or in parallel.
@@ -105,7 +105,7 @@ def sync_detailed(
105105
httpx.TimeoutException: If the request takes longer than Client.timeout.
106106
107107
Returns:
108-
Response[Union[Any, BatchAgentResponse, HTTPValidationError]]
108+
Response[Any | BatchAgentResponse | HTTPValidationError]
109109
"""
110110

111111
kwargs = _get_kwargs(
@@ -125,7 +125,7 @@ def sync(
125125
*,
126126
client: AuthenticatedClient,
127127
body: BatchAgentRequest,
128-
) -> Optional[Union[Any, BatchAgentResponse, HTTPValidationError]]:
128+
) -> Any | BatchAgentResponse | HTTPValidationError | None:
129129
"""Batch process multiple queries
130130
131131
Process multiple queries either sequentially or in parallel.
@@ -152,7 +152,7 @@ def sync(
152152
httpx.TimeoutException: If the request takes longer than Client.timeout.
153153
154154
Returns:
155-
Union[Any, BatchAgentResponse, HTTPValidationError]
155+
Any | BatchAgentResponse | HTTPValidationError
156156
"""
157157

158158
return sync_detailed(
@@ -167,7 +167,7 @@ async def asyncio_detailed(
167167
*,
168168
client: AuthenticatedClient,
169169
body: BatchAgentRequest,
170-
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
170+
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
171171
"""Batch process multiple queries
172172
173173
Process multiple queries either sequentially or in parallel.
@@ -194,7 +194,7 @@ async def asyncio_detailed(
194194
httpx.TimeoutException: If the request takes longer than Client.timeout.
195195
196196
Returns:
197-
Response[Union[Any, BatchAgentResponse, HTTPValidationError]]
197+
Response[Any | BatchAgentResponse | HTTPValidationError]
198198
"""
199199

200200
kwargs = _get_kwargs(
@@ -212,7 +212,7 @@ async def asyncio(
212212
*,
213213
client: AuthenticatedClient,
214214
body: BatchAgentRequest,
215-
) -> Optional[Union[Any, BatchAgentResponse, HTTPValidationError]]:
215+
) -> Any | BatchAgentResponse | HTTPValidationError | None:
216216
"""Batch process multiple queries
217217
218218
Process multiple queries either sequentially or in parallel.
@@ -239,7 +239,7 @@ async def asyncio(
239239
httpx.TimeoutException: If the request takes longer than Client.timeout.
240240
241241
Returns:
242-
Union[Any, BatchAgentResponse, HTTPValidationError]
242+
Any | BatchAgentResponse | HTTPValidationError
243243
"""
244244

245245
return (

0 commit comments

Comments
 (0)