From f83921d07b9523439f88f385775ca4cb776db375 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Sun, 17 May 2026 18:30:01 -0500 Subject: [PATCH] Add operator-related models and client functionality - Implemented OperatorRecommendationRequestContextType0 model for handling recommendation request context. - Created OperatorRecommendationResponse model to encapsulate operator recommendations and query details. - Developed OperatorRequest model for managing operator requests with various attributes including message, history, context, and selection criteria. - Introduced OperatorResponse model to represent responses from operator interactions, including content, metadata, and execution details. - Added error handling with OperatorResponseErrorDetailsType0 and metadata with OperatorResponseMetadataType0. - Implemented token usage tracking with OperatorResponseTokensUsedType0. - Updated SelectionCriteria model to reflect operator selection criteria, including capabilities and preferred modes. - Created comprehensive unit tests for OperatorClient and its associated dataclasses to ensure functionality and reliability. --- .../op_auto_map_elements.py | 16 +- .../op_create_mapping_association.py | 8 +- .../api/{agent => operator}/__init__.py | 0 .../auto_select_operator.py} | 70 ++--- .../batch_process_queries.py | 46 ++-- .../execute_specific_operator.py} | 82 +++--- .../get_operator_metadata.py} | 62 ++--- .../list_operators.py} | 34 +-- .../recommend_operator.py} | 70 ++--- robosystems_client/clients/__init__.py | 38 +-- robosystems_client/clients/facade.py | 6 +- .../{agent_client.py => operator_client.py} | 246 +++++++++--------- robosystems_client/models/__init__.py | 80 +++--- .../models/auto_map_elements_operation.py | 4 +- ...t_request.py => batch_operator_request.py} | 20 +- ...response.py => batch_operator_response.py} | 20 +- .../create_mapping_association_operation.py | 2 +- .../models/create_report_request.py | 6 +- ..._response.py => operator_list_response.py} | 30 +-- ...py => operator_list_response_operators.py} | 28 +- ...response_operators_additional_property.py} | 10 +- .../{agent_message.py => operator_message.py} | 10 +- ...ponse.py => operator_metadata_response.py} | 26 +- .../{agent_mode.py => operator_mode.py} | 2 +- ...endation.py => operator_recommendation.py} | 38 +-- ....py => operator_recommendation_request.py} | 36 +-- ..._recommendation_request_context_type_0.py} | 10 +- ...py => operator_recommendation_response.py} | 22 +- .../{agent_request.py => operator_request.py} | 80 +++--- ....py => operator_request_context_type_0.py} | 10 +- ...agent_response.py => operator_response.py} | 102 ++++---- ...operator_response_error_details_type_0.py} | 10 +- ...y => operator_response_metadata_type_0.py} | 10 +- ...> operator_response_tokens_used_type_0.py} | 10 +- .../models/selection_criteria.py | 36 +-- ...gent_client.py => test_operator_client.py} | 228 ++++++++-------- 36 files changed, 764 insertions(+), 744 deletions(-) rename robosystems_client/api/{agent => operator}/__init__.py (100%) rename robosystems_client/api/{agent/auto_select_agent.py => operator/auto_select_operator.py} (71%) rename robosystems_client/api/{agent => operator}/batch_process_queries.py (75%) rename robosystems_client/api/{agent/execute_specific_agent.py => operator/execute_specific_operator.py} (75%) rename robosystems_client/api/{agent/get_agent_metadata.py => operator/get_operator_metadata.py} (68%) rename robosystems_client/api/{agent/list_agents.py => operator/list_operators.py} (83%) rename robosystems_client/api/{agent/recommend_agent.py => operator/recommend_operator.py} (63%) rename robosystems_client/clients/{agent_client.py => operator_client.py} (66%) rename robosystems_client/models/{batch_agent_request.py => batch_operator_request.py} (78%) rename robosystems_client/models/{batch_agent_response.py => batch_operator_response.py} (80%) rename robosystems_client/models/{agent_list_response.py => operator_list_response.py} (61%) rename robosystems_client/models/{agent_list_response_agents.py => operator_list_response_operators.py} (56%) rename robosystems_client/models/{agent_recommendation_request_context_type_0.py => operator_list_response_operators_additional_property.py} (74%) rename robosystems_client/models/{agent_message.py => operator_message.py} (93%) rename robosystems_client/models/{agent_metadata_response.py => operator_metadata_response.py} (83%) rename robosystems_client/models/{agent_mode.py => operator_mode.py} (84%) rename robosystems_client/models/{agent_recommendation.py => operator_recommendation.py} (73%) rename robosystems_client/models/{agent_recommendation_request.py => operator_recommendation_request.py} (63%) rename robosystems_client/models/{agent_list_response_agents_additional_property.py => operator_recommendation_request_context_type_0.py} (77%) rename robosystems_client/models/{agent_recommendation_response.py => operator_recommendation_response.py} (71%) rename robosystems_client/models/{agent_request.py => operator_request.py} (71%) rename robosystems_client/models/{agent_request_context_type_0.py => operator_request_context_type_0.py} (81%) rename robosystems_client/models/{agent_response.py => operator_response.py} (68%) rename robosystems_client/models/{agent_response_error_details_type_0.py => operator_response_error_details_type_0.py} (78%) rename robosystems_client/models/{agent_response_metadata_type_0.py => operator_response_metadata_type_0.py} (80%) rename robosystems_client/models/{agent_response_tokens_used_type_0.py => operator_response_tokens_used_type_0.py} (79%) rename tests/{test_agent_client.py => test_operator_client.py} (51%) diff --git a/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py b/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py index 5173e38..178aebd 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py +++ b/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py @@ -121,9 +121,9 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + body (AutoMapElementsOperation): Run the MappingOperator over a mapping structure (async). - The MappingAgent walks every unmapped CoA element and proposes + The MappingOperator walks every unmapped CoA element and proposes associations to reporting concepts. Confidence thresholds: ≥0.90 auto-approved (association created), 0.70-0.89 flagged for review (created with `confidence` set; surface it in your UI), <0.70 skipped. @@ -170,9 +170,9 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + body (AutoMapElementsOperation): Run the MappingOperator over a mapping structure (async). - The MappingAgent walks every unmapped CoA element and proposes + The MappingOperator walks every unmapped CoA element and proposes associations to reporting concepts. Confidence thresholds: ≥0.90 auto-approved (association created), 0.70-0.89 flagged for review (created with `confidence` set; surface it in your UI), <0.70 skipped. @@ -214,9 +214,9 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + body (AutoMapElementsOperation): Run the MappingOperator over a mapping structure (async). - The MappingAgent walks every unmapped CoA element and proposes + The MappingOperator walks every unmapped CoA element and proposes associations to reporting concepts. Confidence thresholds: ≥0.90 auto-approved (association created), 0.70-0.89 flagged for review (created with `confidence` set; surface it in your UI), <0.70 skipped. @@ -261,9 +261,9 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + body (AutoMapElementsOperation): Run the MappingOperator over a mapping structure (async). - The MappingAgent walks every unmapped CoA element and proposes + The MappingOperator walks every unmapped CoA element and proposes associations to reporting concepts. Confidence thresholds: ≥0.90 auto-approved (association created), 0.70-0.89 flagged for review (created with `confidence` set; surface it in your UI), <0.70 skipped. diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py b/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py index 5a1a3fe..7d69c30 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py @@ -128,7 +128,7 @@ def sync_detailed( This is the iterative, AI-assisted craft path. Each call adds a single association to the target mapping structure. Use `auto-map-elements` - to create many at once via the MappingAgent. Reject duplicates: if + to create many at once via the MappingOperator. Reject duplicates: if the (from, to, type) tuple already exists, the call returns 409. Raises: @@ -174,7 +174,7 @@ def sync( This is the iterative, AI-assisted craft path. Each call adds a single association to the target mapping structure. Use `auto-map-elements` - to create many at once via the MappingAgent. Reject duplicates: if + to create many at once via the MappingOperator. Reject duplicates: if the (from, to, type) tuple already exists, the call returns 409. Raises: @@ -215,7 +215,7 @@ async def asyncio_detailed( This is the iterative, AI-assisted craft path. Each call adds a single association to the target mapping structure. Use `auto-map-elements` - to create many at once via the MappingAgent. Reject duplicates: if + to create many at once via the MappingOperator. Reject duplicates: if the (from, to, type) tuple already exists, the call returns 409. Raises: @@ -259,7 +259,7 @@ async def asyncio( This is the iterative, AI-assisted craft path. Each call adds a single association to the target mapping structure. Use `auto-map-elements` - to create many at once via the MappingAgent. Reject duplicates: if + to create many at once via the MappingOperator. Reject duplicates: if the (from, to, type) tuple already exists, the call returns 409. Raises: diff --git a/robosystems_client/api/agent/__init__.py b/robosystems_client/api/operator/__init__.py similarity index 100% rename from robosystems_client/api/agent/__init__.py rename to robosystems_client/api/operator/__init__.py diff --git a/robosystems_client/api/agent/auto_select_agent.py b/robosystems_client/api/operator/auto_select_operator.py similarity index 71% rename from robosystems_client/api/agent/auto_select_agent.py rename to robosystems_client/api/operator/auto_select_operator.py index 1e170d5..6082e32 100644 --- a/robosystems_client/api/agent/auto_select_agent.py +++ b/robosystems_client/api/operator/auto_select_operator.py @@ -6,10 +6,10 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_request import AgentRequest -from ...models.agent_response import AgentResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError +from ...models.operator_request import OperatorRequest +from ...models.operator_response import OperatorResponse from ...models.response_mode import ResponseMode from ...types import UNSET, Response, Unset @@ -17,7 +17,7 @@ def _get_kwargs( graph_id: str, *, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -37,7 +37,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/graphs/{graph_id}/agent".format( + "url": "/v1/graphs/{graph_id}/operator".format( graph_id=quote(str(graph_id), safe=""), ), "params": params, @@ -53,9 +53,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: if response.status_code == 200: - response_200 = AgentResponse.from_dict(response.json()) + response_200 = OperatorResponse.from_dict(response.json()) return response_200 @@ -110,7 +110,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -123,27 +123,27 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: - """Auto-select Agent for Query +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: + """Auto-select Operator for Query - Routes to the best agent for your query. Agents: `financial` (SEC, accounting), `research` (deep - analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, + Routes to the best operator for your query. Operators: `financial` (SEC, accounting), `research` + (deep analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, `extended` 30-75. Execution strategy (sync/SSE/async) auto-selected; override with `?mode=sync|async`. Args: graph_id (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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[AgentResponse | Any | ErrorResponse | HTTPValidationError] + Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse] """ kwargs = _get_kwargs( @@ -163,27 +163,27 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: - """Auto-select Agent for Query +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: + """Auto-select Operator for Query - Routes to the best agent for your query. Agents: `financial` (SEC, accounting), `research` (deep - analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, + Routes to the best operator for your query. Operators: `financial` (SEC, accounting), `research` + (deep analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, `extended` 30-75. Execution strategy (sync/SSE/async) auto-selected; override with `?mode=sync|async`. Args: graph_id (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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: - AgentResponse | Any | ErrorResponse | HTTPValidationError + Any | ErrorResponse | HTTPValidationError | OperatorResponse """ return sync_detailed( @@ -198,27 +198,27 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: - """Auto-select Agent for Query +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: + """Auto-select Operator for Query - Routes to the best agent for your query. Agents: `financial` (SEC, accounting), `research` (deep - analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, + Routes to the best operator for your query. Operators: `financial` (SEC, accounting), `research` + (deep analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, `extended` 30-75. Execution strategy (sync/SSE/async) auto-selected; override with `?mode=sync|async`. Args: graph_id (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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[AgentResponse | Any | ErrorResponse | HTTPValidationError] + Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse] """ kwargs = _get_kwargs( @@ -236,27 +236,27 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: - """Auto-select Agent for Query +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: + """Auto-select Operator for Query - Routes to the best agent for your query. Agents: `financial` (SEC, accounting), `research` (deep - analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, + Routes to the best operator for your query. Operators: `financial` (SEC, accounting), `research` + (deep analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, `extended` 30-75. Execution strategy (sync/SSE/async) auto-selected; override with `?mode=sync|async`. Args: graph_id (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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: - AgentResponse | Any | ErrorResponse | HTTPValidationError + Any | ErrorResponse | HTTPValidationError | OperatorResponse """ return ( diff --git a/robosystems_client/api/agent/batch_process_queries.py b/robosystems_client/api/operator/batch_process_queries.py similarity index 75% rename from robosystems_client/api/agent/batch_process_queries.py rename to robosystems_client/api/operator/batch_process_queries.py index 11ebc58..580e9a4 100644 --- a/robosystems_client/api/agent/batch_process_queries.py +++ b/robosystems_client/api/operator/batch_process_queries.py @@ -6,8 +6,8 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.batch_agent_request import BatchAgentRequest -from ...models.batch_agent_response import BatchAgentResponse +from ...models.batch_operator_request import BatchOperatorRequest +from ...models.batch_operator_response import BatchOperatorResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError from ...types import Response @@ -16,13 +16,13 @@ def _get_kwargs( graph_id: str, *, - body: BatchAgentRequest, + body: BatchOperatorRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/graphs/{graph_id}/agent/batch".format( + "url": "/v1/graphs/{graph_id}/operator/batch".format( graph_id=quote(str(graph_id), safe=""), ), } @@ -37,9 +37,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | BatchAgentResponse | ErrorResponse | HTTPValidationError | None: +) -> Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError | None: if response.status_code == 200: - response_200 = BatchAgentResponse.from_dict(response.json()) + response_200 = BatchOperatorResponse.from_dict(response.json()) return response_200 @@ -90,7 +90,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | BatchAgentResponse | ErrorResponse | HTTPValidationError]: +) -> Response[Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,8 +103,8 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: BatchAgentRequest, -) -> Response[Any | BatchAgentResponse | ErrorResponse | HTTPValidationError]: + body: BatchOperatorRequest, +) -> Response[Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError]: """Batch Process Queries Process up to 10 queries sequentially or in parallel. Partial failure is supported — each result has @@ -112,14 +112,14 @@ def sync_detailed( Args: graph_id (str): - body (BatchAgentRequest): Request for batch processing multiple queries. + body (BatchOperatorRequest): Request for batch processing multiple queries. 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[Any | BatchAgentResponse | ErrorResponse | HTTPValidationError] + Response[Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError] """ kwargs = _get_kwargs( @@ -138,8 +138,8 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: BatchAgentRequest, -) -> Any | BatchAgentResponse | ErrorResponse | HTTPValidationError | None: + body: BatchOperatorRequest, +) -> Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError | None: """Batch Process Queries Process up to 10 queries sequentially or in parallel. Partial failure is supported — each result has @@ -147,14 +147,14 @@ def sync( Args: graph_id (str): - body (BatchAgentRequest): Request for batch processing multiple queries. + body (BatchOperatorRequest): Request for batch processing multiple queries. 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: - Any | BatchAgentResponse | ErrorResponse | HTTPValidationError + Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError """ return sync_detailed( @@ -168,8 +168,8 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: BatchAgentRequest, -) -> Response[Any | BatchAgentResponse | ErrorResponse | HTTPValidationError]: + body: BatchOperatorRequest, +) -> Response[Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError]: """Batch Process Queries Process up to 10 queries sequentially or in parallel. Partial failure is supported — each result has @@ -177,14 +177,14 @@ async def asyncio_detailed( Args: graph_id (str): - body (BatchAgentRequest): Request for batch processing multiple queries. + body (BatchOperatorRequest): Request for batch processing multiple queries. 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[Any | BatchAgentResponse | ErrorResponse | HTTPValidationError] + Response[Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError] """ kwargs = _get_kwargs( @@ -201,8 +201,8 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: BatchAgentRequest, -) -> Any | BatchAgentResponse | ErrorResponse | HTTPValidationError | None: + body: BatchOperatorRequest, +) -> Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError | None: """Batch Process Queries Process up to 10 queries sequentially or in parallel. Partial failure is supported — each result has @@ -210,14 +210,14 @@ async def asyncio( Args: graph_id (str): - body (BatchAgentRequest): Request for batch processing multiple queries. + body (BatchOperatorRequest): Request for batch processing multiple queries. 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: - Any | BatchAgentResponse | ErrorResponse | HTTPValidationError + Any | BatchOperatorResponse | ErrorResponse | HTTPValidationError """ return ( diff --git a/robosystems_client/api/agent/execute_specific_agent.py b/robosystems_client/api/operator/execute_specific_operator.py similarity index 75% rename from robosystems_client/api/agent/execute_specific_agent.py rename to robosystems_client/api/operator/execute_specific_operator.py index b038f6f..e533e6c 100644 --- a/robosystems_client/api/agent/execute_specific_agent.py +++ b/robosystems_client/api/operator/execute_specific_operator.py @@ -6,19 +6,19 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_request import AgentRequest -from ...models.agent_response import AgentResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError +from ...models.operator_request import OperatorRequest +from ...models.operator_response import OperatorResponse from ...models.response_mode import ResponseMode from ...types import UNSET, Response, Unset def _get_kwargs( graph_id: str, - agent_type: str, + operator_type: str, *, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -38,9 +38,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/graphs/{graph_id}/agent/{agent_type}".format( + "url": "/v1/graphs/{graph_id}/operator/{operator_type}".format( graph_id=quote(str(graph_id), safe=""), - agent_type=quote(str(agent_type), safe=""), + operator_type=quote(str(operator_type), safe=""), ), "params": params, } @@ -55,9 +55,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: if response.status_code == 200: - response_200 = AgentResponse.from_dict(response.json()) + response_200 = OperatorResponse.from_dict(response.json()) return response_200 @@ -112,7 +112,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -123,34 +123,34 @@ def _build_response( def sync_detailed( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: - """Execute Specific Agent +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: + """Execute Specific Operator Available: `financial` (SEC filings, accounting), `research` (deep analysis), `rag` (retrieval, no credits). Execution strategy auto-selected; override with `?mode=sync|async`. Args: graph_id (str): - agent_type (str): + operator_type (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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[AgentResponse | Any | ErrorResponse | HTTPValidationError] + Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse] """ kwargs = _get_kwargs( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, body=body, mode=mode, ) @@ -164,34 +164,34 @@ def sync_detailed( def sync( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: - """Execute Specific Agent +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: + """Execute Specific Operator Available: `financial` (SEC filings, accounting), `research` (deep analysis), `rag` (retrieval, no credits). Execution strategy auto-selected; override with `?mode=sync|async`. Args: graph_id (str): - agent_type (str): + operator_type (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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: - AgentResponse | Any | ErrorResponse | HTTPValidationError + Any | ErrorResponse | HTTPValidationError | OperatorResponse """ return sync_detailed( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, client=client, body=body, mode=mode, @@ -200,34 +200,34 @@ def sync( async def asyncio_detailed( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> Response[AgentResponse | Any | ErrorResponse | HTTPValidationError]: - """Execute Specific Agent +) -> Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse]: + """Execute Specific Operator Available: `financial` (SEC filings, accounting), `research` (deep analysis), `rag` (retrieval, no credits). Execution strategy auto-selected; override with `?mode=sync|async`. Args: graph_id (str): - agent_type (str): + operator_type (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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[AgentResponse | Any | ErrorResponse | HTTPValidationError] + Response[Any | ErrorResponse | HTTPValidationError | OperatorResponse] """ kwargs = _get_kwargs( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, body=body, mode=mode, ) @@ -239,35 +239,35 @@ async def asyncio_detailed( async def asyncio( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, - body: AgentRequest, + body: OperatorRequest, mode: None | ResponseMode | Unset = UNSET, -) -> AgentResponse | Any | ErrorResponse | HTTPValidationError | None: - """Execute Specific Agent +) -> Any | ErrorResponse | HTTPValidationError | OperatorResponse | None: + """Execute Specific Operator Available: `financial` (SEC filings, accounting), `research` (deep analysis), `rag` (retrieval, no credits). Execution strategy auto-selected; override with `?mode=sync|async`. Args: graph_id (str): - agent_type (str): + operator_type (str): mode (None | ResponseMode | Unset): Override execution mode: sync, async, stream, or auto - body (AgentRequest): Request model for agent interactions. + body (OperatorRequest): Request model for operator 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: - AgentResponse | Any | ErrorResponse | HTTPValidationError + Any | ErrorResponse | HTTPValidationError | OperatorResponse """ return ( await asyncio_detailed( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, client=client, body=body, mode=mode, diff --git a/robosystems_client/api/agent/get_agent_metadata.py b/robosystems_client/api/operator/get_operator_metadata.py similarity index 68% rename from robosystems_client/api/agent/get_agent_metadata.py rename to robosystems_client/api/operator/get_operator_metadata.py index 233463a..6e14d44 100644 --- a/robosystems_client/api/agent/get_agent_metadata.py +++ b/robosystems_client/api/operator/get_operator_metadata.py @@ -6,22 +6,22 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_metadata_response import AgentMetadataResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError +from ...models.operator_metadata_response import OperatorMetadataResponse from ...types import Response def _get_kwargs( graph_id: str, - agent_type: str, + operator_type: str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/graphs/{graph_id}/agent/{agent_type}".format( + "url": "/v1/graphs/{graph_id}/operator/{operator_type}".format( graph_id=quote(str(graph_id), safe=""), - agent_type=quote(str(agent_type), safe=""), + operator_type=quote(str(operator_type), safe=""), ), } @@ -30,9 +30,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentMetadataResponse | ErrorResponse | HTTPValidationError | None: +) -> ErrorResponse | HTTPValidationError | OperatorMetadataResponse | None: if response.status_code == 200: - response_200 = AgentMetadataResponse.from_dict(response.json()) + response_200 = OperatorMetadataResponse.from_dict(response.json()) return response_200 @@ -79,7 +79,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentMetadataResponse | ErrorResponse | HTTPValidationError]: +) -> Response[ErrorResponse | HTTPValidationError | OperatorMetadataResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -90,27 +90,27 @@ def _build_response( def sync_detailed( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, -) -> Response[AgentMetadataResponse | ErrorResponse | HTTPValidationError]: - """Get Agent Metadata +) -> Response[ErrorResponse | HTTPValidationError | OperatorMetadataResponse]: + """Get Operator Metadata Args: graph_id (str): - agent_type (str): Agent type identifier (e.g., 'financial', 'research', 'rag') + operator_type (str): Operator type identifier (e.g., 'financial', 'research', 'rag') 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[AgentMetadataResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorMetadataResponse] """ kwargs = _get_kwargs( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, ) response = client.get_httpx_client().request( @@ -122,54 +122,54 @@ def sync_detailed( def sync( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, -) -> AgentMetadataResponse | ErrorResponse | HTTPValidationError | None: - """Get Agent Metadata +) -> ErrorResponse | HTTPValidationError | OperatorMetadataResponse | None: + """Get Operator Metadata Args: graph_id (str): - agent_type (str): Agent type identifier (e.g., 'financial', 'research', 'rag') + operator_type (str): Operator type identifier (e.g., 'financial', 'research', 'rag') 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: - AgentMetadataResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorMetadataResponse """ return sync_detailed( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, client=client, ).parsed async def asyncio_detailed( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, -) -> Response[AgentMetadataResponse | ErrorResponse | HTTPValidationError]: - """Get Agent Metadata +) -> Response[ErrorResponse | HTTPValidationError | OperatorMetadataResponse]: + """Get Operator Metadata Args: graph_id (str): - agent_type (str): Agent type identifier (e.g., 'financial', 'research', 'rag') + operator_type (str): Operator type identifier (e.g., 'financial', 'research', 'rag') 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[AgentMetadataResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorMetadataResponse] """ kwargs = _get_kwargs( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -179,28 +179,28 @@ async def asyncio_detailed( async def asyncio( graph_id: str, - agent_type: str, + operator_type: str, *, client: AuthenticatedClient, -) -> AgentMetadataResponse | ErrorResponse | HTTPValidationError | None: - """Get Agent Metadata +) -> ErrorResponse | HTTPValidationError | OperatorMetadataResponse | None: + """Get Operator Metadata Args: graph_id (str): - agent_type (str): Agent type identifier (e.g., 'financial', 'research', 'rag') + operator_type (str): Operator type identifier (e.g., 'financial', 'research', 'rag') 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: - AgentMetadataResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorMetadataResponse """ return ( await asyncio_detailed( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, client=client, ) ).parsed diff --git a/robosystems_client/api/agent/list_agents.py b/robosystems_client/api/operator/list_operators.py similarity index 83% rename from robosystems_client/api/agent/list_agents.py rename to robosystems_client/api/operator/list_operators.py index d2a724d..db7d490 100644 --- a/robosystems_client/api/agent/list_agents.py +++ b/robosystems_client/api/operator/list_operators.py @@ -6,9 +6,9 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_list_response import AgentListResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError +from ...models.operator_list_response import OperatorListResponse from ...types import UNSET, Response, Unset @@ -31,7 +31,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/graphs/{graph_id}/agent".format( + "url": "/v1/graphs/{graph_id}/operator".format( graph_id=quote(str(graph_id), safe=""), ), "params": params, @@ -42,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentListResponse | ErrorResponse | HTTPValidationError | None: +) -> ErrorResponse | HTTPValidationError | OperatorListResponse | None: if response.status_code == 200: - response_200 = AgentListResponse.from_dict(response.json()) + response_200 = OperatorListResponse.from_dict(response.json()) return response_200 @@ -91,7 +91,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentListResponse | ErrorResponse | HTTPValidationError]: +) -> Response[ErrorResponse | HTTPValidationError | OperatorListResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,8 +105,8 @@ def sync_detailed( *, client: AuthenticatedClient, capability: None | str | Unset = UNSET, -) -> Response[AgentListResponse | ErrorResponse | HTTPValidationError]: - """List Available Agents +) -> Response[ErrorResponse | HTTPValidationError | OperatorListResponse]: + """List Available Operators Filter by capability using the `capability` query param (e.g., `financial_analysis`, `rag_search`). @@ -120,7 +120,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentListResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorListResponse] """ kwargs = _get_kwargs( @@ -140,8 +140,8 @@ def sync( *, client: AuthenticatedClient, capability: None | str | Unset = UNSET, -) -> AgentListResponse | ErrorResponse | HTTPValidationError | None: - """List Available Agents +) -> ErrorResponse | HTTPValidationError | OperatorListResponse | None: + """List Available Operators Filter by capability using the `capability` query param (e.g., `financial_analysis`, `rag_search`). @@ -155,7 +155,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentListResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorListResponse """ return sync_detailed( @@ -170,8 +170,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, capability: None | str | Unset = UNSET, -) -> Response[AgentListResponse | ErrorResponse | HTTPValidationError]: - """List Available Agents +) -> Response[ErrorResponse | HTTPValidationError | OperatorListResponse]: + """List Available Operators Filter by capability using the `capability` query param (e.g., `financial_analysis`, `rag_search`). @@ -185,7 +185,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AgentListResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorListResponse] """ kwargs = _get_kwargs( @@ -203,8 +203,8 @@ async def asyncio( *, client: AuthenticatedClient, capability: None | str | Unset = UNSET, -) -> AgentListResponse | ErrorResponse | HTTPValidationError | None: - """List Available Agents +) -> ErrorResponse | HTTPValidationError | OperatorListResponse | None: + """List Available Operators Filter by capability using the `capability` query param (e.g., `financial_analysis`, `rag_search`). @@ -218,7 +218,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AgentListResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorListResponse """ return ( diff --git a/robosystems_client/api/agent/recommend_agent.py b/robosystems_client/api/operator/recommend_operator.py similarity index 63% rename from robosystems_client/api/agent/recommend_agent.py rename to robosystems_client/api/operator/recommend_operator.py index 433836c..396952b 100644 --- a/robosystems_client/api/agent/recommend_agent.py +++ b/robosystems_client/api/operator/recommend_operator.py @@ -6,23 +6,23 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.agent_recommendation_request import AgentRecommendationRequest -from ...models.agent_recommendation_response import AgentRecommendationResponse from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError +from ...models.operator_recommendation_request import OperatorRecommendationRequest +from ...models.operator_recommendation_response import OperatorRecommendationResponse from ...types import Response def _get_kwargs( graph_id: str, *, - body: AgentRecommendationRequest, + body: OperatorRecommendationRequest, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/graphs/{graph_id}/agent/recommend".format( + "url": "/v1/graphs/{graph_id}/operator/recommend".format( graph_id=quote(str(graph_id), safe=""), ), } @@ -37,9 +37,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AgentRecommendationResponse | ErrorResponse | HTTPValidationError | None: +) -> ErrorResponse | HTTPValidationError | OperatorRecommendationResponse | None: if response.status_code == 200: - response_200 = AgentRecommendationResponse.from_dict(response.json()) + response_200 = OperatorRecommendationResponse.from_dict(response.json()) return response_200 @@ -86,7 +86,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AgentRecommendationResponse | ErrorResponse | HTTPValidationError]: +) -> Response[ErrorResponse | HTTPValidationError | OperatorRecommendationResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -99,23 +99,23 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: AgentRecommendationRequest, -) -> Response[AgentRecommendationResponse | ErrorResponse | HTTPValidationError]: - """Get Agent Recommendations + body: OperatorRecommendationRequest, +) -> Response[ErrorResponse | HTTPValidationError | OperatorRecommendationResponse]: + """Get Operator Recommendations - Returns agents ranked by confidence score for a query, with explanations. Use before execution when - unsure which agent to pick. + Returns operators ranked by confidence score for a query, with explanations. Use before execution + when unsure which operator to pick. Args: graph_id (str): - body (AgentRecommendationRequest): Request for agent recommendations. + body (OperatorRecommendationRequest): Request for operator recommendations. 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[AgentRecommendationResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorRecommendationResponse] """ kwargs = _get_kwargs( @@ -134,23 +134,23 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: AgentRecommendationRequest, -) -> AgentRecommendationResponse | ErrorResponse | HTTPValidationError | None: - """Get Agent Recommendations + body: OperatorRecommendationRequest, +) -> ErrorResponse | HTTPValidationError | OperatorRecommendationResponse | None: + """Get Operator Recommendations - Returns agents ranked by confidence score for a query, with explanations. Use before execution when - unsure which agent to pick. + Returns operators ranked by confidence score for a query, with explanations. Use before execution + when unsure which operator to pick. Args: graph_id (str): - body (AgentRecommendationRequest): Request for agent recommendations. + body (OperatorRecommendationRequest): Request for operator recommendations. 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: - AgentRecommendationResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorRecommendationResponse """ return sync_detailed( @@ -164,23 +164,23 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: AgentRecommendationRequest, -) -> Response[AgentRecommendationResponse | ErrorResponse | HTTPValidationError]: - """Get Agent Recommendations + body: OperatorRecommendationRequest, +) -> Response[ErrorResponse | HTTPValidationError | OperatorRecommendationResponse]: + """Get Operator Recommendations - Returns agents ranked by confidence score for a query, with explanations. Use before execution when - unsure which agent to pick. + Returns operators ranked by confidence score for a query, with explanations. Use before execution + when unsure which operator to pick. Args: graph_id (str): - body (AgentRecommendationRequest): Request for agent recommendations. + body (OperatorRecommendationRequest): Request for operator recommendations. 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[AgentRecommendationResponse | ErrorResponse | HTTPValidationError] + Response[ErrorResponse | HTTPValidationError | OperatorRecommendationResponse] """ kwargs = _get_kwargs( @@ -197,23 +197,23 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: AgentRecommendationRequest, -) -> AgentRecommendationResponse | ErrorResponse | HTTPValidationError | None: - """Get Agent Recommendations + body: OperatorRecommendationRequest, +) -> ErrorResponse | HTTPValidationError | OperatorRecommendationResponse | None: + """Get Operator Recommendations - Returns agents ranked by confidence score for a query, with explanations. Use before execution when - unsure which agent to pick. + Returns operators ranked by confidence score for a query, with explanations. Use before execution + when unsure which operator to pick. Args: graph_id (str): - body (AgentRecommendationRequest): Request for agent recommendations. + body (OperatorRecommendationRequest): Request for operator recommendations. 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: - AgentRecommendationResponse | ErrorResponse | HTTPValidationError + ErrorResponse | HTTPValidationError | OperatorRecommendationResponse """ return ( diff --git a/robosystems_client/clients/__init__.py b/robosystems_client/clients/__init__.py index a05fe33..9868147 100644 --- a/robosystems_client/clients/__init__.py +++ b/robosystems_client/clients/__init__.py @@ -14,13 +14,13 @@ QueryOptions, QueuedQueryError, ) -from .agent_client import ( - AgentClient, - AgentResult, - QueuedAgentResponse, - AgentQueryRequest, - AgentOptions, - QueuedAgentError, +from .operator_client import ( + OperatorClient, + OperatorResult, + QueuedOperatorResponse, + OperatorQueryRequest, + OperatorOptions, + QueuedOperatorError, ) from .operation_client import ( OperationClient, @@ -135,13 +135,13 @@ "QueryRequest", "QueryOptions", "QueuedQueryError", - # Agent Client - "AgentClient", - "AgentResult", - "QueuedAgentResponse", - "AgentQueryRequest", - "AgentOptions", - "QueuedAgentError", + # AI Operator Client + "OperatorClient", + "OperatorResult", + "QueuedOperatorResponse", + "OperatorQueryRequest", + "OperatorOptions", + "QueuedOperatorError", # Operation Client "OperationClient", "OperationStatus", @@ -225,14 +225,14 @@ def stream_query(graph_id: str, query: str, parameters=None, chunk_size=None): return clients.query.stream_query(graph_id, query, parameters, chunk_size) -def agent_query(graph_id: str, message: str, context=None): - """Execute an agent query using the default clients instance""" - return clients.agent.query(graph_id, message, context) +def operator_query(graph_id: str, message: str, context=None): + """Execute an operator query using the default clients instance""" + return clients.operator.query(graph_id, message, context) def analyze_financials(graph_id: str, message: str, on_progress=None): - """Execute financial agent using the default clients instance""" - return clients.agent.analyze_financials(graph_id, message, on_progress) + """Execute financial operator using the default clients instance""" + return clients.operator.analyze_financials(graph_id, message, on_progress) # DataFrame convenience functions (if pandas is available) diff --git a/robosystems_client/clients/facade.py b/robosystems_client/clients/facade.py index 1ee7650..d06bc96 100644 --- a/robosystems_client/clients/facade.py +++ b/robosystems_client/clients/facade.py @@ -7,7 +7,7 @@ from typing import Dict, Any, Optional, Callable from .query_client import QueryClient -from .agent_client import AgentClient +from .operator_client import OperatorClient from .operation_client import OperationClient from .file_client import FileClient from .document_client import DocumentClient @@ -65,7 +65,7 @@ def __init__(self, config: RoboSystemsClientConfig = None): # Initialize clients self.query = QueryClient(self.config) - self.agent = AgentClient(self.config) + self.operator = OperatorClient(self.config) self.operations = OperationClient(self.config) self.files = FileClient(self.config) self.tables = TableClient(self.config) @@ -101,7 +101,7 @@ def create_sse_client(self) -> SSEClient: def close(self): """Clean up all active connections""" self.query.close() - self.agent.close() + self.operator.close() self.operations.close_all() if hasattr(self.files, "close"): self.files.close() diff --git a/robosystems_client/clients/agent_client.py b/robosystems_client/clients/operator_client.py similarity index 66% rename from robosystems_client/clients/agent_client.py rename to robosystems_client/clients/operator_client.py index c704933..e4da2b0 100644 --- a/robosystems_client/clients/agent_client.py +++ b/robosystems_client/clients/operator_client.py @@ -1,22 +1,24 @@ -"""Enhanced Agent Client with SSE support +"""Enhanced AI Operator Client with SSE support -Provides intelligent agent execution with automatic strategy selection. +Provides intelligent operator execution with automatic strategy selection. """ from dataclasses import dataclass from typing import Dict, Any, Optional, Callable from datetime import datetime -from ..api.agent.auto_select_agent import sync_detailed as auto_select_agent -from ..api.agent.execute_specific_agent import sync_detailed as execute_specific_agent -from ..models.agent_request import AgentRequest -from ..models.agent_message import AgentMessage +from ..api.operator.auto_select_operator import sync_detailed as auto_select_operator +from ..api.operator.execute_specific_operator import ( + sync_detailed as execute_specific_operator, +) +from ..models.operator_request import OperatorRequest +from ..models.operator_message import OperatorMessage from .sse_client import SSEClient, SSEConfig, EventType @dataclass -class AgentQueryRequest: - """Request object for agent queries""" +class OperatorQueryRequest: + """Request object for operator queries""" message: str history: Optional[list] = None @@ -27,8 +29,8 @@ class AgentQueryRequest: @dataclass -class AgentOptions: - """Options for agent execution""" +class OperatorOptions: + """Options for operator execution""" mode: Optional[str] = "auto" # 'auto', 'sync', 'async' max_wait: Optional[int] = None @@ -36,11 +38,11 @@ class AgentOptions: @dataclass -class AgentResult: - """Result from agent execution""" +class OperatorResult: + """Result from operator execution""" content: str - agent_used: str + operator_used: str mode_used: str metadata: Optional[Dict[str, Any]] = None tokens_used: Optional[Dict[str, int]] = None @@ -50,8 +52,8 @@ class AgentResult: @dataclass -class QueuedAgentResponse: - """Response when agent execution is queued""" +class QueuedOperatorResponse: + """Response when operator execution is queued""" status: str operation_id: str @@ -59,16 +61,16 @@ class QueuedAgentResponse: sse_endpoint: Optional[str] = None -class QueuedAgentError(Exception): - """Exception thrown when agent execution is queued and maxWait is 0""" +class QueuedOperatorError(Exception): + """Exception thrown when operator execution is queued and maxWait is 0""" - def __init__(self, queue_info: QueuedAgentResponse): - super().__init__("Agent execution was queued") + def __init__(self, queue_info: QueuedOperatorResponse): + super().__init__("Operator execution was queued") self.queue_info = queue_info -class AgentClient: - """Enhanced agent client with SSE streaming support""" +class OperatorClient: + """Enhanced AI Operator client with SSE streaming support""" def __init__(self, config: Dict[str, Any]): self.config = config @@ -80,18 +82,18 @@ def __init__(self, config: Dict[str, Any]): def execute_query( self, graph_id: str, - request: AgentQueryRequest, - options: AgentOptions = None, - ) -> AgentResult: - """Execute agent query with automatic agent selection""" + request: OperatorQueryRequest, + options: OperatorOptions = None, + ) -> OperatorResult: + """Execute operator query with automatic operator selection""" if options is None: - options = AgentOptions() + options = OperatorOptions() # Build request data - agent_request = AgentRequest( + operator_request = OperatorRequest( message=request.message, history=[ - AgentMessage(role=msg["role"], content=msg["content"]) + OperatorMessage(role=msg["role"], content=msg["content"]) for msg in (request.history or []) ], context=request.context, @@ -115,10 +117,10 @@ def execute_query( ) try: - response = auto_select_agent( + response = auto_select_operator( graph_id=graph_id, client=client, - body=agent_request, + body=operator_request, ) # Check response type and handle accordingly @@ -135,16 +137,16 @@ def execute_query( # Check if this is an immediate response (sync or SSE execution) has_content = False if isinstance(data, dict): - has_content = "content" in data and "agent_used" in data + has_content = "content" in data and "operator_used" in data else: - has_content = hasattr(data, "content") and hasattr(data, "agent_used") + has_content = hasattr(data, "content") and hasattr(data, "operator_used") if has_content: # Extract data from either dict or attrs object if isinstance(data, dict): - return AgentResult( + return OperatorResult( content=data["content"], - agent_used=data["agent_used"], + operator_used=data["operator_used"], mode_used=data["mode_used"], metadata=data.get("metadata"), tokens_used=data.get("tokens_used"), @@ -156,9 +158,11 @@ def execute_query( # attrs object - access attributes directly from ..types import UNSET - return AgentResult( + return OperatorResult( content=data.content if data.content is not UNSET else "", - agent_used=data.agent_used if data.agent_used is not UNSET else "unknown", + operator_used=data.operator_used + if data.operator_used is not UNSET + else "unknown", mode_used=data.mode_used.value if hasattr(data.mode_used, "value") else data.mode_used @@ -184,10 +188,10 @@ def execute_query( if isinstance(data, dict): is_queued = "operation_id" in data if is_queued: - queued_response = QueuedAgentResponse( + queued_response = QueuedOperatorResponse( status=data.get("status", "queued"), operation_id=data["operation_id"], - message=data.get("message", "Agent execution queued"), + message=data.get("message", "Operator execution queued"), sse_endpoint=data.get("sse_endpoint"), ) else: @@ -195,12 +199,12 @@ def execute_query( if is_queued: from ..types import UNSET - queued_response = QueuedAgentResponse( + queued_response = QueuedOperatorResponse( status=data.status if hasattr(data, "status") else "queued", operation_id=data.operation_id, message=data.message if hasattr(data, "message") and data.message is not UNSET - else "Agent execution queued", + else "Operator execution queued", sse_endpoint=data.sse_endpoint if hasattr(data, "sse_endpoint") and data.sse_endpoint is not UNSET else None, @@ -209,13 +213,15 @@ def execute_query( if is_queued and queued_response: # If user doesn't want to wait, raise with queue info if options.max_wait == 0: - raise QueuedAgentError(queued_response) + raise QueuedOperatorError(queued_response) # Use SSE to monitor the operation - return self._wait_for_agent_completion(queued_response.operation_id, options) + return self._wait_for_operator_completion( + queued_response.operation_id, options + ) except Exception as e: - if isinstance(e, QueuedAgentError): + if isinstance(e, QueuedOperatorError): raise error_msg = str(e) @@ -223,29 +229,29 @@ def execute_query( if ( "401" in error_msg or "403" in error_msg or "unauthorized" in error_msg.lower() ): - raise Exception(f"Authentication failed during agent execution: {error_msg}") + raise Exception(f"Authentication failed during operator execution: {error_msg}") else: - raise Exception(f"Agent execution failed: {error_msg}") + raise Exception(f"Operator execution failed: {error_msg}") # Unexpected response format - raise Exception("Unexpected response format from agent endpoint") + raise Exception("Unexpected response format from operator endpoint") - def execute_agent( + def execute_operator( self, graph_id: str, - agent_type: str, - request: AgentQueryRequest, - options: AgentOptions = None, - ) -> AgentResult: - """Execute specific agent type""" + operator_type: str, + request: OperatorQueryRequest, + options: OperatorOptions = None, + ) -> OperatorResult: + """Execute specific operator type""" if options is None: - options = AgentOptions() + options = OperatorOptions() # Build request data - agent_request = AgentRequest( + operator_request = OperatorRequest( message=request.message, history=[ - AgentMessage(role=msg["role"], content=msg["content"]) + OperatorMessage(role=msg["role"], content=msg["content"]) for msg in (request.history or []) ], context=request.context, @@ -269,11 +275,11 @@ def execute_agent( ) try: - response = execute_specific_agent( + response = execute_specific_operator( graph_id=graph_id, - agent_type=agent_type, + operator_type=operator_type, client=client, - body=agent_request, + body=operator_request, ) # Check response type and handle accordingly @@ -289,16 +295,16 @@ def execute_agent( # Check if this is an immediate response has_content = False if isinstance(data, dict): - has_content = "content" in data and "agent_used" in data + has_content = "content" in data and "operator_used" in data else: - has_content = hasattr(data, "content") and hasattr(data, "agent_used") + has_content = hasattr(data, "content") and hasattr(data, "operator_used") if has_content: # Extract data from either dict or attrs object if isinstance(data, dict): - return AgentResult( + return OperatorResult( content=data["content"], - agent_used=data["agent_used"], + operator_used=data["operator_used"], mode_used=data["mode_used"], metadata=data.get("metadata"), tokens_used=data.get("tokens_used"), @@ -310,9 +316,11 @@ def execute_agent( # attrs object from ..types import UNSET - return AgentResult( + return OperatorResult( content=data.content if data.content is not UNSET else "", - agent_used=data.agent_used if data.agent_used is not UNSET else "unknown", + operator_used=data.operator_used + if data.operator_used is not UNSET + else "unknown", mode_used=data.mode_used.value if hasattr(data.mode_used, "value") else data.mode_used @@ -338,10 +346,10 @@ def execute_agent( if isinstance(data, dict): is_queued = "operation_id" in data if is_queued: - queued_response = QueuedAgentResponse( + queued_response = QueuedOperatorResponse( status=data.get("status", "queued"), operation_id=data["operation_id"], - message=data.get("message", "Agent execution queued"), + message=data.get("message", "Operator execution queued"), sse_endpoint=data.get("sse_endpoint"), ) else: @@ -349,12 +357,12 @@ def execute_agent( if is_queued: from ..types import UNSET - queued_response = QueuedAgentResponse( + queued_response = QueuedOperatorResponse( status=data.status if hasattr(data, "status") else "queued", operation_id=data.operation_id, message=data.message if hasattr(data, "message") and data.message is not UNSET - else "Agent execution queued", + else "Operator execution queued", sse_endpoint=data.sse_endpoint if hasattr(data, "sse_endpoint") and data.sse_endpoint is not UNSET else None, @@ -363,30 +371,32 @@ def execute_agent( if is_queued and queued_response: # If user doesn't want to wait, raise with queue info if options.max_wait == 0: - raise QueuedAgentError(queued_response) + raise QueuedOperatorError(queued_response) # Use SSE to monitor the operation - return self._wait_for_agent_completion(queued_response.operation_id, options) + return self._wait_for_operator_completion( + queued_response.operation_id, options + ) except Exception as e: - if isinstance(e, QueuedAgentError): + if isinstance(e, QueuedOperatorError): raise error_msg = str(e) if ( "401" in error_msg or "403" in error_msg or "unauthorized" in error_msg.lower() ): - raise Exception(f"Authentication failed during agent execution: {error_msg}") + raise Exception(f"Authentication failed during operator execution: {error_msg}") else: - raise Exception(f"Agent execution failed: {error_msg}") + raise Exception(f"Operator execution failed: {error_msg}") # Unexpected response format - raise Exception("Unexpected response format from agent endpoint") + raise Exception("Unexpected response format from operator endpoint") - def _wait_for_agent_completion( - self, operation_id: str, options: AgentOptions - ) -> AgentResult: - """Wait for agent completion and return final result""" + def _wait_for_operator_completion( + self, operation_id: str, options: OperatorOptions + ) -> OperatorResult: + """Wait for operator completion and return final result""" result = None error = None completed = False @@ -401,19 +411,19 @@ def on_progress(data): data.get("message", "Processing..."), data.get("percentage") ) - def on_agent_started(data): + def on_operator_started(data): if options.on_progress: - options.on_progress(f"Agent {data.get('agent_type')} started", 0) + options.on_progress(f"Agent {data.get('operator_type')} started", 0) - def on_agent_initialized(data): + def on_operator_initialized(data): if options.on_progress: - options.on_progress(f"{data.get('agent_name')} initialized", 10) + options.on_progress(f"{data.get('operator_name')} initialized", 10) - def on_agent_completed(data): + def on_operator_completed(data): nonlocal result, completed - result = AgentResult( + result = OperatorResult( content=data.get("content", ""), - agent_used=data.get("agent_used", "unknown"), + operator_used=data.get("operator_used", "unknown"), mode_used=data.get("mode_used", "standard"), metadata=data.get("metadata"), tokens_used=data.get("tokens_used"), @@ -427,16 +437,16 @@ def on_completed(data): nonlocal result, completed if not result: # Fallback to generic completion event - agent_result = data.get("result", data) - result = AgentResult( - content=agent_result.get("content", ""), - agent_used=agent_result.get("agent_used", "unknown"), - mode_used=agent_result.get("mode_used", "standard"), - metadata=agent_result.get("metadata"), - tokens_used=agent_result.get("tokens_used"), - confidence_score=agent_result.get("confidence_score"), - execution_time=agent_result.get("execution_time"), - timestamp=agent_result.get("timestamp", datetime.now().isoformat()), + operator_result = data.get("result", data) + result = OperatorResult( + content=operator_result.get("content", ""), + operator_used=operator_result.get("operator_used", "unknown"), + mode_used=operator_result.get("mode_used", "standard"), + metadata=operator_result.get("metadata"), + tokens_used=operator_result.get("tokens_used"), + confidence_score=operator_result.get("confidence_score"), + execution_time=operator_result.get("execution_time"), + timestamp=operator_result.get("timestamp", datetime.now().isoformat()), ) completed = True @@ -447,15 +457,15 @@ def on_error(err): def on_cancelled(): nonlocal error, completed - error = Exception("Agent execution cancelled") + error = Exception("Operator execution cancelled") completed = True # Register event handlers sse_client.on(EventType.OPERATION_PROGRESS.value, on_progress) - sse_client.on("agent_started", on_agent_started) - sse_client.on("agent_initialized", on_agent_initialized) + sse_client.on("operator_started", on_operator_started) + sse_client.on("operator_initialized", on_operator_initialized) sse_client.on("progress", on_progress) - sse_client.on("agent_completed", on_agent_completed) + sse_client.on("operator_completed", on_operator_completed) sse_client.on(EventType.OPERATION_COMPLETED.value, on_completed) sse_client.on(EventType.OPERATION_ERROR.value, on_error) sse_client.on("error", on_error) @@ -478,21 +488,21 @@ def on_cancelled(): def query( self, graph_id: str, message: str, context: Dict[str, Any] = None - ) -> AgentResult: - """Convenience method for simple agent queries with auto-selection""" - request = AgentQueryRequest(message=message, context=context) - return self.execute_query(graph_id, request, AgentOptions(mode="auto")) + ) -> OperatorResult: + """Convenience method for simple operator queries with auto-selection""" + request = OperatorQueryRequest(message=message, context=context) + return self.execute_query(graph_id, request, OperatorOptions(mode="auto")) def analyze_financials( self, graph_id: str, message: str, on_progress: Optional[Callable[[str, Optional[int]], None]] = None, - ) -> AgentResult: - """Execute financial agent for financial analysis""" - request = AgentQueryRequest(message=message) - return self.execute_agent( - graph_id, "financial", request, AgentOptions(on_progress=on_progress) + ) -> OperatorResult: + """Execute financial operator for financial analysis""" + request = OperatorQueryRequest(message=message) + return self.execute_operator( + graph_id, "financial", request, OperatorOptions(on_progress=on_progress) ) def research( @@ -500,11 +510,11 @@ def research( graph_id: str, message: str, on_progress: Optional[Callable[[str, Optional[int]], None]] = None, - ) -> AgentResult: - """Execute research agent for deep research""" - request = AgentQueryRequest(message=message) - return self.execute_agent( - graph_id, "research", request, AgentOptions(on_progress=on_progress) + ) -> OperatorResult: + """Execute research operator for deep research""" + request = OperatorQueryRequest(message=message) + return self.execute_operator( + graph_id, "research", request, OperatorOptions(on_progress=on_progress) ) def rag( @@ -512,11 +522,11 @@ def rag( graph_id: str, message: str, on_progress: Optional[Callable[[str, Optional[int]], None]] = None, - ) -> AgentResult: - """Execute RAG agent for fast retrieval""" - request = AgentQueryRequest(message=message) - return self.execute_agent( - graph_id, "rag", request, AgentOptions(on_progress=on_progress) + ) -> OperatorResult: + """Execute RAG operator for fast retrieval""" + request = OperatorQueryRequest(message=message) + return self.execute_operator( + graph_id, "rag", request, OperatorOptions(on_progress=on_progress) ) def close(self): diff --git a/robosystems_client/models/__init__.py b/robosystems_client/models/__init__.py index 5986355..50f4b09 100644 --- a/robosystems_client/models/__init__.py +++ b/robosystems_client/models/__init__.py @@ -2,26 +2,6 @@ from .account_info import AccountInfo from .add_publish_list_members_operation import AddPublishListMembersOperation -from .agent_list_response import AgentListResponse -from .agent_list_response_agents import AgentListResponseAgents -from .agent_list_response_agents_additional_property import ( - AgentListResponseAgentsAdditionalProperty, -) -from .agent_message import AgentMessage -from .agent_metadata_response import AgentMetadataResponse -from .agent_mode import AgentMode -from .agent_recommendation import AgentRecommendation -from .agent_recommendation_request import AgentRecommendationRequest -from .agent_recommendation_request_context_type_0 import ( - AgentRecommendationRequestContextType0, -) -from .agent_recommendation_response import AgentRecommendationResponse -from .agent_request import AgentRequest -from .agent_request_context_type_0 import AgentRequestContextType0 -from .agent_response import AgentResponse -from .agent_response_error_details_type_0 import AgentResponseErrorDetailsType0 -from .agent_response_metadata_type_0 import AgentResponseMetadataType0 -from .agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0 from .api_key_info import APIKeyInfo from .api_keys_response import APIKeysResponse from .artifact_response import ArtifactResponse @@ -41,8 +21,8 @@ from .backup_response import BackupResponse from .backup_stats_response import BackupStatsResponse from .backup_stats_response_backup_formats import BackupStatsResponseBackupFormats -from .batch_agent_request import BatchAgentRequest -from .batch_agent_response import BatchAgentResponse +from .batch_operator_request import BatchOperatorRequest +from .batch_operator_response import BatchOperatorResponse from .billing_customer import BillingCustomer from .cancel_operation_response_canceloperation import ( CancelOperationResponseCanceloperation, @@ -420,6 +400,26 @@ ) from .operation_error import OperationError from .operation_error_detail_type_1 import OperationErrorDetailType1 +from .operator_list_response import OperatorListResponse +from .operator_list_response_operators import OperatorListResponseOperators +from .operator_list_response_operators_additional_property import ( + OperatorListResponseOperatorsAdditionalProperty, +) +from .operator_message import OperatorMessage +from .operator_metadata_response import OperatorMetadataResponse +from .operator_mode import OperatorMode +from .operator_recommendation import OperatorRecommendation +from .operator_recommendation_request import OperatorRecommendationRequest +from .operator_recommendation_request_context_type_0 import ( + OperatorRecommendationRequestContextType0, +) +from .operator_recommendation_response import OperatorRecommendationResponse +from .operator_request import OperatorRequest +from .operator_request_context_type_0 import OperatorRequestContextType0 +from .operator_response import OperatorResponse +from .operator_response_error_details_type_0 import OperatorResponseErrorDetailsType0 +from .operator_response_metadata_type_0 import OperatorResponseMetadataType0 +from .operator_response_tokens_used_type_0 import OperatorResponseTokensUsedType0 from .org_detail_response import OrgDetailResponse from .org_detail_response_graphs_item import OrgDetailResponseGraphsItem from .org_detail_response_limits_type_0 import OrgDetailResponseLimitsType0 @@ -642,22 +642,6 @@ __all__ = ( "AccountInfo", "AddPublishListMembersOperation", - "AgentListResponse", - "AgentListResponseAgents", - "AgentListResponseAgentsAdditionalProperty", - "AgentMessage", - "AgentMetadataResponse", - "AgentMode", - "AgentRecommendation", - "AgentRecommendationRequest", - "AgentRecommendationRequestContextType0", - "AgentRecommendationResponse", - "AgentRequest", - "AgentRequestContextType0", - "AgentResponse", - "AgentResponseErrorDetailsType0", - "AgentResponseMetadataType0", - "AgentResponseTokensUsedType0", "APIKeyInfo", "APIKeysResponse", "ArtifactResponse", @@ -677,8 +661,8 @@ "BackupResponse", "BackupStatsResponse", "BackupStatsResponseBackupFormats", - "BatchAgentRequest", - "BatchAgentResponse", + "BatchOperatorRequest", + "BatchOperatorResponse", "BillingCustomer", "CancelOperationResponseCanceloperation", "CancelSubscriptionRequest", @@ -932,6 +916,22 @@ "OperationEnvelopeTaxonomyBlockEnvelopeStatus", "OperationError", "OperationErrorDetailType1", + "OperatorListResponse", + "OperatorListResponseOperators", + "OperatorListResponseOperatorsAdditionalProperty", + "OperatorMessage", + "OperatorMetadataResponse", + "OperatorMode", + "OperatorRecommendation", + "OperatorRecommendationRequest", + "OperatorRecommendationRequestContextType0", + "OperatorRecommendationResponse", + "OperatorRequest", + "OperatorRequestContextType0", + "OperatorResponse", + "OperatorResponseErrorDetailsType0", + "OperatorResponseMetadataType0", + "OperatorResponseTokensUsedType0", "OrgDetailResponse", "OrgDetailResponseGraphsItem", "OrgDetailResponseLimitsType0", diff --git a/robosystems_client/models/auto_map_elements_operation.py b/robosystems_client/models/auto_map_elements_operation.py index 48b3043..85bfe23 100644 --- a/robosystems_client/models/auto_map_elements_operation.py +++ b/robosystems_client/models/auto_map_elements_operation.py @@ -11,9 +11,9 @@ @_attrs_define class AutoMapElementsOperation: - """Run the MappingAgent over a mapping structure (async). + """Run the MappingOperator over a mapping structure (async). - The MappingAgent walks every unmapped CoA element and proposes + The MappingOperator walks every unmapped CoA element and proposes associations to reporting concepts. Confidence thresholds: ≥0.90 auto-approved (association created), 0.70-0.89 flagged for review (created with `confidence` set; surface it in your UI), <0.70 skipped. diff --git a/robosystems_client/models/batch_agent_request.py b/robosystems_client/models/batch_operator_request.py similarity index 78% rename from robosystems_client/models/batch_agent_request.py rename to robosystems_client/models/batch_operator_request.py index d902c5c..88b4f42 100644 --- a/robosystems_client/models/batch_agent_request.py +++ b/robosystems_client/models/batch_operator_request.py @@ -9,22 +9,22 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.agent_request import AgentRequest + from ..models.operator_request import OperatorRequest -T = TypeVar("T", bound="BatchAgentRequest") +T = TypeVar("T", bound="BatchOperatorRequest") @_attrs_define -class BatchAgentRequest: +class BatchOperatorRequest: """Request for batch processing multiple queries. Attributes: - queries (list[AgentRequest]): List of queries to process (max 10) + queries (list[OperatorRequest]): List of queries to process (max 10) parallel (bool | Unset): Process queries in parallel Default: False. """ - queries: list[AgentRequest] + queries: list[OperatorRequest] parallel: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -50,25 +50,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_request import AgentRequest + from ..models.operator_request import OperatorRequest d = dict(src_dict) queries = [] _queries = d.pop("queries") for queries_item_data in _queries: - queries_item = AgentRequest.from_dict(queries_item_data) + queries_item = OperatorRequest.from_dict(queries_item_data) queries.append(queries_item) parallel = d.pop("parallel", UNSET) - batch_agent_request = cls( + batch_operator_request = cls( queries=queries, parallel=parallel, ) - batch_agent_request.additional_properties = d - return batch_agent_request + batch_operator_request.additional_properties = d + return batch_operator_request @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/batch_agent_response.py b/robosystems_client/models/batch_operator_response.py similarity index 80% rename from robosystems_client/models/batch_agent_response.py rename to robosystems_client/models/batch_operator_response.py index b2ed141..23d9692 100644 --- a/robosystems_client/models/batch_agent_response.py +++ b/robosystems_client/models/batch_operator_response.py @@ -7,23 +7,23 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.agent_response import AgentResponse + from ..models.operator_response import OperatorResponse -T = TypeVar("T", bound="BatchAgentResponse") +T = TypeVar("T", bound="BatchOperatorResponse") @_attrs_define -class BatchAgentResponse: +class BatchOperatorResponse: """Response for batch processing. Attributes: - results (list[AgentResponse]): List of agent responses (includes successes and failures) + results (list[OperatorResponse]): List of operator responses (includes successes and failures) total_execution_time (float): Total execution time in seconds parallel_processed (bool): Whether queries were processed in parallel """ - results: list[AgentResponse] + results: list[OperatorResponse] total_execution_time: float parallel_processed: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -52,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_response import AgentResponse + from ..models.operator_response import OperatorResponse d = dict(src_dict) results = [] _results = d.pop("results") for results_item_data in _results: - results_item = AgentResponse.from_dict(results_item_data) + results_item = OperatorResponse.from_dict(results_item_data) results.append(results_item) @@ -66,14 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: parallel_processed = d.pop("parallel_processed") - batch_agent_response = cls( + batch_operator_response = cls( results=results, total_execution_time=total_execution_time, parallel_processed=parallel_processed, ) - batch_agent_response.additional_properties = d - return batch_agent_response + batch_operator_response.additional_properties = d + return batch_operator_response @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/create_mapping_association_operation.py b/robosystems_client/models/create_mapping_association_operation.py index 126ef1c..2d57c51 100644 --- a/robosystems_client/models/create_mapping_association_operation.py +++ b/robosystems_client/models/create_mapping_association_operation.py @@ -20,7 +20,7 @@ class CreateMappingAssociationOperation: This is the iterative, AI-assisted craft path. Each call adds a single association to the target mapping structure. Use `auto-map-elements` - to create many at once via the MappingAgent. Reject duplicates: if + to create many at once via the MappingOperator. Reject duplicates: if the (from, to, type) tuple already exists, the call returns 409. Attributes: diff --git a/robosystems_client/models/create_report_request.py b/robosystems_client/models/create_report_request.py index 4704c14..7d25fa9 100644 --- a/robosystems_client/models/create_report_request.py +++ b/robosystems_client/models/create_report_request.py @@ -42,7 +42,9 @@ class CreateReportRequest: period_end (datetime.date): Current-period end (inclusive). Must be >= `period_start`. Ignored when `periods` is supplied. taxonomy_id (str | Unset): Taxonomy that defines the structures (BS / IS / CF / Equity / Schedules) this report - can render. Defaults to the platform US GAAP reporting taxonomy. Default: 'tax_usgaap_reporting'. + can render. Accepts either an exact tenant-specific taxonomy UUID or a standard name (e.g. 'rs-gaap'). Standard + names resolve to the latest reporting_standard taxonomy with that name. Defaults to 'rs-gaap', the canonical + reporting vocabulary. Default: 'rs-gaap'. period_type (str | Unset): Period cadence: `monthly`, `quarterly`, or `annual`. Default: 'quarterly'. comparative (bool | Unset): When true, automatically generates a prior-period column (same length as the current period). Ignored when `periods` is supplied. Default: True. @@ -55,7 +57,7 @@ class CreateReportRequest: mapping_id: str period_start: datetime.date period_end: datetime.date - taxonomy_id: str | Unset = "tax_usgaap_reporting" + taxonomy_id: str | Unset = "rs-gaap" period_type: str | Unset = "quarterly" comparative: bool | Unset = True periods: list[PeriodSpec] | None | Unset = UNSET diff --git a/robosystems_client/models/agent_list_response.py b/robosystems_client/models/operator_list_response.py similarity index 61% rename from robosystems_client/models/agent_list_response.py rename to robosystems_client/models/operator_list_response.py index 3388a89..4e5b170 100644 --- a/robosystems_client/models/agent_list_response.py +++ b/robosystems_client/models/operator_list_response.py @@ -7,27 +7,27 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.agent_list_response_agents import AgentListResponseAgents + from ..models.operator_list_response_operators import OperatorListResponseOperators -T = TypeVar("T", bound="AgentListResponse") +T = TypeVar("T", bound="OperatorListResponse") @_attrs_define -class AgentListResponse: - """Response for listing available agents. +class OperatorListResponse: + """Response for listing available operators. Attributes: - agents (AgentListResponseAgents): Dictionary of available agents with metadata - total (int): Total number of agents + operators (OperatorListResponseOperators): Dictionary of available operators with metadata + total (int): Total number of operators """ - agents: AgentListResponseAgents + operators: OperatorListResponseOperators total: int additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - agents = self.agents.to_dict() + operators = self.operators.to_dict() total = self.total @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { - "agents": agents, + "operators": operators, "total": total, } ) @@ -44,20 +44,20 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_list_response_agents import AgentListResponseAgents + from ..models.operator_list_response_operators import OperatorListResponseOperators d = dict(src_dict) - agents = AgentListResponseAgents.from_dict(d.pop("agents")) + operators = OperatorListResponseOperators.from_dict(d.pop("operators")) total = d.pop("total") - agent_list_response = cls( - agents=agents, + operator_list_response = cls( + operators=operators, total=total, ) - agent_list_response.additional_properties = d - return agent_list_response + operator_list_response.additional_properties = d + return operator_list_response @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_list_response_agents.py b/robosystems_client/models/operator_list_response_operators.py similarity index 56% rename from robosystems_client/models/agent_list_response_agents.py rename to robosystems_client/models/operator_list_response_operators.py index 91a418e..0863262 100644 --- a/robosystems_client/models/agent_list_response_agents.py +++ b/robosystems_client/models/operator_list_response_operators.py @@ -7,19 +7,19 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.agent_list_response_agents_additional_property import ( - AgentListResponseAgentsAdditionalProperty, + from ..models.operator_list_response_operators_additional_property import ( + OperatorListResponseOperatorsAdditionalProperty, ) -T = TypeVar("T", bound="AgentListResponseAgents") +T = TypeVar("T", bound="OperatorListResponseOperators") @_attrs_define -class AgentListResponseAgents: - """Dictionary of available agents with metadata""" +class OperatorListResponseOperators: + """Dictionary of available operators with metadata""" - additional_properties: dict[str, AgentListResponseAgentsAdditionalProperty] = ( + additional_properties: dict[str, OperatorListResponseOperatorsAdditionalProperty] = ( _attrs_field(init=False, factory=dict) ) @@ -33,33 +33,33 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_list_response_agents_additional_property import ( - AgentListResponseAgentsAdditionalProperty, + from ..models.operator_list_response_operators_additional_property import ( + OperatorListResponseOperatorsAdditionalProperty, ) d = dict(src_dict) - agent_list_response_agents = cls() + operator_list_response_operators = cls() additional_properties = {} for prop_name, prop_dict in d.items(): - additional_property = AgentListResponseAgentsAdditionalProperty.from_dict( + additional_property = OperatorListResponseOperatorsAdditionalProperty.from_dict( prop_dict ) additional_properties[prop_name] = additional_property - agent_list_response_agents.additional_properties = additional_properties - return agent_list_response_agents + operator_list_response_operators.additional_properties = additional_properties + return operator_list_response_operators @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> AgentListResponseAgentsAdditionalProperty: + def __getitem__(self, key: str) -> OperatorListResponseOperatorsAdditionalProperty: return self.additional_properties[key] def __setitem__( - self, key: str, value: AgentListResponseAgentsAdditionalProperty + self, key: str, value: OperatorListResponseOperatorsAdditionalProperty ) -> None: self.additional_properties[key] = value diff --git a/robosystems_client/models/agent_recommendation_request_context_type_0.py b/robosystems_client/models/operator_list_response_operators_additional_property.py similarity index 74% rename from robosystems_client/models/agent_recommendation_request_context_type_0.py rename to robosystems_client/models/operator_list_response_operators_additional_property.py index c354ec0..96cf8ee 100644 --- a/robosystems_client/models/agent_recommendation_request_context_type_0.py +++ b/robosystems_client/models/operator_list_response_operators_additional_property.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentRecommendationRequestContextType0") +T = TypeVar("T", bound="OperatorListResponseOperatorsAdditionalProperty") @_attrs_define -class AgentRecommendationRequestContextType0: +class OperatorListResponseOperatorsAdditionalProperty: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_recommendation_request_context_type_0 = cls() + operator_list_response_operators_additional_property = cls() - agent_recommendation_request_context_type_0.additional_properties = d - return agent_recommendation_request_context_type_0 + operator_list_response_operators_additional_property.additional_properties = d + return operator_list_response_operators_additional_property @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_message.py b/robosystems_client/models/operator_message.py similarity index 93% rename from robosystems_client/models/agent_message.py rename to robosystems_client/models/operator_message.py index 0f3dd9d..d7ee205 100644 --- a/robosystems_client/models/agent_message.py +++ b/robosystems_client/models/operator_message.py @@ -10,11 +10,11 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AgentMessage") +T = TypeVar("T", bound="OperatorMessage") @_attrs_define -class AgentMessage: +class OperatorMessage: """Message in conversation history. Attributes: @@ -78,14 +78,14 @@ def _parse_timestamp(data: object) -> datetime.datetime | None | Unset: timestamp = _parse_timestamp(d.pop("timestamp", UNSET)) - agent_message = cls( + operator_message = cls( role=role, content=content, timestamp=timestamp, ) - agent_message.additional_properties = d - return agent_message + operator_message.additional_properties = d + return operator_message @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_metadata_response.py b/robosystems_client/models/operator_metadata_response.py similarity index 83% rename from robosystems_client/models/agent_metadata_response.py rename to robosystems_client/models/operator_metadata_response.py index b08cd27..ac9c8a2 100644 --- a/robosystems_client/models/agent_metadata_response.py +++ b/robosystems_client/models/operator_metadata_response.py @@ -8,22 +8,22 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AgentMetadataResponse") +T = TypeVar("T", bound="OperatorMetadataResponse") @_attrs_define -class AgentMetadataResponse: - """Response for agent metadata. +class OperatorMetadataResponse: + """Response for operator metadata. Attributes: - name (str): Agent name - description (str): Agent description - version (str): Agent version - capabilities (list[str]): Agent capabilities + name (str): Operator name + description (str): Operator description + version (str): Operator version + capabilities (list[str]): Operator capabilities supported_modes (list[str]): Supported execution modes - requires_credits (bool): Whether agent requires credits - author (None | str | Unset): Agent author - tags (list[str] | Unset): Agent tags + requires_credits (bool): Whether operator requires credits + author (None | str | Unset): Operator author + tags (list[str] | Unset): Operator tags """ name: str @@ -104,7 +104,7 @@ def _parse_author(data: object) -> None | str | Unset: tags = cast(list[str], d.pop("tags", UNSET)) - agent_metadata_response = cls( + operator_metadata_response = cls( name=name, description=description, version=version, @@ -115,8 +115,8 @@ def _parse_author(data: object) -> None | str | Unset: tags=tags, ) - agent_metadata_response.additional_properties = d - return agent_metadata_response + operator_metadata_response.additional_properties = d + return operator_metadata_response @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_mode.py b/robosystems_client/models/operator_mode.py similarity index 84% rename from robosystems_client/models/agent_mode.py rename to robosystems_client/models/operator_mode.py index 1f7adf6..d7d46eb 100644 --- a/robosystems_client/models/agent_mode.py +++ b/robosystems_client/models/operator_mode.py @@ -1,7 +1,7 @@ from enum import Enum -class AgentMode(str, Enum): +class OperatorMode(str, Enum): EXTENDED = "extended" QUICK = "quick" STANDARD = "standard" diff --git a/robosystems_client/models/agent_recommendation.py b/robosystems_client/models/operator_recommendation.py similarity index 73% rename from robosystems_client/models/agent_recommendation.py rename to robosystems_client/models/operator_recommendation.py index 62e01a3..c4bcb96 100644 --- a/robosystems_client/models/agent_recommendation.py +++ b/robosystems_client/models/operator_recommendation.py @@ -8,32 +8,32 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="AgentRecommendation") +T = TypeVar("T", bound="OperatorRecommendation") @_attrs_define -class AgentRecommendation: - """Single agent recommendation. +class OperatorRecommendation: + """Single operator recommendation. Attributes: - agent_type (str): Agent type identifier - agent_name (str): Agent display name + operator_type (str): Operator type identifier + operator_name (str): Operator display name confidence (float): Confidence score (0-1) - capabilities (list[str]): Agent capabilities + capabilities (list[str]): Operator capabilities reason (None | str | Unset): Reason for recommendation """ - agent_type: str - agent_name: str + operator_type: str + operator_name: str confidence: float capabilities: list[str] reason: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - agent_type = self.agent_type + operator_type = self.operator_type - agent_name = self.agent_name + operator_name = self.operator_name confidence = self.confidence @@ -49,8 +49,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { - "agent_type": agent_type, - "agent_name": agent_name, + "operator_type": operator_type, + "operator_name": operator_name, "confidence": confidence, "capabilities": capabilities, } @@ -63,9 +63,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_type = d.pop("agent_type") + operator_type = d.pop("operator_type") - agent_name = d.pop("agent_name") + operator_name = d.pop("operator_name") confidence = d.pop("confidence") @@ -80,16 +80,16 @@ def _parse_reason(data: object) -> None | str | Unset: reason = _parse_reason(d.pop("reason", UNSET)) - agent_recommendation = cls( - agent_type=agent_type, - agent_name=agent_name, + operator_recommendation = cls( + operator_type=operator_type, + operator_name=operator_name, confidence=confidence, capabilities=capabilities, reason=reason, ) - agent_recommendation.additional_properties = d - return agent_recommendation + operator_recommendation.additional_properties = d + return operator_recommendation @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_recommendation_request.py b/robosystems_client/models/operator_recommendation_request.py similarity index 63% rename from robosystems_client/models/agent_recommendation_request.py rename to robosystems_client/models/operator_recommendation_request.py index 6f29f69..8199ed1 100644 --- a/robosystems_client/models/agent_recommendation_request.py +++ b/robosystems_client/models/operator_recommendation_request.py @@ -9,30 +9,30 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.agent_recommendation_request_context_type_0 import ( - AgentRecommendationRequestContextType0, + from ..models.operator_recommendation_request_context_type_0 import ( + OperatorRecommendationRequestContextType0, ) -T = TypeVar("T", bound="AgentRecommendationRequest") +T = TypeVar("T", bound="OperatorRecommendationRequest") @_attrs_define -class AgentRecommendationRequest: - """Request for agent recommendations. +class OperatorRecommendationRequest: + """Request for operator recommendations. Attributes: query (str): Query to analyze - context (AgentRecommendationRequestContextType0 | None | Unset): Additional context + context (None | OperatorRecommendationRequestContextType0 | Unset): Additional context """ query: str - context: AgentRecommendationRequestContextType0 | None | Unset = UNSET + context: None | OperatorRecommendationRequestContextType0 | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.agent_recommendation_request_context_type_0 import ( - AgentRecommendationRequestContextType0, + from ..models.operator_recommendation_request_context_type_0 import ( + OperatorRecommendationRequestContextType0, ) query = self.query @@ -40,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: context: dict[str, Any] | None | Unset if isinstance(self.context, Unset): context = UNSET - elif isinstance(self.context, AgentRecommendationRequestContextType0): + elif isinstance(self.context, OperatorRecommendationRequestContextType0): context = self.context.to_dict() else: context = self.context @@ -59,8 +59,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_recommendation_request_context_type_0 import ( - AgentRecommendationRequestContextType0, + from ..models.operator_recommendation_request_context_type_0 import ( + OperatorRecommendationRequestContextType0, ) d = dict(src_dict) @@ -68,7 +68,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_context( data: object, - ) -> AgentRecommendationRequestContextType0 | None | Unset: + ) -> None | OperatorRecommendationRequestContextType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -76,22 +76,22 @@ def _parse_context( try: if not isinstance(data, dict): raise TypeError() - context_type_0 = AgentRecommendationRequestContextType0.from_dict(data) + context_type_0 = OperatorRecommendationRequestContextType0.from_dict(data) return context_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentRecommendationRequestContextType0 | None | Unset, data) + return cast(None | OperatorRecommendationRequestContextType0 | Unset, data) context = _parse_context(d.pop("context", UNSET)) - agent_recommendation_request = cls( + operator_recommendation_request = cls( query=query, context=context, ) - agent_recommendation_request.additional_properties = d - return agent_recommendation_request + operator_recommendation_request.additional_properties = d + return operator_recommendation_request @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_list_response_agents_additional_property.py b/robosystems_client/models/operator_recommendation_request_context_type_0.py similarity index 77% rename from robosystems_client/models/agent_list_response_agents_additional_property.py rename to robosystems_client/models/operator_recommendation_request_context_type_0.py index 1b09603..5aa2edc 100644 --- a/robosystems_client/models/agent_list_response_agents_additional_property.py +++ b/robosystems_client/models/operator_recommendation_request_context_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentListResponseAgentsAdditionalProperty") +T = TypeVar("T", bound="OperatorRecommendationRequestContextType0") @_attrs_define -class AgentListResponseAgentsAdditionalProperty: +class OperatorRecommendationRequestContextType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_list_response_agents_additional_property = cls() + operator_recommendation_request_context_type_0 = cls() - agent_list_response_agents_additional_property.additional_properties = d - return agent_list_response_agents_additional_property + operator_recommendation_request_context_type_0.additional_properties = d + return operator_recommendation_request_context_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_recommendation_response.py b/robosystems_client/models/operator_recommendation_response.py similarity index 71% rename from robosystems_client/models/agent_recommendation_response.py rename to robosystems_client/models/operator_recommendation_response.py index f67d536..57e21c2 100644 --- a/robosystems_client/models/agent_recommendation_response.py +++ b/robosystems_client/models/operator_recommendation_response.py @@ -7,22 +7,22 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.agent_recommendation import AgentRecommendation + from ..models.operator_recommendation import OperatorRecommendation -T = TypeVar("T", bound="AgentRecommendationResponse") +T = TypeVar("T", bound="OperatorRecommendationResponse") @_attrs_define -class AgentRecommendationResponse: - """Response for agent recommendations. +class OperatorRecommendationResponse: + """Response for operator recommendations. Attributes: - recommendations (list[AgentRecommendation]): List of agent recommendations sorted by confidence + recommendations (list[OperatorRecommendation]): List of operator recommendations sorted by confidence query (str): The analyzed query """ - recommendations: list[AgentRecommendation] + recommendations: list[OperatorRecommendation] query: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -47,25 +47,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_recommendation import AgentRecommendation + from ..models.operator_recommendation import OperatorRecommendation d = dict(src_dict) recommendations = [] _recommendations = d.pop("recommendations") for recommendations_item_data in _recommendations: - recommendations_item = AgentRecommendation.from_dict(recommendations_item_data) + recommendations_item = OperatorRecommendation.from_dict(recommendations_item_data) recommendations.append(recommendations_item) query = d.pop("query") - agent_recommendation_response = cls( + operator_recommendation_response = cls( recommendations=recommendations, query=query, ) - agent_recommendation_response.additional_properties = d - return agent_recommendation_response + operator_recommendation_response.additional_properties = d + return operator_recommendation_response @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_request.py b/robosystems_client/models/operator_request.py similarity index 71% rename from robosystems_client/models/agent_request.py rename to robosystems_client/models/operator_request.py index 5f03022..669535a 100644 --- a/robosystems_client/models/agent_request.py +++ b/robosystems_client/models/operator_request.py @@ -6,40 +6,40 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.agent_mode import AgentMode +from ..models.operator_mode import OperatorMode from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.agent_message import AgentMessage - from ..models.agent_request_context_type_0 import AgentRequestContextType0 + from ..models.operator_message import OperatorMessage + from ..models.operator_request_context_type_0 import OperatorRequestContextType0 from ..models.selection_criteria import SelectionCriteria -T = TypeVar("T", bound="AgentRequest") +T = TypeVar("T", bound="OperatorRequest") @_attrs_define -class AgentRequest: - """Request model for agent interactions. +class OperatorRequest: + """Request model for operator interactions. Attributes: message (str): The query or message to process - history (list[AgentMessage] | Unset): Conversation history - context (AgentRequestContextType0 | None | Unset): Additional context for analysis (e.g., enable_rag, + history (list[OperatorMessage] | Unset): Conversation history + context (None | OperatorRequestContextType0 | Unset): Additional context for analysis (e.g., enable_rag, include_schema) - mode (AgentMode | None | Unset): Execution mode Default: AgentMode.STANDARD. - agent_type (None | str | Unset): Specific agent type to use (optional) - selection_criteria (None | SelectionCriteria | Unset): Criteria for agent selection + mode (None | OperatorMode | Unset): Execution mode Default: OperatorMode.STANDARD. + operator_type (None | str | Unset): Specific operator type to use (optional) + selection_criteria (None | SelectionCriteria | Unset): Criteria for operator selection force_extended_analysis (bool | Unset): Force extended analysis mode with comprehensive research Default: False. enable_rag (bool | Unset): Enable RAG context enrichment Default: True. stream (bool | Unset): Enable streaming response Default: False. """ message: str - history: list[AgentMessage] | Unset = UNSET - context: AgentRequestContextType0 | None | Unset = UNSET - mode: AgentMode | None | Unset = AgentMode.STANDARD - agent_type: None | str | Unset = UNSET + history: list[OperatorMessage] | Unset = UNSET + context: None | OperatorRequestContextType0 | Unset = UNSET + mode: None | OperatorMode | Unset = OperatorMode.STANDARD + operator_type: None | str | Unset = UNSET selection_criteria: None | SelectionCriteria | Unset = UNSET force_extended_analysis: bool | Unset = False enable_rag: bool | Unset = True @@ -47,7 +47,7 @@ class AgentRequest: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.agent_request_context_type_0 import AgentRequestContextType0 + from ..models.operator_request_context_type_0 import OperatorRequestContextType0 from ..models.selection_criteria import SelectionCriteria message = self.message @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: context: dict[str, Any] | None | Unset if isinstance(self.context, Unset): context = UNSET - elif isinstance(self.context, AgentRequestContextType0): + elif isinstance(self.context, OperatorRequestContextType0): context = self.context.to_dict() else: context = self.context @@ -70,16 +70,16 @@ def to_dict(self) -> dict[str, Any]: mode: None | str | Unset if isinstance(self.mode, Unset): mode = UNSET - elif isinstance(self.mode, AgentMode): + elif isinstance(self.mode, OperatorMode): mode = self.mode.value else: mode = self.mode - agent_type: None | str | Unset - if isinstance(self.agent_type, Unset): - agent_type = UNSET + operator_type: None | str | Unset + if isinstance(self.operator_type, Unset): + operator_type = UNSET else: - agent_type = self.agent_type + operator_type = self.operator_type selection_criteria: dict[str, Any] | None | Unset if isinstance(self.selection_criteria, Unset): @@ -108,8 +108,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["context"] = context if mode is not UNSET: field_dict["mode"] = mode - if agent_type is not UNSET: - field_dict["agent_type"] = agent_type + if operator_type is not UNSET: + field_dict["operator_type"] = operator_type if selection_criteria is not UNSET: field_dict["selection_criteria"] = selection_criteria if force_extended_analysis is not UNSET: @@ -123,23 +123,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_message import AgentMessage - from ..models.agent_request_context_type_0 import AgentRequestContextType0 + from ..models.operator_message import OperatorMessage + from ..models.operator_request_context_type_0 import OperatorRequestContextType0 from ..models.selection_criteria import SelectionCriteria d = dict(src_dict) message = d.pop("message") _history = d.pop("history", UNSET) - history: list[AgentMessage] | Unset = UNSET + history: list[OperatorMessage] | Unset = UNSET if _history is not UNSET: history = [] for history_item_data in _history: - history_item = AgentMessage.from_dict(history_item_data) + history_item = OperatorMessage.from_dict(history_item_data) history.append(history_item) - def _parse_context(data: object) -> AgentRequestContextType0 | None | Unset: + def _parse_context(data: object) -> None | OperatorRequestContextType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -147,16 +147,16 @@ def _parse_context(data: object) -> AgentRequestContextType0 | None | Unset: try: if not isinstance(data, dict): raise TypeError() - context_type_0 = AgentRequestContextType0.from_dict(data) + context_type_0 = OperatorRequestContextType0.from_dict(data) return context_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentRequestContextType0 | None | Unset, data) + return cast(None | OperatorRequestContextType0 | Unset, data) context = _parse_context(d.pop("context", UNSET)) - def _parse_mode(data: object) -> AgentMode | None | Unset: + def _parse_mode(data: object) -> None | OperatorMode | Unset: if data is None: return data if isinstance(data, Unset): @@ -164,23 +164,23 @@ def _parse_mode(data: object) -> AgentMode | None | Unset: try: if not isinstance(data, str): raise TypeError() - mode_type_0 = AgentMode(data) + mode_type_0 = OperatorMode(data) return mode_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentMode | None | Unset, data) + return cast(None | OperatorMode | Unset, data) mode = _parse_mode(d.pop("mode", UNSET)) - def _parse_agent_type(data: object) -> None | str | Unset: + def _parse_operator_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data return cast(None | str | Unset, data) - agent_type = _parse_agent_type(d.pop("agent_type", UNSET)) + operator_type = _parse_operator_type(d.pop("operator_type", UNSET)) def _parse_selection_criteria(data: object) -> None | SelectionCriteria | Unset: if data is None: @@ -205,20 +205,20 @@ def _parse_selection_criteria(data: object) -> None | SelectionCriteria | Unset: stream = d.pop("stream", UNSET) - agent_request = cls( + operator_request = cls( message=message, history=history, context=context, mode=mode, - agent_type=agent_type, + operator_type=operator_type, selection_criteria=selection_criteria, force_extended_analysis=force_extended_analysis, enable_rag=enable_rag, stream=stream, ) - agent_request.additional_properties = d - return agent_request + operator_request.additional_properties = d + return operator_request @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_request_context_type_0.py b/robosystems_client/models/operator_request_context_type_0.py similarity index 81% rename from robosystems_client/models/agent_request_context_type_0.py rename to robosystems_client/models/operator_request_context_type_0.py index 7e147b4..0cf803b 100644 --- a/robosystems_client/models/agent_request_context_type_0.py +++ b/robosystems_client/models/operator_request_context_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentRequestContextType0") +T = TypeVar("T", bound="OperatorRequestContextType0") @_attrs_define -class AgentRequestContextType0: +class OperatorRequestContextType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_request_context_type_0 = cls() + operator_request_context_type_0 = cls() - agent_request_context_type_0.additional_properties = d - return agent_request_context_type_0 + operator_request_context_type_0.additional_properties = d + return operator_request_context_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_response.py b/robosystems_client/models/operator_response.py similarity index 68% rename from robosystems_client/models/agent_response.py rename to robosystems_client/models/operator_response.py index 6947653..a33377e 100644 --- a/robosystems_client/models/agent_response.py +++ b/robosystems_client/models/operator_response.py @@ -8,68 +8,72 @@ from attrs import field as _attrs_field from dateutil.parser import isoparse -from ..models.agent_mode import AgentMode +from ..models.operator_mode import OperatorMode from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.agent_response_error_details_type_0 import ( - AgentResponseErrorDetailsType0, + from ..models.operator_response_error_details_type_0 import ( + OperatorResponseErrorDetailsType0, + ) + from ..models.operator_response_metadata_type_0 import OperatorResponseMetadataType0 + from ..models.operator_response_tokens_used_type_0 import ( + OperatorResponseTokensUsedType0, ) - from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0 - from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0 -T = TypeVar("T", bound="AgentResponse") +T = TypeVar("T", bound="OperatorResponse") @_attrs_define -class AgentResponse: - """Response model for agent interactions. +class OperatorResponse: + """Response model for operator interactions. Attributes: - content (str): The agent's response content - agent_used (str): The agent type that handled the request - mode_used (AgentMode): Agent execution modes. - metadata (AgentResponseMetadataType0 | None | Unset): Response metadata including routing info - tokens_used (AgentResponseTokensUsedType0 | None | Unset): Token usage statistics + content (str): The operator's response content + operator_used (str): The operator type that handled the request + mode_used (OperatorMode): Operator execution modes. + metadata (None | OperatorResponseMetadataType0 | Unset): Response metadata including routing info + tokens_used (None | OperatorResponseTokensUsedType0 | Unset): Token usage statistics confidence_score (float | None | Unset): Confidence score of the response (0.0-1.0 scale) operation_id (None | str | Unset): Operation ID for SSE monitoring is_partial (bool | Unset): Whether this is a partial response Default: False. - error_details (AgentResponseErrorDetailsType0 | None | Unset): Error details if any + error_details (None | OperatorResponseErrorDetailsType0 | Unset): Error details if any execution_time (float | None | Unset): Execution time in seconds timestamp (datetime.datetime | Unset): Response timestamp """ content: str - agent_used: str - mode_used: AgentMode - metadata: AgentResponseMetadataType0 | None | Unset = UNSET - tokens_used: AgentResponseTokensUsedType0 | None | Unset = UNSET + operator_used: str + mode_used: OperatorMode + metadata: None | OperatorResponseMetadataType0 | Unset = UNSET + tokens_used: None | OperatorResponseTokensUsedType0 | Unset = UNSET confidence_score: float | None | Unset = UNSET operation_id: None | str | Unset = UNSET is_partial: bool | Unset = False - error_details: AgentResponseErrorDetailsType0 | None | Unset = UNSET + error_details: None | OperatorResponseErrorDetailsType0 | Unset = UNSET execution_time: float | None | Unset = UNSET timestamp: datetime.datetime | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.agent_response_error_details_type_0 import ( - AgentResponseErrorDetailsType0, + from ..models.operator_response_error_details_type_0 import ( + OperatorResponseErrorDetailsType0, + ) + from ..models.operator_response_metadata_type_0 import OperatorResponseMetadataType0 + from ..models.operator_response_tokens_used_type_0 import ( + OperatorResponseTokensUsedType0, ) - from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0 - from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0 content = self.content - agent_used = self.agent_used + operator_used = self.operator_used mode_used = self.mode_used.value metadata: dict[str, Any] | None | Unset if isinstance(self.metadata, Unset): metadata = UNSET - elif isinstance(self.metadata, AgentResponseMetadataType0): + elif isinstance(self.metadata, OperatorResponseMetadataType0): metadata = self.metadata.to_dict() else: metadata = self.metadata @@ -77,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: tokens_used: dict[str, Any] | None | Unset if isinstance(self.tokens_used, Unset): tokens_used = UNSET - elif isinstance(self.tokens_used, AgentResponseTokensUsedType0): + elif isinstance(self.tokens_used, OperatorResponseTokensUsedType0): tokens_used = self.tokens_used.to_dict() else: tokens_used = self.tokens_used @@ -99,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: error_details: dict[str, Any] | None | Unset if isinstance(self.error_details, Unset): error_details = UNSET - elif isinstance(self.error_details, AgentResponseErrorDetailsType0): + elif isinstance(self.error_details, OperatorResponseErrorDetailsType0): error_details = self.error_details.to_dict() else: error_details = self.error_details @@ -119,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "content": content, - "agent_used": agent_used, + "operator_used": operator_used, "mode_used": mode_used, } ) @@ -144,20 +148,22 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.agent_response_error_details_type_0 import ( - AgentResponseErrorDetailsType0, + from ..models.operator_response_error_details_type_0 import ( + OperatorResponseErrorDetailsType0, + ) + from ..models.operator_response_metadata_type_0 import OperatorResponseMetadataType0 + from ..models.operator_response_tokens_used_type_0 import ( + OperatorResponseTokensUsedType0, ) - from ..models.agent_response_metadata_type_0 import AgentResponseMetadataType0 - from ..models.agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0 d = dict(src_dict) content = d.pop("content") - agent_used = d.pop("agent_used") + operator_used = d.pop("operator_used") - mode_used = AgentMode(d.pop("mode_used")) + mode_used = OperatorMode(d.pop("mode_used")) - def _parse_metadata(data: object) -> AgentResponseMetadataType0 | None | Unset: + def _parse_metadata(data: object) -> None | OperatorResponseMetadataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -165,16 +171,18 @@ def _parse_metadata(data: object) -> AgentResponseMetadataType0 | None | Unset: try: if not isinstance(data, dict): raise TypeError() - metadata_type_0 = AgentResponseMetadataType0.from_dict(data) + metadata_type_0 = OperatorResponseMetadataType0.from_dict(data) return metadata_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentResponseMetadataType0 | None | Unset, data) + return cast(None | OperatorResponseMetadataType0 | Unset, data) metadata = _parse_metadata(d.pop("metadata", UNSET)) - def _parse_tokens_used(data: object) -> AgentResponseTokensUsedType0 | None | Unset: + def _parse_tokens_used( + data: object, + ) -> None | OperatorResponseTokensUsedType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -182,12 +190,12 @@ def _parse_tokens_used(data: object) -> AgentResponseTokensUsedType0 | None | Un try: if not isinstance(data, dict): raise TypeError() - tokens_used_type_0 = AgentResponseTokensUsedType0.from_dict(data) + tokens_used_type_0 = OperatorResponseTokensUsedType0.from_dict(data) return tokens_used_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentResponseTokensUsedType0 | None | Unset, data) + return cast(None | OperatorResponseTokensUsedType0 | Unset, data) tokens_used = _parse_tokens_used(d.pop("tokens_used", UNSET)) @@ -213,7 +221,7 @@ def _parse_operation_id(data: object) -> None | str | Unset: def _parse_error_details( data: object, - ) -> AgentResponseErrorDetailsType0 | None | Unset: + ) -> None | OperatorResponseErrorDetailsType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -221,12 +229,12 @@ def _parse_error_details( try: if not isinstance(data, dict): raise TypeError() - error_details_type_0 = AgentResponseErrorDetailsType0.from_dict(data) + error_details_type_0 = OperatorResponseErrorDetailsType0.from_dict(data) return error_details_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentResponseErrorDetailsType0 | None | Unset, data) + return cast(None | OperatorResponseErrorDetailsType0 | Unset, data) error_details = _parse_error_details(d.pop("error_details", UNSET)) @@ -246,9 +254,9 @@ def _parse_execution_time(data: object) -> float | None | Unset: else: timestamp = isoparse(_timestamp) - agent_response = cls( + operator_response = cls( content=content, - agent_used=agent_used, + operator_used=operator_used, mode_used=mode_used, metadata=metadata, tokens_used=tokens_used, @@ -260,8 +268,8 @@ def _parse_execution_time(data: object) -> float | None | Unset: timestamp=timestamp, ) - agent_response.additional_properties = d - return agent_response + operator_response.additional_properties = d + return operator_response @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_response_error_details_type_0.py b/robosystems_client/models/operator_response_error_details_type_0.py similarity index 78% rename from robosystems_client/models/agent_response_error_details_type_0.py rename to robosystems_client/models/operator_response_error_details_type_0.py index bd621e9..9d6ca00 100644 --- a/robosystems_client/models/agent_response_error_details_type_0.py +++ b/robosystems_client/models/operator_response_error_details_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentResponseErrorDetailsType0") +T = TypeVar("T", bound="OperatorResponseErrorDetailsType0") @_attrs_define -class AgentResponseErrorDetailsType0: +class OperatorResponseErrorDetailsType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_response_error_details_type_0 = cls() + operator_response_error_details_type_0 = cls() - agent_response_error_details_type_0.additional_properties = d - return agent_response_error_details_type_0 + operator_response_error_details_type_0.additional_properties = d + return operator_response_error_details_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_response_metadata_type_0.py b/robosystems_client/models/operator_response_metadata_type_0.py similarity index 80% rename from robosystems_client/models/agent_response_metadata_type_0.py rename to robosystems_client/models/operator_response_metadata_type_0.py index 0518061..242fee1 100644 --- a/robosystems_client/models/agent_response_metadata_type_0.py +++ b/robosystems_client/models/operator_response_metadata_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentResponseMetadataType0") +T = TypeVar("T", bound="OperatorResponseMetadataType0") @_attrs_define -class AgentResponseMetadataType0: +class OperatorResponseMetadataType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_response_metadata_type_0 = cls() + operator_response_metadata_type_0 = cls() - agent_response_metadata_type_0.additional_properties = d - return agent_response_metadata_type_0 + operator_response_metadata_type_0.additional_properties = d + return operator_response_metadata_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/agent_response_tokens_used_type_0.py b/robosystems_client/models/operator_response_tokens_used_type_0.py similarity index 79% rename from robosystems_client/models/agent_response_tokens_used_type_0.py rename to robosystems_client/models/operator_response_tokens_used_type_0.py index 0ab609c..a3f6306 100644 --- a/robosystems_client/models/agent_response_tokens_used_type_0.py +++ b/robosystems_client/models/operator_response_tokens_used_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="AgentResponseTokensUsedType0") +T = TypeVar("T", bound="OperatorResponseTokensUsedType0") @_attrs_define -class AgentResponseTokensUsedType0: +class OperatorResponseTokensUsedType0: """ """ additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - agent_response_tokens_used_type_0 = cls() + operator_response_tokens_used_type_0 = cls() - agent_response_tokens_used_type_0.additional_properties = d - return agent_response_tokens_used_type_0 + operator_response_tokens_used_type_0.additional_properties = d + return operator_response_tokens_used_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/selection_criteria.py b/robosystems_client/models/selection_criteria.py index fc582b3..34920d6 100644 --- a/robosystems_client/models/selection_criteria.py +++ b/robosystems_client/models/selection_criteria.py @@ -6,7 +6,7 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..models.agent_mode import AgentMode +from ..models.operator_mode import OperatorMode from ..types import UNSET, Unset T = TypeVar("T", bound="SelectionCriteria") @@ -14,21 +14,21 @@ @_attrs_define class SelectionCriteria: - """Criteria for agent selection. + """Criteria for operator selection. Attributes: min_confidence (float | Unset): Minimum confidence score Default: 0.3. - required_capabilities (list[str] | Unset): Required agent capabilities - preferred_mode (AgentMode | None | Unset): Preferred execution mode + required_capabilities (list[str] | Unset): Required operator capabilities + preferred_mode (None | OperatorMode | Unset): Preferred execution mode max_response_time (float | Unset): Maximum response time in seconds Default: 60.0. - excluded_agents (list[str] | Unset): Agents to exclude from selection + excluded_operators (list[str] | Unset): Operators to exclude from selection """ min_confidence: float | Unset = 0.3 required_capabilities: list[str] | Unset = UNSET - preferred_mode: AgentMode | None | Unset = UNSET + preferred_mode: None | OperatorMode | Unset = UNSET max_response_time: float | Unset = 60.0 - excluded_agents: list[str] | Unset = UNSET + excluded_operators: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,16 +41,16 @@ def to_dict(self) -> dict[str, Any]: preferred_mode: None | str | Unset if isinstance(self.preferred_mode, Unset): preferred_mode = UNSET - elif isinstance(self.preferred_mode, AgentMode): + elif isinstance(self.preferred_mode, OperatorMode): preferred_mode = self.preferred_mode.value else: preferred_mode = self.preferred_mode max_response_time = self.max_response_time - excluded_agents: list[str] | Unset = UNSET - if not isinstance(self.excluded_agents, Unset): - excluded_agents = self.excluded_agents + excluded_operators: list[str] | Unset = UNSET + if not isinstance(self.excluded_operators, Unset): + excluded_operators = self.excluded_operators field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) @@ -63,8 +63,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["preferred_mode"] = preferred_mode if max_response_time is not UNSET: field_dict["max_response_time"] = max_response_time - if excluded_agents is not UNSET: - field_dict["excluded_agents"] = excluded_agents + if excluded_operators is not UNSET: + field_dict["excluded_operators"] = excluded_operators return field_dict @@ -75,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required_capabilities = cast(list[str], d.pop("required_capabilities", UNSET)) - def _parse_preferred_mode(data: object) -> AgentMode | None | Unset: + def _parse_preferred_mode(data: object) -> None | OperatorMode | Unset: if data is None: return data if isinstance(data, Unset): @@ -83,25 +83,25 @@ def _parse_preferred_mode(data: object) -> AgentMode | None | Unset: try: if not isinstance(data, str): raise TypeError() - preferred_mode_type_0 = AgentMode(data) + preferred_mode_type_0 = OperatorMode(data) return preferred_mode_type_0 except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(AgentMode | None | Unset, data) + return cast(None | OperatorMode | Unset, data) preferred_mode = _parse_preferred_mode(d.pop("preferred_mode", UNSET)) max_response_time = d.pop("max_response_time", UNSET) - excluded_agents = cast(list[str], d.pop("excluded_agents", UNSET)) + excluded_operators = cast(list[str], d.pop("excluded_operators", UNSET)) selection_criteria = cls( min_confidence=min_confidence, required_capabilities=required_capabilities, preferred_mode=preferred_mode, max_response_time=max_response_time, - excluded_agents=excluded_agents, + excluded_operators=excluded_operators, ) selection_criteria.additional_properties = d diff --git a/tests/test_agent_client.py b/tests/test_operator_client.py similarity index 51% rename from tests/test_agent_client.py rename to tests/test_operator_client.py index ff09220..cd3f30f 100644 --- a/tests/test_agent_client.py +++ b/tests/test_operator_client.py @@ -1,24 +1,24 @@ -"""Unit tests for AgentClient.""" +"""Unit tests for OperatorClient.""" import pytest from unittest.mock import Mock, patch -from robosystems_client.clients.agent_client import ( - AgentClient, - AgentQueryRequest, - AgentOptions, - AgentResult, - QueuedAgentResponse, - QueuedAgentError, +from robosystems_client.clients.operator_client import ( + OperatorClient, + OperatorQueryRequest, + OperatorOptions, + OperatorResult, + QueuedOperatorResponse, + QueuedOperatorError, ) @pytest.mark.unit -class TestAgentDataclasses: - """Test suite for agent-related dataclasses.""" +class TestOperatorDataclasses: + """Test suite for operator-related dataclasses.""" - def test_agent_query_request(self): - """Test AgentQueryRequest dataclass.""" - request = AgentQueryRequest( + def test_operator_query_request(self): + """Test OperatorQueryRequest dataclass.""" + request = OperatorQueryRequest( message="What is the revenue?", history=[{"role": "user", "content": "Hello"}], context={"fiscal_year": 2024}, @@ -34,9 +34,9 @@ def test_agent_query_request(self): assert request.enable_rag is True assert request.force_extended_analysis is False - def test_agent_query_request_defaults(self): - """Test AgentQueryRequest default values.""" - request = AgentQueryRequest(message="Simple query") + def test_operator_query_request_defaults(self): + """Test OperatorQueryRequest default values.""" + request = OperatorQueryRequest(message="Simple query") assert request.message == "Simple query" assert request.history is None @@ -45,28 +45,28 @@ def test_agent_query_request_defaults(self): assert request.enable_rag is None assert request.force_extended_analysis is None - def test_agent_options_defaults(self): - """Test AgentOptions default values.""" - options = AgentOptions() + def test_operator_options_defaults(self): + """Test OperatorOptions default values.""" + options = OperatorOptions() assert options.mode == "auto" assert options.max_wait is None assert options.on_progress is None - def test_agent_options_custom(self): - """Test AgentOptions with custom values.""" + def test_operator_options_custom(self): + """Test OperatorOptions with custom values.""" progress_fn = Mock() - options = AgentOptions(mode="sync", max_wait=30, on_progress=progress_fn) + options = OperatorOptions(mode="sync", max_wait=30, on_progress=progress_fn) assert options.mode == "sync" assert options.max_wait == 30 assert options.on_progress is progress_fn - def test_agent_result(self): - """Test AgentResult dataclass.""" - result = AgentResult( + def test_operator_result(self): + """Test OperatorResult dataclass.""" + result = OperatorResult( content="Revenue is $1B", - agent_used="financial", + operator_used="financial", mode_used="standard", metadata={"graph_id": "g-123"}, tokens_used={"input": 100, "output": 50}, @@ -76,14 +76,14 @@ def test_agent_result(self): ) assert result.content == "Revenue is $1B" - assert result.agent_used == "financial" + assert result.operator_used == "financial" assert result.mode_used == "standard" assert result.confidence_score == 0.95 assert result.execution_time == 1.5 - def test_agent_result_defaults(self): - """Test AgentResult with minimal fields.""" - result = AgentResult(content="Answer", agent_used="rag", mode_used="quick") + def test_operator_result_defaults(self): + """Test OperatorResult with minimal fields.""" + result = OperatorResult(content="Answer", operator_used="rag", mode_used="quick") assert result.metadata is None assert result.tokens_used is None @@ -91,46 +91,46 @@ def test_agent_result_defaults(self): assert result.execution_time is None assert result.timestamp is None - def test_queued_agent_response(self): - """Test QueuedAgentResponse dataclass.""" - response = QueuedAgentResponse( + def test_queued_operator_response(self): + """Test QueuedOperatorResponse dataclass.""" + response = QueuedOperatorResponse( status="queued", - operation_id="op-agent-1", - message="Agent execution queued", - sse_endpoint="/v1/operations/op-agent-1/stream", + operation_id="op-operator-1", + message="Operator execution queued", + sse_endpoint="/v1/operations/op-operator-1/stream", ) assert response.status == "queued" - assert response.operation_id == "op-agent-1" - assert response.message == "Agent execution queued" - assert response.sse_endpoint == "/v1/operations/op-agent-1/stream" + assert response.operation_id == "op-operator-1" + assert response.message == "Operator execution queued" + assert response.sse_endpoint == "/v1/operations/op-operator-1/stream" - def test_queued_agent_response_defaults(self): - """Test QueuedAgentResponse defaults.""" - response = QueuedAgentResponse( + def test_queued_operator_response_defaults(self): + """Test QueuedOperatorResponse defaults.""" + response = QueuedOperatorResponse( status="queued", operation_id="op-1", message="Queued" ) assert response.sse_endpoint is None - def test_queued_agent_error(self): - """Test QueuedAgentError exception.""" - queue_info = QueuedAgentResponse( + def test_queued_operator_error(self): + """Test QueuedOperatorError exception.""" + queue_info = QueuedOperatorResponse( status="queued", operation_id="op-err", message="Queued" ) - error = QueuedAgentError(queue_info) + error = QueuedOperatorError(queue_info) - assert str(error) == "Agent execution was queued" + assert str(error) == "Operator execution was queued" assert error.queue_info.operation_id == "op-err" @pytest.mark.unit -class TestAgentClientInit: - """Test suite for AgentClient initialization.""" +class TestOperatorClientInit: + """Test suite for OperatorClient initialization.""" def test_client_initialization(self, mock_config): """Test that client initializes correctly with config.""" - client = AgentClient(mock_config) + client = OperatorClient(mock_config) assert client.base_url == "http://localhost:8000" assert client.token == "test-api-key" @@ -139,12 +139,12 @@ def test_client_initialization(self, mock_config): def test_close_without_sse(self, mock_config): """Test close when no SSE client exists.""" - client = AgentClient(mock_config) + client = OperatorClient(mock_config) client.close() # Should not raise def test_close_with_sse(self, mock_config): """Test close cleans up SSE client.""" - client = AgentClient(mock_config) + client = OperatorClient(mock_config) client.sse_client = Mock() client.close() @@ -152,16 +152,16 @@ def test_close_with_sse(self, mock_config): @pytest.mark.unit -class TestAgentExecuteQuery: - """Test suite for AgentClient.execute_query method.""" +class TestOperatorExecuteQuery: + """Test suite for OperatorClient.execute_query method.""" - @patch("robosystems_client.clients.agent_client.auto_select_agent") + @patch("robosystems_client.clients.operator_client.auto_select_operator") def test_execute_query_dict_response(self, mock_auto, mock_config, graph_id): """Test execute_query with dict response.""" mock_resp = Mock() mock_resp.parsed = { "content": "Revenue is $1B for FY2024.", - "agent_used": "financial", + "operator_used": "financial", "mode_used": "standard", "metadata": {}, "tokens_used": {"input": 100, "output": 50}, @@ -171,91 +171,91 @@ def test_execute_query_dict_response(self, mock_auto, mock_config, graph_id): } mock_auto.return_value = mock_resp - client = AgentClient(mock_config) - request = AgentQueryRequest(message="What is revenue?") + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="What is revenue?") result = client.execute_query(graph_id, request) assert result.content == "Revenue is $1B for FY2024." - assert result.agent_used == "financial" + assert result.operator_used == "financial" assert result.confidence_score == 0.9 - @patch("robosystems_client.clients.agent_client.auto_select_agent") + @patch("robosystems_client.clients.operator_client.auto_select_operator") def test_execute_query_queued_max_wait_zero(self, mock_auto, mock_config, graph_id): - """Test execute_query raises QueuedAgentError when max_wait=0.""" + """Test execute_query raises QueuedOperatorError when max_wait=0.""" mock_resp = Mock() mock_resp.parsed = { "operation_id": "op-queued", "status": "queued", - "message": "Agent execution queued", + "message": "Operator execution queued", } mock_auto.return_value = mock_resp - client = AgentClient(mock_config) - request = AgentQueryRequest(message="Complex query") - options = AgentOptions(max_wait=0) + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="Complex query") + options = OperatorOptions(max_wait=0) - with pytest.raises(QueuedAgentError) as exc_info: + with pytest.raises(QueuedOperatorError) as exc_info: client.execute_query(graph_id, request, options) assert exc_info.value.queue_info.operation_id == "op-queued" - @patch("robosystems_client.clients.agent_client.auto_select_agent") + @patch("robosystems_client.clients.operator_client.auto_select_operator") def test_execute_query_no_token(self, mock_auto, mock_config, graph_id): """Test execute_query fails without token.""" mock_config["token"] = None - client = AgentClient(mock_config) - request = AgentQueryRequest(message="test") + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="test") with pytest.raises(Exception, match="Authentication failed|No API key"): client.execute_query(graph_id, request) - @patch("robosystems_client.clients.agent_client.auto_select_agent") + @patch("robosystems_client.clients.operator_client.auto_select_operator") def test_execute_query_auth_error(self, mock_auto, mock_config, graph_id): """Test execute_query wraps 401 errors.""" mock_auto.side_effect = Exception("401 Unauthorized") - client = AgentClient(mock_config) - request = AgentQueryRequest(message="test") + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="test") with pytest.raises(Exception, match="Authentication failed"): client.execute_query(graph_id, request) - @patch("robosystems_client.clients.agent_client.auto_select_agent") + @patch("robosystems_client.clients.operator_client.auto_select_operator") def test_execute_query_generic_error(self, mock_auto, mock_config, graph_id): """Test execute_query wraps generic errors.""" mock_auto.side_effect = Exception("Connection timeout") - client = AgentClient(mock_config) - request = AgentQueryRequest(message="test") + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="test") - with pytest.raises(Exception, match="Agent execution failed"): + with pytest.raises(Exception, match="Operator execution failed"): client.execute_query(graph_id, request) @pytest.mark.unit -class TestAgentExecuteSpecific: - """Test suite for AgentClient.execute_agent method.""" +class TestOperatorExecuteSpecific: + """Test suite for OperatorClient.execute_operator method.""" - @patch("robosystems_client.clients.agent_client.execute_specific_agent") - def test_execute_specific_agent(self, mock_exec, mock_config, graph_id): - """Test executing a specific agent type.""" + @patch("robosystems_client.clients.operator_client.execute_specific_operator") + def test_execute_specific_operator(self, mock_exec, mock_config, graph_id): + """Test executing a specific operator type.""" mock_resp = Mock() mock_resp.parsed = { "content": "Deep analysis of financials.", - "agent_used": "financial", + "operator_used": "financial", "mode_used": "extended", } mock_exec.return_value = mock_resp - client = AgentClient(mock_config) - request = AgentQueryRequest(message="Analyze financials") - result = client.execute_agent(graph_id, "financial", request) + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="Analyze financials") + result = client.execute_operator(graph_id, "financial", request) assert result.content == "Deep analysis of financials." - assert result.agent_used == "financial" + assert result.operator_used == "financial" - @patch("robosystems_client.clients.agent_client.execute_specific_agent") - def test_execute_specific_agent_queued(self, mock_exec, mock_config, graph_id): + @patch("robosystems_client.clients.operator_client.execute_specific_operator") + def test_execute_specific_operator_queued(self, mock_exec, mock_config, graph_id): """Test specific agent returns queued response.""" mock_resp = Mock() mock_resp.parsed = { @@ -265,71 +265,71 @@ def test_execute_specific_agent_queued(self, mock_exec, mock_config, graph_id): } mock_exec.return_value = mock_resp - client = AgentClient(mock_config) - request = AgentQueryRequest(message="Heavy analysis") - options = AgentOptions(max_wait=0) + client = OperatorClient(mock_config) + request = OperatorQueryRequest(message="Heavy analysis") + options = OperatorOptions(max_wait=0) - with pytest.raises(QueuedAgentError) as exc_info: - client.execute_agent(graph_id, "research", request, options) + with pytest.raises(QueuedOperatorError) as exc_info: + client.execute_operator(graph_id, "research", request, options) assert exc_info.value.queue_info.operation_id == "op-specific-queued" @pytest.mark.unit -class TestAgentConvenienceMethods: +class TestOperatorConvenienceMethods: """Test suite for convenience methods.""" - @patch.object(AgentClient, "execute_query") + @patch.object(OperatorClient, "execute_query") def test_query_convenience(self, mock_exec, mock_config, graph_id): """Test query() convenience method.""" - mock_exec.return_value = AgentResult( - content="Answer", agent_used="rag", mode_used="quick" + mock_exec.return_value = OperatorResult( + content="Answer", operator_used="rag", mode_used="quick" ) - client = AgentClient(mock_config) + client = OperatorClient(mock_config) result = client.query(graph_id, "What is X?") assert result.content == "Answer" mock_exec.assert_called_once() - @patch.object(AgentClient, "execute_agent") + @patch.object(OperatorClient, "execute_operator") def test_analyze_financials_convenience(self, mock_exec, mock_config, graph_id): """Test analyze_financials() convenience method.""" - mock_exec.return_value = AgentResult( - content="Financial analysis", agent_used="financial", mode_used="standard" + mock_exec.return_value = OperatorResult( + content="Financial analysis", operator_used="financial", mode_used="standard" ) - client = AgentClient(mock_config) + client = OperatorClient(mock_config) result = client.analyze_financials(graph_id, "Analyze revenue trends") - assert result.agent_used == "financial" + assert result.operator_used == "financial" call_args = mock_exec.call_args - assert call_args[0][1] == "financial" # agent_type + assert call_args[0][1] == "financial" # operator_type - @patch.object(AgentClient, "execute_agent") + @patch.object(OperatorClient, "execute_operator") def test_research_convenience(self, mock_exec, mock_config, graph_id): """Test research() convenience method.""" - mock_exec.return_value = AgentResult( - content="Research results", agent_used="research", mode_used="extended" + mock_exec.return_value = OperatorResult( + content="Research results", operator_used="research", mode_used="extended" ) - client = AgentClient(mock_config) + client = OperatorClient(mock_config) result = client.research(graph_id, "Deep dive into market") - assert result.agent_used == "research" + assert result.operator_used == "research" call_args = mock_exec.call_args assert call_args[0][1] == "research" - @patch.object(AgentClient, "execute_agent") + @patch.object(OperatorClient, "execute_operator") def test_rag_convenience(self, mock_exec, mock_config, graph_id): """Test rag() convenience method.""" - mock_exec.return_value = AgentResult( - content="RAG answer", agent_used="rag", mode_used="quick" + mock_exec.return_value = OperatorResult( + content="RAG answer", operator_used="rag", mode_used="quick" ) - client = AgentClient(mock_config) + client = OperatorClient(mock_config) result = client.rag(graph_id, "Quick lookup") - assert result.agent_used == "rag" + assert result.operator_used == "rag" call_args = mock_exec.call_args assert call_args[0][1] == "rag"