Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
50 changes: 23 additions & 27 deletions robosystems_client/api/agent/auto_select_agent.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union, cast
from typing import Any, cast

import httpx

Expand All @@ -17,13 +17,13 @@ def _get_kwargs(
graph_id: str,
*,
body: AgentRequest,
mode: Union[None, ResponseMode, Unset] = UNSET,
mode: None | ResponseMode | Unset = UNSET,
) -> dict[str, Any]:
headers: dict[str, Any] = {}

params: dict[str, Any] = {}

json_mode: Union[None, Unset, str]
json_mode: None | str | Unset
if isinstance(mode, Unset):
json_mode = UNSET
elif isinstance(mode, ResponseMode):
Expand All @@ -49,8 +49,8 @@ def _get_kwargs(


def _parse_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Optional[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None:
if response.status_code == 200:
response_200 = AgentResponse.from_dict(response.json())

Expand Down Expand Up @@ -89,8 +89,8 @@ def _parse_response(


def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -104,8 +104,8 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: AgentRequest,
mode: Union[None, ResponseMode, Unset] = UNSET,
) -> Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
mode: None | ResponseMode | Unset = UNSET,
) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]:
r"""Auto-select agent for query

Automatically select the best agent for your query with intelligent execution strategy.
Expand Down Expand Up @@ -169,16 +169,15 @@ def sync_detailed(

Args:
graph_id (str):
mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
auto
mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
body (AgentRequest): Request model for agent interactions.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]
Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(
Expand All @@ -199,8 +198,8 @@ def sync(
*,
client: AuthenticatedClient,
body: AgentRequest,
mode: Union[None, ResponseMode, Unset] = UNSET,
) -> Optional[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
mode: None | ResponseMode | Unset = UNSET,
) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None:
r"""Auto-select agent for query

Automatically select the best agent for your query with intelligent execution strategy.
Expand Down Expand Up @@ -264,16 +263,15 @@ def sync(

Args:
graph_id (str):
mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
auto
mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
body (AgentRequest): Request model for agent interactions.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]
AgentResponse | Any | ErrorResponse | HTTPValidationError
"""

return sync_detailed(
Expand All @@ -289,8 +287,8 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: AgentRequest,
mode: Union[None, ResponseMode, Unset] = UNSET,
) -> Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
mode: None | ResponseMode | Unset = UNSET,
) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]:
r"""Auto-select agent for query

Automatically select the best agent for your query with intelligent execution strategy.
Expand Down Expand Up @@ -354,16 +352,15 @@ async def asyncio_detailed(

Args:
graph_id (str):
mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
auto
mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
body (AgentRequest): Request model for agent interactions.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]
Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(
Expand All @@ -382,8 +379,8 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: AgentRequest,
mode: Union[None, ResponseMode, Unset] = UNSET,
) -> Optional[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
mode: None | ResponseMode | Unset = UNSET,
) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None:
r"""Auto-select agent for query

Automatically select the best agent for your query with intelligent execution strategy.
Expand Down Expand Up @@ -447,16 +444,15 @@ async def asyncio(

Args:
graph_id (str):
mode (Union[None, ResponseMode, Unset]): Override execution mode: sync, async, stream, or
auto
mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto
body (AgentRequest): Request model for agent interactions.

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]
AgentResponse | Any | ErrorResponse | HTTPValidationError
"""

return (
Expand Down
26 changes: 13 additions & 13 deletions robosystems_client/api/agent/batch_process_queries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from http import HTTPStatus
from typing import Any, Optional, Union, cast
from typing import Any, cast

import httpx

Expand Down Expand Up @@ -32,8 +32,8 @@ def _get_kwargs(


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

Expand Down Expand Up @@ -63,8 +63,8 @@ def _parse_response(


def _build_response(
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
*, client: AuthenticatedClient | Client, response: httpx.Response
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
return Response(
status_code=HTTPStatus(response.status_code),
content=response.content,
Expand All @@ -78,7 +78,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
body: BatchAgentRequest,
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
"""Batch process multiple queries

Process multiple queries either sequentially or in parallel.
Expand All @@ -105,7 +105,7 @@ def sync_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, BatchAgentResponse, HTTPValidationError]]
Response[Any | BatchAgentResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(
Expand All @@ -125,7 +125,7 @@ def sync(
*,
client: AuthenticatedClient,
body: BatchAgentRequest,
) -> Optional[Union[Any, BatchAgentResponse, HTTPValidationError]]:
) -> Any | BatchAgentResponse | HTTPValidationError | None:
"""Batch process multiple queries

Process multiple queries either sequentially or in parallel.
Expand All @@ -152,7 +152,7 @@ def sync(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, BatchAgentResponse, HTTPValidationError]
Any | BatchAgentResponse | HTTPValidationError
"""

return sync_detailed(
Expand All @@ -167,7 +167,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
body: BatchAgentRequest,
) -> Response[Union[Any, BatchAgentResponse, HTTPValidationError]]:
) -> Response[Any | BatchAgentResponse | HTTPValidationError]:
"""Batch process multiple queries

Process multiple queries either sequentially or in parallel.
Expand All @@ -194,7 +194,7 @@ async def asyncio_detailed(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Response[Union[Any, BatchAgentResponse, HTTPValidationError]]
Response[Any | BatchAgentResponse | HTTPValidationError]
"""

kwargs = _get_kwargs(
Expand All @@ -212,7 +212,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
body: BatchAgentRequest,
) -> Optional[Union[Any, BatchAgentResponse, HTTPValidationError]]:
) -> Any | BatchAgentResponse | HTTPValidationError | None:
"""Batch process multiple queries

Process multiple queries either sequentially or in parallel.
Expand All @@ -239,7 +239,7 @@ async def asyncio(
httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:
Union[Any, BatchAgentResponse, HTTPValidationError]
Any | BatchAgentResponse | HTTPValidationError
"""

return (
Expand Down
Loading