From 377e39b95a1f72a008bb2bcb1efa5222e168e585 Mon Sep 17 00:00:00 2001 From: hasangzl <21182018+hasangzl@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:51:36 +0000 Subject: [PATCH] feat: regenerate SDK client core from Otari OpenAPI spec --- sdk-endpoints.txt | 15 +- src/otari/_client/__init__.py | 36 +- src/otari/_client/api/__init__.py | 1 + src/otari/_client/api/health_checks_api.py | 1304 ++++++++++ src/otari/_client/api/hosted_providers_api.py | 283 ++- src/otari/_client/api/mcp_servers_api.py | 596 ++++- .../_client/api/organization_traces_api.py | 82 +- src/otari/_client/api/providers_api.py | 2103 +---------------- src/otari/_client/api/search_tools_api.py | 6 +- src/otari/_client/api/traces_api.py | 82 +- src/otari/_client/models/__init__.py | 17 +- src/otari/_client/models/check_failure.py | 49 + .../models/create_stored_provider_request.py | 117 - .../_client/models/deployment_bootstrap.py | 2 +- .../deployment_provider_migration_public.py | 2 +- ...eployment_provider_migration_row_public.py | 2 +- ...s_response.py => health_check_disabled.py} | 20 +- ...quest.py => health_check_result_public.py} | 76 +- ...response.py => health_check_run_public.py} | 41 +- .../models/health_check_settings_public.py | 110 + .../models/health_check_settings_update.py | 136 ++ .../_client/models/health_check_status.py | 133 ++ .../models/hosted_provider_create_request.py | 10 +- .../_client/models/hosted_provider_public.py | 6 +- .../models/hosted_provider_update_request.py | 11 +- .../_client/models/provider_health_summary.py | 120 + .../_client/models/provider_history_point.py | 93 + .../_client/models/provider_info_schema.py | 6 +- src/otari/_client/models/span_public.py | 25 +- .../models/stored_provider_response.py | 127 - .../_client/models/trace_bucket_public.py | 4 +- .../_client/models/trace_summary_public.py | 2 +- src/otari/_client/models/turn_public.py | 4 +- ... => workspace_mcp_server_check_request.py} | 60 +- .../models/workspace_mcp_server_health.py | 123 + .../models/workspace_mcp_server_public.py | 15 +- 36 files changed, 3372 insertions(+), 2447 deletions(-) create mode 100644 src/otari/_client/api/health_checks_api.py create mode 100644 src/otari/_client/models/check_failure.py delete mode 100644 src/otari/_client/models/create_stored_provider_request.py rename src/otari/_client/models/{reencrypt_provider_credentials_response.py => health_check_disabled.py} (66%) rename src/otari/_client/models/{update_stored_provider_request.py => health_check_result_public.py} (50%) rename src/otari/_client/models/{test_provider_response.py => health_check_run_public.py} (65%) create mode 100644 src/otari/_client/models/health_check_settings_public.py create mode 100644 src/otari/_client/models/health_check_settings_update.py create mode 100644 src/otari/_client/models/health_check_status.py create mode 100644 src/otari/_client/models/provider_health_summary.py create mode 100644 src/otari/_client/models/provider_history_point.py delete mode 100644 src/otari/_client/models/stored_provider_response.py rename src/otari/_client/models/{test_provider_request.py => workspace_mcp_server_check_request.py} (52%) create mode 100644 src/otari/_client/models/workspace_mcp_server_health.py diff --git a/sdk-endpoints.txt b/sdk-endpoints.txt index cbd14ea0..0b8ba051 100644 --- a/sdk-endpoints.txt +++ b/sdk-endpoints.txt @@ -137,6 +137,7 @@ POST /api/v1/hosted-providers/test # dashboard-only POST /api/v1/hosted-providers/reencrypt # dashboard-only GET /api/v1/hosted-providers/migration # dashboard-only POST /api/v1/hosted-providers/migration # dashboard-only +DELETE /api/v1/hosted-providers/migration/{instance} # dashboard-only PATCH /api/v1/hosted-providers/{provider} # dashboard-only DELETE /api/v1/hosted-providers/{provider} # dashboard-only GET /api/v1/hosted-providers/{provider}/models # dashboard-only @@ -146,12 +147,6 @@ GET /api/v1/hosted-providers/{provider}/available-models # dashb PATCH /api/v1/hosted-providers/{provider}/models/{model_id} # dashboard-only DELETE /api/v1/hosted-providers/{provider}/models/{model_id} # dashboard-only # Provider credentials (runtime provider management) -GET /api/v1/provider-credentials # not yet wrapped -POST /api/v1/provider-credentials # not yet wrapped -POST /api/v1/provider-credentials/test # not yet wrapped -PATCH /api/v1/provider-credentials/{instance} # not yet wrapped -DELETE /api/v1/provider-credentials/{instance} # not yet wrapped -POST /api/v1/provider-credentials/{instance}/test # not yet wrapped # Providers catalog GET /api/v1/providers # not yet wrapped GET /api/v1/providers/catalog # not yet wrapped @@ -165,6 +160,11 @@ GET /api/v1/settings # not yet wrapped PATCH /api/v1/settings # not yet wrapped GET /api/v1/settings/mail # not yet wrapped POST /api/v1/settings/mail/test # not yet wrapped +GET /api/v1/health-checks # operator dashboard only +POST /api/v1/health-checks/disable-failing # operator dashboard only +POST /api/v1/health-checks/run # operator dashboard only +GET /api/v1/health-checks/settings # operator dashboard only +PATCH /api/v1/health-checks/settings # operator dashboard only GET /api/v1/settings/maintenance-mode # not yet wrapped PATCH /api/v1/settings/maintenance-mode # not yet wrapped # Model discovery / metadata @@ -298,7 +298,6 @@ POST /api/v1/catalog/selectors/refresh # not yet wrapped # Providers GET /api/v1/providers/catalog/{provider_id} # not yet wrapped GET /api/v1/providers/health # not yet wrapped -POST /api/v1/provider-credentials/reencrypt # not yet wrapped # Built-in tool settings and search GET /api/v1/tools # not yet wrapped GET /api/v1/tool-settings # not yet wrapped @@ -508,8 +507,10 @@ DELETE /api/v1/workspaces/{workspace_id}/web-search-keys/{key_id} # # by id in `mcp_server_ids` on a completion request, which is already covered. GET /api/v1/workspaces/{workspace_id}/mcp-servers # operator surface POST /api/v1/workspaces/{workspace_id}/mcp-servers # operator surface +POST /api/v1/workspaces/{workspace_id}/mcp-servers/check # operator surface PATCH /api/v1/workspaces/{workspace_id}/mcp-servers/{server_id} # operator surface DELETE /api/v1/workspaces/{workspace_id}/mcp-servers/{server_id} # operator surface +POST /api/v1/workspaces/{workspace_id}/mcp-servers/{server_id}/check # operator surface # Web-search backend (otari#882): the SearXNG-shaped endpoint one gateway calls # on another, authenticated by a shared deployment token rather than an API key. # Its caller is a data-plane gateway, not an application, and no SDK holds that diff --git a/src/otari/_client/__init__.py b/src/otari/_client/__init__.py index 9e58894b..8fddd2b6 100644 --- a/src/otari/_client/__init__.py +++ b/src/otari/_client/__init__.py @@ -34,6 +34,7 @@ "FeedbackApi", "FilesApi", "HealthApi", + "HealthChecksApi", "HooksApi", "HostedProvidersApi", "ImagesApi", @@ -210,6 +211,7 @@ "ChatCompletionRequest", "ChatCompletionRequestToolsInner", "ChatMessageInput", + "CheckFailure", "CheckVerdictRequest", "ChoiceQuestion", "CodeExecutor", @@ -247,7 +249,6 @@ "CreateScopedBudgetRequest", "CreateSearchToolRequest", "CreateSessionRequest", - "CreateStoredProviderRequest", "CreateUserRequest", "CreatedSearchToolSchema", "CriteriaInner", @@ -306,6 +307,12 @@ "GuardrailProfileSpec", "GuardrailStage", "HTTPValidationError", + "HealthCheckDisabled", + "HealthCheckResultPublic", + "HealthCheckRunPublic", + "HealthCheckSettingsPublic", + "HealthCheckSettingsUpdate", + "HealthCheckStatus", "HostedAvailableModelsPublic", "HostedCatalogKeptGroupPublic", "HostedCatalogProviderRefreshPublic", @@ -614,6 +621,8 @@ "ProviderEndpointsPublic", "ProviderHealthResponse", "ProviderHealthSchema", + "ProviderHealthSummary", + "ProviderHistoryPoint", "ProviderInfoSchema", "ProvidersResponse", "QuestionsValue", @@ -627,7 +636,6 @@ "RateLimitRuleUpdate", "RateLimitRulesPublic", "RecordedPool", - "ReencryptProviderCredentialsResponse", "ReencryptSearchToolsResponse", "RegisterPasskeyRequest", "RequestPasswordResetRequest", @@ -676,14 +684,11 @@ "SpanPublic", "State", "Stop", - "StoredProviderResponse", "StoredSearchToolSchema", "StoredSearchToolTestRequest", "SwitchActiveOrganizationRequest", "System", "TaskPool", - "TestProviderRequest", - "TestProviderResponse", "TestServiceRequest", "TestServiceResponse", "TextContent", @@ -715,7 +720,6 @@ "UpdateScopedBudgetRequest", "UpdateSearchToolRequest", "UpdateSettingsRequest", - "UpdateStoredProviderRequest", "UpdateToolSettingsRequest", "UpdateUserRequest", "UsageCount", @@ -753,7 +757,9 @@ "WorkspaceCodeExecutionPolicyPublic", "WorkspaceCodeExecutionPolicyUpdate", "WorkspaceCreate", + "WorkspaceMcpServerCheckRequest", "WorkspaceMcpServerCreate", + "WorkspaceMcpServerHealth", "WorkspaceMcpServerPublic", "WorkspaceMcpServerUpdate", "WorkspaceMcpServersPublic", @@ -796,6 +802,7 @@ from otari._client.api.feedback_api import FeedbackApi as FeedbackApi from otari._client.api.files_api import FilesApi as FilesApi from otari._client.api.health_api import HealthApi as HealthApi +from otari._client.api.health_checks_api import HealthChecksApi as HealthChecksApi from otari._client.api.hooks_api import HooksApi as HooksApi from otari._client.api.hosted_providers_api import HostedProvidersApi as HostedProvidersApi from otari._client.api.images_api import ImagesApi as ImagesApi @@ -976,6 +983,7 @@ from otari._client.models.chat_completion_request import ChatCompletionRequest as ChatCompletionRequest from otari._client.models.chat_completion_request_tools_inner import ChatCompletionRequestToolsInner as ChatCompletionRequestToolsInner from otari._client.models.chat_message_input import ChatMessageInput as ChatMessageInput +from otari._client.models.check_failure import CheckFailure as CheckFailure from otari._client.models.check_verdict_request import CheckVerdictRequest as CheckVerdictRequest from otari._client.models.choice_question import ChoiceQuestion as ChoiceQuestion from otari._client.models.code_executor import CodeExecutor as CodeExecutor @@ -1013,7 +1021,6 @@ from otari._client.models.create_scoped_budget_request import CreateScopedBudgetRequest as CreateScopedBudgetRequest from otari._client.models.create_search_tool_request import CreateSearchToolRequest as CreateSearchToolRequest from otari._client.models.create_session_request import CreateSessionRequest as CreateSessionRequest -from otari._client.models.create_stored_provider_request import CreateStoredProviderRequest as CreateStoredProviderRequest from otari._client.models.create_user_request import CreateUserRequest as CreateUserRequest from otari._client.models.created_search_tool_schema import CreatedSearchToolSchema as CreatedSearchToolSchema from otari._client.models.criteria_inner import CriteriaInner as CriteriaInner @@ -1072,6 +1079,12 @@ from otari._client.models.guardrail_profile_spec import GuardrailProfileSpec as GuardrailProfileSpec from otari._client.models.guardrail_stage import GuardrailStage as GuardrailStage from otari._client.models.http_validation_error import HTTPValidationError as HTTPValidationError +from otari._client.models.health_check_disabled import HealthCheckDisabled as HealthCheckDisabled +from otari._client.models.health_check_result_public import HealthCheckResultPublic as HealthCheckResultPublic +from otari._client.models.health_check_run_public import HealthCheckRunPublic as HealthCheckRunPublic +from otari._client.models.health_check_settings_public import HealthCheckSettingsPublic as HealthCheckSettingsPublic +from otari._client.models.health_check_settings_update import HealthCheckSettingsUpdate as HealthCheckSettingsUpdate +from otari._client.models.health_check_status import HealthCheckStatus as HealthCheckStatus from otari._client.models.hosted_available_models_public import HostedAvailableModelsPublic as HostedAvailableModelsPublic from otari._client.models.hosted_catalog_kept_group_public import HostedCatalogKeptGroupPublic as HostedCatalogKeptGroupPublic from otari._client.models.hosted_catalog_provider_refresh_public import HostedCatalogProviderRefreshPublic as HostedCatalogProviderRefreshPublic @@ -1380,6 +1393,8 @@ from otari._client.models.provider_endpoints_public import ProviderEndpointsPublic as ProviderEndpointsPublic from otari._client.models.provider_health_response import ProviderHealthResponse as ProviderHealthResponse from otari._client.models.provider_health_schema import ProviderHealthSchema as ProviderHealthSchema +from otari._client.models.provider_health_summary import ProviderHealthSummary as ProviderHealthSummary +from otari._client.models.provider_history_point import ProviderHistoryPoint as ProviderHistoryPoint from otari._client.models.provider_info_schema import ProviderInfoSchema as ProviderInfoSchema from otari._client.models.providers_response import ProvidersResponse as ProvidersResponse from otari._client.models.questions_value import QuestionsValue as QuestionsValue @@ -1393,7 +1408,6 @@ from otari._client.models.rate_limit_rule_update import RateLimitRuleUpdate as RateLimitRuleUpdate from otari._client.models.rate_limit_rules_public import RateLimitRulesPublic as RateLimitRulesPublic from otari._client.models.recorded_pool import RecordedPool as RecordedPool -from otari._client.models.reencrypt_provider_credentials_response import ReencryptProviderCredentialsResponse as ReencryptProviderCredentialsResponse from otari._client.models.reencrypt_search_tools_response import ReencryptSearchToolsResponse as ReencryptSearchToolsResponse from otari._client.models.register_passkey_request import RegisterPasskeyRequest as RegisterPasskeyRequest from otari._client.models.request_password_reset_request import RequestPasswordResetRequest as RequestPasswordResetRequest @@ -1442,14 +1456,11 @@ from otari._client.models.span_public import SpanPublic as SpanPublic from otari._client.models.state import State as State from otari._client.models.stop import Stop as Stop -from otari._client.models.stored_provider_response import StoredProviderResponse as StoredProviderResponse from otari._client.models.stored_search_tool_schema import StoredSearchToolSchema as StoredSearchToolSchema from otari._client.models.stored_search_tool_test_request import StoredSearchToolTestRequest as StoredSearchToolTestRequest from otari._client.models.switch_active_organization_request import SwitchActiveOrganizationRequest as SwitchActiveOrganizationRequest from otari._client.models.system import System as System from otari._client.models.task_pool import TaskPool as TaskPool -from otari._client.models.test_provider_request import TestProviderRequest as TestProviderRequest -from otari._client.models.test_provider_response import TestProviderResponse as TestProviderResponse from otari._client.models.test_service_request import TestServiceRequest as TestServiceRequest from otari._client.models.test_service_response import TestServiceResponse as TestServiceResponse from otari._client.models.text_content import TextContent as TextContent @@ -1481,7 +1492,6 @@ from otari._client.models.update_scoped_budget_request import UpdateScopedBudgetRequest as UpdateScopedBudgetRequest from otari._client.models.update_search_tool_request import UpdateSearchToolRequest as UpdateSearchToolRequest from otari._client.models.update_settings_request import UpdateSettingsRequest as UpdateSettingsRequest -from otari._client.models.update_stored_provider_request import UpdateStoredProviderRequest as UpdateStoredProviderRequest from otari._client.models.update_tool_settings_request import UpdateToolSettingsRequest as UpdateToolSettingsRequest from otari._client.models.update_user_request import UpdateUserRequest as UpdateUserRequest from otari._client.models.usage_count import UsageCount as UsageCount @@ -1519,7 +1529,9 @@ from otari._client.models.workspace_code_execution_policy_public import WorkspaceCodeExecutionPolicyPublic as WorkspaceCodeExecutionPolicyPublic from otari._client.models.workspace_code_execution_policy_update import WorkspaceCodeExecutionPolicyUpdate as WorkspaceCodeExecutionPolicyUpdate from otari._client.models.workspace_create import WorkspaceCreate as WorkspaceCreate +from otari._client.models.workspace_mcp_server_check_request import WorkspaceMcpServerCheckRequest as WorkspaceMcpServerCheckRequest from otari._client.models.workspace_mcp_server_create import WorkspaceMcpServerCreate as WorkspaceMcpServerCreate +from otari._client.models.workspace_mcp_server_health import WorkspaceMcpServerHealth as WorkspaceMcpServerHealth from otari._client.models.workspace_mcp_server_public import WorkspaceMcpServerPublic as WorkspaceMcpServerPublic from otari._client.models.workspace_mcp_server_update import WorkspaceMcpServerUpdate as WorkspaceMcpServerUpdate from otari._client.models.workspace_mcp_servers_public import WorkspaceMcpServersPublic as WorkspaceMcpServersPublic diff --git a/src/otari/_client/api/__init__.py b/src/otari/_client/api/__init__.py index 485f52e2..61d3b78f 100644 --- a/src/otari/_client/api/__init__.py +++ b/src/otari/_client/api/__init__.py @@ -17,6 +17,7 @@ from otari._client.api.feedback_api import FeedbackApi from otari._client.api.files_api import FilesApi from otari._client.api.health_api import HealthApi +from otari._client.api.health_checks_api import HealthChecksApi from otari._client.api.hooks_api import HooksApi from otari._client.api.hosted_providers_api import HostedProvidersApi from otari._client.api.images_api import ImagesApi diff --git a/src/otari/_client/api/health_checks_api.py b/src/otari/_client/api/health_checks_api.py new file mode 100644 index 00000000..85a5e594 --- /dev/null +++ b/src/otari/_client/api/health_checks_api.py @@ -0,0 +1,1304 @@ +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from otari._client.models.health_check_disabled import HealthCheckDisabled +from otari._client.models.health_check_settings_public import HealthCheckSettingsPublic +from otari._client.models.health_check_settings_update import HealthCheckSettingsUpdate +from otari._client.models.health_check_status import HealthCheckStatus + +from otari._client.api_client import ApiClient, RequestSerialized +from otari._client.api_response import ApiResponse +from otari._client.rest import RESTResponseType + + +class HealthChecksApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def health_checks_disable_failing_models( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckDisabled: + """Disable Failing Models + + Stop serving every model the latest run found failing, on its hosted provider. Each stays listed on the Hosted providers page, priced, to be switched back on there. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_disable_failing_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckDisabled", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_checks_disable_failing_models_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckDisabled]: + """Disable Failing Models + + Stop serving every model the latest run found failing, on its hosted provider. Each stays listed on the Hosted providers page, priced, to be switched back on there. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_disable_failing_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckDisabled", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_checks_disable_failing_models_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Disable Failing Models + + Stop serving every model the latest run found failing, on its hosted provider. Each stays listed on the Hosted providers page, priced, to be switched back on there. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_disable_failing_models_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckDisabled", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _health_checks_disable_failing_models_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/health-checks/disable-failing', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def health_checks_get_health_check_settings( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckSettingsPublic: + """Get Health Check Settings + + Whether the checks run on a schedule, how often, and what they send. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_settings_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_checks_get_health_check_settings_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckSettingsPublic]: + """Get Health Check Settings + + Whether the checks run on a schedule, how often, and what they send. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_settings_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_checks_get_health_check_settings_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Health Check Settings + + Whether the checks run on a schedule, how often, and what they send. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_settings_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _health_checks_get_health_check_settings_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/health-checks/settings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def health_checks_get_health_check_status( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckStatus: + """Get Health Check Status + + The settings, the run in progress, and the latest finished run by provider and by offering. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_checks_get_health_check_status_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckStatus]: + """Get Health Check Status + + The settings, the run in progress, and the latest finished run by provider and by offering. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_checks_get_health_check_status_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Health Check Status + + The settings, the run in progress, and the latest finished run by provider and by offering. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_get_health_check_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _health_checks_get_health_check_status_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/health-checks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def health_checks_run_health_checks( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckSettingsPublic: + """Run Health Checks + + Start a run within a minute, whether or not the schedule is on. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_run_health_checks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_checks_run_health_checks_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckSettingsPublic]: + """Run Health Checks + + Start a run within a minute, whether or not the schedule is on. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_run_health_checks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_checks_run_health_checks_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Run Health Checks + + Start a run within a minute, whether or not the schedule is on. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_run_health_checks_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "HealthCheckSettingsPublic", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _health_checks_run_health_checks_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/health-checks/run', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def health_checks_update_health_check_settings( + self, + health_check_settings_update: HealthCheckSettingsUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HealthCheckSettingsPublic: + """Update Health Check Settings + + Change the settings. Turning the schedule on starts a run within a minute. + + :param health_check_settings_update: (required) + :type health_check_settings_update: HealthCheckSettingsUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_update_health_check_settings_serialize( + health_check_settings_update=health_check_settings_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def health_checks_update_health_check_settings_with_http_info( + self, + health_check_settings_update: HealthCheckSettingsUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HealthCheckSettingsPublic]: + """Update Health Check Settings + + Change the settings. Turning the schedule on starts a run within a minute. + + :param health_check_settings_update: (required) + :type health_check_settings_update: HealthCheckSettingsUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_update_health_check_settings_serialize( + health_check_settings_update=health_check_settings_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def health_checks_update_health_check_settings_without_preload_content( + self, + health_check_settings_update: HealthCheckSettingsUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Health Check Settings + + Change the settings. Turning the schedule on starts a run within a minute. + + :param health_check_settings_update: (required) + :type health_check_settings_update: HealthCheckSettingsUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._health_checks_update_health_check_settings_serialize( + health_check_settings_update=health_check_settings_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "HealthCheckSettingsPublic", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _health_checks_update_health_check_settings_serialize( + self, + health_check_settings_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if health_check_settings_update is not None: + _body_params = health_check_settings_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/health-checks/settings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/src/otari/_client/api/hosted_providers_api.py b/src/otari/_client/api/hosted_providers_api.py index 30e47c27..73cc8e2f 100644 --- a/src/otari/_client/api/hosted_providers_api.py +++ b/src/otari/_client/api/hosted_providers_api.py @@ -367,7 +367,7 @@ def hosted_providers_apply_deployment_provider_migration( ) -> DeploymentProviderMigrationPublic: """Apply Deployment Provider Migration - Move the deployment providers stored through the dashboard onto hosted providers of the same name. Each is created as a hosted provider, offering what it lists as a create does, and the deployment provider is removed once the hosted one offers a model. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. + Move the deployment providers the retired dashboard page stored onto hosted providers of the same name. Each is created as a hosted provider that serves models not on its roster, offering what it lists as a create does, and the deployment provider is removed. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. :param deployment_provider_migration_request: :type deployment_provider_migration_request: DeploymentProviderMigrationRequest @@ -435,7 +435,7 @@ def hosted_providers_apply_deployment_provider_migration_with_http_info( ) -> ApiResponse[DeploymentProviderMigrationPublic]: """Apply Deployment Provider Migration - Move the deployment providers stored through the dashboard onto hosted providers of the same name. Each is created as a hosted provider, offering what it lists as a create does, and the deployment provider is removed once the hosted one offers a model. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. + Move the deployment providers the retired dashboard page stored onto hosted providers of the same name. Each is created as a hosted provider that serves models not on its roster, offering what it lists as a create does, and the deployment provider is removed. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. :param deployment_provider_migration_request: :type deployment_provider_migration_request: DeploymentProviderMigrationRequest @@ -503,7 +503,7 @@ def hosted_providers_apply_deployment_provider_migration_without_preload_content ) -> RESTResponseType: """Apply Deployment Provider Migration - Move the deployment providers stored through the dashboard onto hosted providers of the same name. Each is created as a hosted provider, offering what it lists as a create does, and the deployment provider is removed once the hosted one offers a model. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. + Move the deployment providers the retired dashboard page stored onto hosted providers of the same name. Each is created as a hosted provider that serves models not on its roster, offering what it lists as a create does, and the deployment provider is removed. One that cannot move is reported and left in place. ``rows`` limits the move to the rows of the preview the caller reviewed, at the versions it was shown them. :param deployment_provider_migration_request: :type deployment_provider_migration_request: DeploymentProviderMigrationRequest @@ -1169,6 +1169,271 @@ def _hosted_providers_delete_hosted_provider_serialize( + @validate_call + def hosted_providers_discard_deployment_provider( + self, + instance: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Discard Deployment Provider + + Remove a deployment provider the move could not take, which serves nothing. + + :param instance: (required) + :type instance: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._hosted_providers_discard_deployment_provider_serialize( + instance=instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def hosted_providers_discard_deployment_provider_with_http_info( + self, + instance: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Discard Deployment Provider + + Remove a deployment provider the move could not take, which serves nothing. + + :param instance: (required) + :type instance: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._hosted_providers_discard_deployment_provider_serialize( + instance=instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def hosted_providers_discard_deployment_provider_without_preload_content( + self, + instance: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Discard Deployment Provider + + Remove a deployment provider the move could not take, which serves nothing. + + :param instance: (required) + :type instance: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._hosted_providers_discard_deployment_provider_serialize( + instance=instance, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _hosted_providers_discard_deployment_provider_serialize( + self, + instance, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance is not None: + _path_params['instance'] = instance + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/hosted-providers/migration/{instance}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def hosted_providers_list_available_models( self, @@ -2282,7 +2547,7 @@ def hosted_providers_preview_deployment_provider_migration( ) -> DeploymentProviderMigrationPublic: """Preview Deployment Provider Migration - What moving the deployment providers stored through the dashboard onto hosted providers would do. Writes nothing and dials nothing. + What moving the deployment providers the retired dashboard page stored onto hosted providers would do. The gateway moves them at startup, so this lists the ones it could not move, each with the reason. Writes nothing and dials nothing. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2345,7 +2610,7 @@ def hosted_providers_preview_deployment_provider_migration_with_http_info( ) -> ApiResponse[DeploymentProviderMigrationPublic]: """Preview Deployment Provider Migration - What moving the deployment providers stored through the dashboard onto hosted providers would do. Writes nothing and dials nothing. + What moving the deployment providers the retired dashboard page stored onto hosted providers would do. The gateway moves them at startup, so this lists the ones it could not move, each with the reason. Writes nothing and dials nothing. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2408,7 +2673,7 @@ def hosted_providers_preview_deployment_provider_migration_without_preload_conte ) -> RESTResponseType: """Preview Deployment Provider Migration - What moving the deployment providers stored through the dashboard onto hosted providers would do. Writes nothing and dials nothing. + What moving the deployment providers the retired dashboard page stored onto hosted providers would do. The gateway moves them at startup, so this lists the ones it could not move, each with the reason. Writes nothing and dials nothing. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2529,7 +2794,7 @@ def hosted_providers_reencrypt_hosted_providers( ) -> HostedProvidersReencryptPublic: """Reencrypt Hosted Providers - Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/provider-credentials/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. + Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/search-tools/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2592,7 +2857,7 @@ def hosted_providers_reencrypt_hosted_providers_with_http_info( ) -> ApiResponse[HostedProvidersReencryptPublic]: """Reencrypt Hosted Providers - Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/provider-credentials/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. + Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/search-tools/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2655,7 +2920,7 @@ def hosted_providers_reencrypt_hosted_providers_without_preload_content( ) -> RESTResponseType: """Reencrypt Hosted Providers - Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/provider-credentials/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. + Re-encrypt every stored key and set of client arguments with the primary ``OTARI_SECRET_KEY``. Run after rotating the key, alongside ``POST /api/v1/search-tools/reencrypt``. A provider no configured key reads is left as it is, to be re-entered. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/src/otari/_client/api/mcp_servers_api.py b/src/otari/_client/api/mcp_servers_api.py index f5a538e8..17c77cb0 100644 --- a/src/otari/_client/api/mcp_servers_api.py +++ b/src/otari/_client/api/mcp_servers_api.py @@ -20,7 +20,9 @@ from typing_extensions import Annotated from uuid import UUID from otari._client.models.message import Message +from otari._client.models.workspace_mcp_server_check_request import WorkspaceMcpServerCheckRequest from otari._client.models.workspace_mcp_server_create import WorkspaceMcpServerCreate +from otari._client.models.workspace_mcp_server_health import WorkspaceMcpServerHealth from otari._client.models.workspace_mcp_server_public import WorkspaceMcpServerPublic from otari._client.models.workspace_mcp_server_update import WorkspaceMcpServerUpdate from otari._client.models.workspace_mcp_servers_public import WorkspaceMcpServersPublic @@ -43,6 +45,588 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client + @validate_call + def mcp_servers_check_workspace_mcp_server( + self, + workspace_id: UUID, + server_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkspaceMcpServerPublic: + """Check Workspace Mcp Server + + Check a server's connection now. Organization owners/admins or this workspace's owners/admins. Opens one session, lists the server's tools, and stores the outcome as `health`. A server that fails is still a 200, with `health.status` set to `failing`. A 429 means every check slot on this gateway was busy and nothing was recorded. + + :param workspace_id: (required) + :type workspace_id: UUID + :param server_id: (required) + :type server_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_serialize( + workspace_id=workspace_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerPublic", + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mcp_servers_check_workspace_mcp_server_with_http_info( + self, + workspace_id: UUID, + server_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkspaceMcpServerPublic]: + """Check Workspace Mcp Server + + Check a server's connection now. Organization owners/admins or this workspace's owners/admins. Opens one session, lists the server's tools, and stores the outcome as `health`. A server that fails is still a 200, with `health.status` set to `failing`. A 429 means every check slot on this gateway was busy and nothing was recorded. + + :param workspace_id: (required) + :type workspace_id: UUID + :param server_id: (required) + :type server_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_serialize( + workspace_id=workspace_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerPublic", + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def mcp_servers_check_workspace_mcp_server_without_preload_content( + self, + workspace_id: UUID, + server_id: UUID, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check Workspace Mcp Server + + Check a server's connection now. Organization owners/admins or this workspace's owners/admins. Opens one session, lists the server's tools, and stores the outcome as `health`. A server that fails is still a 200, with `health.status` set to `failing`. A 429 means every check slot on this gateway was busy and nothing was recorded. + + :param workspace_id: (required) + :type workspace_id: UUID + :param server_id: (required) + :type server_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_serialize( + workspace_id=workspace_id, + server_id=server_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerPublic", + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mcp_servers_check_workspace_mcp_server_serialize( + self, + workspace_id, + server_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params['workspace_id'] = workspace_id + if server_id is not None: + _path_params['server_id'] = server_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{workspace_id}/mcp-servers/{server_id}/check', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def mcp_servers_check_workspace_mcp_server_connection( + self, + workspace_id: UUID, + workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> WorkspaceMcpServerHealth: + """Check Workspace Mcp Server Connection + + Check connection details without storing them. Organization owners/admins or this workspace's owners/admins. What a form's Test button calls before it saves. Answers with what a stored server's `health` would say, and records nothing. Pass `server_id` and omit `authorization_token` to test with that server's stored token. The URL is checked for SSRF safety first, with the same 400 a create gets. + + :param workspace_id: (required) + :type workspace_id: UUID + :param workspace_mcp_server_check_request: (required) + :type workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_connection_serialize( + workspace_id=workspace_id, + workspace_mcp_server_check_request=workspace_mcp_server_check_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerHealth", + '400': None, + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def mcp_servers_check_workspace_mcp_server_connection_with_http_info( + self, + workspace_id: UUID, + workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[WorkspaceMcpServerHealth]: + """Check Workspace Mcp Server Connection + + Check connection details without storing them. Organization owners/admins or this workspace's owners/admins. What a form's Test button calls before it saves. Answers with what a stored server's `health` would say, and records nothing. Pass `server_id` and omit `authorization_token` to test with that server's stored token. The URL is checked for SSRF safety first, with the same 400 a create gets. + + :param workspace_id: (required) + :type workspace_id: UUID + :param workspace_mcp_server_check_request: (required) + :type workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_connection_serialize( + workspace_id=workspace_id, + workspace_mcp_server_check_request=workspace_mcp_server_check_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerHealth", + '400': None, + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def mcp_servers_check_workspace_mcp_server_connection_without_preload_content( + self, + workspace_id: UUID, + workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check Workspace Mcp Server Connection + + Check connection details without storing them. Organization owners/admins or this workspace's owners/admins. What a form's Test button calls before it saves. Answers with what a stored server's `health` would say, and records nothing. Pass `server_id` and omit `authorization_token` to test with that server's stored token. The URL is checked for SSRF safety first, with the same 400 a create gets. + + :param workspace_id: (required) + :type workspace_id: UUID + :param workspace_mcp_server_check_request: (required) + :type workspace_mcp_server_check_request: WorkspaceMcpServerCheckRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mcp_servers_check_workspace_mcp_server_connection_serialize( + workspace_id=workspace_id, + workspace_mcp_server_check_request=workspace_mcp_server_check_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "WorkspaceMcpServerHealth", + '400': None, + '422': "HTTPValidationError", + '429': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mcp_servers_check_workspace_mcp_server_connection_serialize( + self, + workspace_id, + workspace_mcp_server_check_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if workspace_id is not None: + _path_params['workspace_id'] = workspace_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if workspace_mcp_server_check_request is not None: + _body_params = workspace_mcp_server_check_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'XApiKeyAuth', + 'ApiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{workspace_id}/mcp-servers/check', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def mcp_servers_create_workspace_mcp_server( self, @@ -63,7 +647,7 @@ def mcp_servers_create_workspace_mcp_server( ) -> WorkspaceMcpServerPublic: """Create Workspace Mcp Server - Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. + Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. Once stored, the server is connected to and its tools listed, and the outcome is returned as `health`. A server that fails this check is still stored, and `health.error` says why. :param workspace_id: (required) :type workspace_id: UUID @@ -135,7 +719,7 @@ def mcp_servers_create_workspace_mcp_server_with_http_info( ) -> ApiResponse[WorkspaceMcpServerPublic]: """Create Workspace Mcp Server - Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. + Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. Once stored, the server is connected to and its tools listed, and the outcome is returned as `health`. A server that fails this check is still stored, and `health.error` says why. :param workspace_id: (required) :type workspace_id: UUID @@ -207,7 +791,7 @@ def mcp_servers_create_workspace_mcp_server_without_preload_content( ) -> RESTResponseType: """Create Workspace Mcp Server - Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. + Register an MCP server for a workspace. Organization owners/admins or this workspace's owners/admins. The authorization token is encrypted at rest and never returned. The URL is checked for SSRF safety here as well as on the request path, and must use https when a token is set. A name already used in this workspace is refused with a 409. Once stored, the server is connected to and its tools listed, and the outcome is returned as `health`. A server that fails this check is still stored, and `health.error` says why. :param workspace_id: (required) :type workspace_id: UUID @@ -936,7 +1520,7 @@ def mcp_servers_update_workspace_mcp_server( ) -> WorkspaceMcpServerPublic: """Update Workspace Mcp Server - Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. + Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. A change to the URL, the token or the allow-list checks the server again, as creating it does. :param workspace_id: (required) :type workspace_id: UUID @@ -1012,7 +1596,7 @@ def mcp_servers_update_workspace_mcp_server_with_http_info( ) -> ApiResponse[WorkspaceMcpServerPublic]: """Update Workspace Mcp Server - Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. + Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. A change to the URL, the token or the allow-list checks the server again, as creating it does. :param workspace_id: (required) :type workspace_id: UUID @@ -1088,7 +1672,7 @@ def mcp_servers_update_workspace_mcp_server_without_preload_content( ) -> RESTResponseType: """Update Workspace Mcp Server - Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. + Update a server. Organization owners/admins or this workspace's owners/admins. Only the fields sent are applied. Omit `authorization_token` to leave the stored token alone, send an empty string to clear it, or send a value to rotate it. A change to the URL, the token or the allow-list checks the server again, as creating it does. :param workspace_id: (required) :type workspace_id: UUID diff --git a/src/otari/_client/api/organization_traces_api.py b/src/otari/_client/api/organization_traces_api.py index b1cb9543..a850412c 100644 --- a/src/otari/_client/api/organization_traces_api.py +++ b/src/otari/_client/api/organization_traces_api.py @@ -55,7 +55,7 @@ def organization_traces_count_traces( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -89,7 +89,7 @@ def organization_traces_count_traces( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -155,7 +155,7 @@ def organization_traces_count_traces_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -189,7 +189,7 @@ def organization_traces_count_traces_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -255,7 +255,7 @@ def organization_traces_count_traces_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -289,7 +289,7 @@ def organization_traces_count_traces_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -756,6 +756,8 @@ def organization_traces_list_traces( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -764,7 +766,7 @@ def organization_traces_list_traces( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -780,12 +782,16 @@ def organization_traces_list_traces( ) -> TraceListPublic: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -802,7 +808,7 @@ def organization_traces_list_traces( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -829,6 +835,8 @@ def organization_traces_list_traces( _param = self._organization_traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -864,6 +872,8 @@ def organization_traces_list_traces_with_http_info( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -872,7 +882,7 @@ def organization_traces_list_traces_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -888,12 +898,16 @@ def organization_traces_list_traces_with_http_info( ) -> ApiResponse[TraceListPublic]: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -910,7 +924,7 @@ def organization_traces_list_traces_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -937,6 +951,8 @@ def organization_traces_list_traces_with_http_info( _param = self._organization_traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -972,6 +988,8 @@ def organization_traces_list_traces_without_preload_content( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -980,7 +998,7 @@ def organization_traces_list_traces_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -996,12 +1014,16 @@ def organization_traces_list_traces_without_preload_content( ) -> RESTResponseType: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -1018,7 +1040,7 @@ def organization_traces_list_traces_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1045,6 +1067,8 @@ def organization_traces_list_traces_without_preload_content( _param = self._organization_traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -1075,6 +1099,8 @@ def _organization_traces_list_traces_serialize( self, skip, limit, + sort, + order, workspace_id, start, end, @@ -1118,6 +1144,14 @@ def _organization_traces_list_traces_serialize( _query_params.append(('limit', limit)) + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + if workspace_id is not None: _query_params.append(('workspace_id', workspace_id)) @@ -1487,7 +1521,7 @@ def organization_traces_trace_series( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1503,7 +1537,7 @@ def organization_traces_trace_series( ) -> TraceSeriesPublic: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1523,7 +1557,7 @@ def organization_traces_trace_series( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1591,7 +1625,7 @@ def organization_traces_trace_series_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1607,7 +1641,7 @@ def organization_traces_trace_series_with_http_info( ) -> ApiResponse[TraceSeriesPublic]: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1627,7 +1661,7 @@ def organization_traces_trace_series_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1695,7 +1729,7 @@ def organization_traces_trace_series_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1711,7 +1745,7 @@ def organization_traces_trace_series_without_preload_content( ) -> RESTResponseType: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1731,7 +1765,7 @@ def organization_traces_trace_series_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/src/otari/_client/api/providers_api.py b/src/otari/_client/api/providers_api.py index 7f76ac30..67286428 100644 --- a/src/otari/_client/api/providers_api.py +++ b/src/otari/_client/api/providers_api.py @@ -17,16 +17,10 @@ from pydantic import StrictBool, StrictStr from typing import List, Optional -from otari._client.models.create_stored_provider_request import CreateStoredProviderRequest from otari._client.models.known_provider_schema import KnownProviderSchema from otari._client.models.known_provider_summary_schema import KnownProviderSummarySchema from otari._client.models.provider_health_response import ProviderHealthResponse from otari._client.models.providers_response import ProvidersResponse -from otari._client.models.reencrypt_provider_credentials_response import ReencryptProviderCredentialsResponse -from otari._client.models.stored_provider_response import StoredProviderResponse -from otari._client.models.test_provider_request import TestProviderRequest -from otari._client.models.test_provider_response import TestProviderResponse -from otari._client.models.update_stored_provider_request import UpdateStoredProviderRequest from otari._client.api_client import ApiClient, RequestSerialized from otari._client.api_response import ApiResponse @@ -47,1823 +41,7 @@ def __init__(self, api_client=None) -> None: @validate_call - def providers_create_stored_provider( - self, - create_stored_provider_request: CreateStoredProviderRequest, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> StoredProviderResponse: - """Create Stored Provider - - Add a provider at runtime. Storing a key requires OTARI_SECRET_KEY. - - :param create_stored_provider_request: (required) - :type create_stored_provider_request: CreateStoredProviderRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_create_stored_provider_serialize( - create_stored_provider_request=create_stored_provider_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "StoredProviderResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_create_stored_provider_with_http_info( - self, - create_stored_provider_request: CreateStoredProviderRequest, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[StoredProviderResponse]: - """Create Stored Provider - - Add a provider at runtime. Storing a key requires OTARI_SECRET_KEY. - - :param create_stored_provider_request: (required) - :type create_stored_provider_request: CreateStoredProviderRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_create_stored_provider_serialize( - create_stored_provider_request=create_stored_provider_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "StoredProviderResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_create_stored_provider_without_preload_content( - self, - create_stored_provider_request: CreateStoredProviderRequest, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Create Stored Provider - - Add a provider at runtime. Storing a key requires OTARI_SECRET_KEY. - - :param create_stored_provider_request: (required) - :type create_stored_provider_request: CreateStoredProviderRequest - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_create_stored_provider_serialize( - create_stored_provider_request=create_stored_provider_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '201': "StoredProviderResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_create_stored_provider_serialize( - self, - create_stored_provider_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if create_stored_provider_request is not None: - _body_params = create_stored_provider_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/provider-credentials', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_delete_stored_provider( - self, - instance: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Stored Provider - - Delete a stored provider. A config.yml provider cannot be deleted here. - - :param instance: (required) - :type instance: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_delete_stored_provider_serialize( - instance=instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_delete_stored_provider_with_http_info( - self, - instance: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete Stored Provider - - Delete a stored provider. A config.yml provider cannot be deleted here. - - :param instance: (required) - :type instance: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_delete_stored_provider_serialize( - instance=instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_delete_stored_provider_without_preload_content( - self, - instance: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Delete Stored Provider - - Delete a stored provider. A config.yml provider cannot be deleted here. - - :param instance: (required) - :type instance: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_delete_stored_provider_serialize( - instance=instance, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_delete_stored_provider_serialize( - self, - instance, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if instance is not None: - _path_params['instance'] = instance - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/provider-credentials/{instance}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_list_providers( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProvidersResponse: - """List Providers - - List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProvidersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_list_providers_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ProvidersResponse]: - """List Providers - - List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProvidersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_list_providers_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List Providers - - List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProvidersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_list_providers_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/providers', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_list_stored_providers( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[StoredProviderResponse]: - """List Stored Providers - - List runtime-stored providers. Keys are never returned, only ``last4``. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_stored_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StoredProviderResponse]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_list_stored_providers_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[StoredProviderResponse]]: - """List Stored Providers - - List runtime-stored providers. Keys are never returned, only ``last4``. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_stored_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StoredProviderResponse]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_list_stored_providers_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """List Stored Providers - - List runtime-stored providers. Keys are never returned, only ``last4``. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_list_stored_providers_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[StoredProviderResponse]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_list_stored_providers_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/provider-credentials', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_provider_catalog( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[KnownProviderSummarySchema]: - """Provider Catalog - - List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KnownProviderSummarySchema]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_provider_catalog_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[KnownProviderSummarySchema]]: - """Provider Catalog - - List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KnownProviderSummarySchema]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_provider_catalog_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provider Catalog - - List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KnownProviderSummarySchema]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_provider_catalog_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/providers/catalog', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_provider_catalog_detail( - self, - provider_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> KnownProviderSchema: - """Provider Catalog Detail - - Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - - :param provider_id: (required) - :type provider_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_detail_serialize( - provider_id=provider_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KnownProviderSchema", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_provider_catalog_detail_with_http_info( - self, - provider_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[KnownProviderSchema]: - """Provider Catalog Detail - - Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - - :param provider_id: (required) - :type provider_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_detail_serialize( - provider_id=provider_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KnownProviderSchema", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_provider_catalog_detail_without_preload_content( - self, - provider_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provider Catalog Detail - - Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - - :param provider_id: (required) - :type provider_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_catalog_detail_serialize( - provider_id=provider_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KnownProviderSchema", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_provider_catalog_detail_serialize( - self, - provider_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if provider_id is not None: - _path_params['provider_id'] = provider_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/providers/catalog/{provider_id}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_provider_health( - self, - refresh: Optional[StrictBool] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProviderHealthResponse: - """Provider Health - - Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - - :param refresh: - :type refresh: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_health_serialize( - refresh=refresh, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProviderHealthResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def providers_provider_health_with_http_info( - self, - refresh: Optional[StrictBool] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ProviderHealthResponse]: - """Provider Health - - Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - - :param refresh: - :type refresh: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_health_serialize( - refresh=refresh, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProviderHealthResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def providers_provider_health_without_preload_content( - self, - refresh: Optional[StrictBool] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Provider Health - - Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - - :param refresh: - :type refresh: bool - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._providers_provider_health_serialize( - refresh=refresh, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProviderHealthResponse", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _providers_provider_health_serialize( - self, - refresh, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if refresh is not None: - - _query_params.append(('refresh', refresh)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'XApiKeyAuth', - 'ApiKeyAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/providers/health', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def providers_reencrypt_stored_provider_keys( + def providers_list_providers( self, _request_timeout: Union[ None, @@ -1877,10 +55,10 @@ def providers_reencrypt_stored_provider_keys( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ReencryptProviderCredentialsResponse: - """Reencrypt Stored Provider Keys + ) -> ProvidersResponse: + """List Providers - Re-encrypt stored provider keys with the primary OTARI_SECRET_KEY. Operators rotate ``OTARI_SECRET_KEY`` by setting it to ``new,old`` first, restarting, running this endpoint, then removing the old key and restarting again. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected provider keys. + List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1904,7 +82,7 @@ def providers_reencrypt_stored_provider_keys( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_reencrypt_stored_provider_keys_serialize( + _param = self._providers_list_providers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1912,7 +90,7 @@ def providers_reencrypt_stored_provider_keys( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReencryptProviderCredentialsResponse", + '200': "ProvidersResponse", } response_data = self.api_client.call_api( *_param, @@ -1926,7 +104,7 @@ def providers_reencrypt_stored_provider_keys( @validate_call - def providers_reencrypt_stored_provider_keys_with_http_info( + def providers_list_providers_with_http_info( self, _request_timeout: Union[ None, @@ -1940,10 +118,10 @@ def providers_reencrypt_stored_provider_keys_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ReencryptProviderCredentialsResponse]: - """Reencrypt Stored Provider Keys + ) -> ApiResponse[ProvidersResponse]: + """List Providers - Re-encrypt stored provider keys with the primary OTARI_SECRET_KEY. Operators rotate ``OTARI_SECRET_KEY`` by setting it to ``new,old`` first, restarting, running this endpoint, then removing the old key and restarting again. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected provider keys. + List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1967,7 +145,7 @@ def providers_reencrypt_stored_provider_keys_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_reencrypt_stored_provider_keys_serialize( + _param = self._providers_list_providers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1975,7 +153,7 @@ def providers_reencrypt_stored_provider_keys_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReencryptProviderCredentialsResponse", + '200': "ProvidersResponse", } response_data = self.api_client.call_api( *_param, @@ -1989,7 +167,7 @@ def providers_reencrypt_stored_provider_keys_with_http_info( @validate_call - def providers_reencrypt_stored_provider_keys_without_preload_content( + def providers_list_providers_without_preload_content( self, _request_timeout: Union[ None, @@ -2004,9 +182,9 @@ def providers_reencrypt_stored_provider_keys_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Reencrypt Stored Provider Keys + """List Providers - Re-encrypt stored provider keys with the primary OTARI_SECRET_KEY. Operators rotate ``OTARI_SECRET_KEY`` by setting it to ``new,old`` first, restarting, running this endpoint, then removing the old key and restarting again. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected provider keys. + List static metadata for every configured provider. Operator-facing: reports each provider's capabilities, documentation and pricing links, and display name from the bundled any-llm and models.dev datasets. No provider is contacted, so this is cheap and always available. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2030,7 +208,7 @@ def providers_reencrypt_stored_provider_keys_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_reencrypt_stored_provider_keys_serialize( + _param = self._providers_list_providers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2038,7 +216,7 @@ def providers_reencrypt_stored_provider_keys_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReencryptProviderCredentialsResponse", + '200': "ProvidersResponse", } response_data = self.api_client.call_api( *_param, @@ -2047,7 +225,7 @@ def providers_reencrypt_stored_provider_keys_without_preload_content( return response_data.response - def _providers_reencrypt_stored_provider_keys_serialize( + def _providers_list_providers_serialize( self, _request_auth, _content_type, @@ -2092,8 +270,8 @@ def _providers_reencrypt_stored_provider_keys_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/provider-credentials/reencrypt', + method='GET', + resource_path='/api/v1/providers', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2110,9 +288,8 @@ def _providers_reencrypt_stored_provider_keys_serialize( @validate_call - def providers_test_provider_connection( + def providers_provider_catalog( self, - test_provider_request: TestProviderRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2125,13 +302,11 @@ def providers_test_provider_connection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TestProviderResponse: - """Test Provider Connection + ) -> List[KnownProviderSummarySchema]: + """Provider Catalog - Test provider credentials without storing them (for the add/edit form). Resolves the implementation from ``provider_type`` (honoring the ``*-compatible`` aliases) or the ``instance`` name, then lists the provider's models with the supplied credentials. Nothing is persisted and the key is never echoed. + List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - :param test_provider_request: (required) - :type test_provider_request: TestProviderRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2154,8 +329,7 @@ def providers_test_provider_connection( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_provider_connection_serialize( - test_provider_request=test_provider_request, + _param = self._providers_provider_catalog_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2163,8 +337,7 @@ def providers_test_provider_connection( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", - '422': "HTTPValidationError", + '200': "List[KnownProviderSummarySchema]", } response_data = self.api_client.call_api( *_param, @@ -2178,9 +351,8 @@ def providers_test_provider_connection( @validate_call - def providers_test_provider_connection_with_http_info( + def providers_provider_catalog_with_http_info( self, - test_provider_request: TestProviderRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2193,13 +365,11 @@ def providers_test_provider_connection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TestProviderResponse]: - """Test Provider Connection + ) -> ApiResponse[List[KnownProviderSummarySchema]]: + """Provider Catalog - Test provider credentials without storing them (for the add/edit form). Resolves the implementation from ``provider_type`` (honoring the ``*-compatible`` aliases) or the ``instance`` name, then lists the provider's models with the supplied credentials. Nothing is persisted and the key is never echoed. + List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - :param test_provider_request: (required) - :type test_provider_request: TestProviderRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2222,8 +392,7 @@ def providers_test_provider_connection_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_provider_connection_serialize( - test_provider_request=test_provider_request, + _param = self._providers_provider_catalog_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2231,8 +400,7 @@ def providers_test_provider_connection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", - '422': "HTTPValidationError", + '200': "List[KnownProviderSummarySchema]", } response_data = self.api_client.call_api( *_param, @@ -2246,9 +414,8 @@ def providers_test_provider_connection_with_http_info( @validate_call - def providers_test_provider_connection_without_preload_content( + def providers_provider_catalog_without_preload_content( self, - test_provider_request: TestProviderRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2262,12 +429,10 @@ def providers_test_provider_connection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Test Provider Connection + """Provider Catalog - Test provider credentials without storing them (for the add/edit form). Resolves the implementation from ``provider_type`` (honoring the ``*-compatible`` aliases) or the ``instance`` name, then lists the provider's models with the supplied credentials. Nothing is persisted and the key is never echoed. + List every known provider for the add-provider picker: id and name only. Lightweight by design so the picker never lags: provider ids come from the any-llm registry and names from the models.dev catalog, so no provider SDK is imported. The autofill hints for a chosen provider come from GET /api/v1/providers/catalog/{provider_id}, which imports only that one SDK. - :param test_provider_request: (required) - :type test_provider_request: TestProviderRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2290,8 +455,7 @@ def providers_test_provider_connection_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_provider_connection_serialize( - test_provider_request=test_provider_request, + _param = self._providers_provider_catalog_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2299,8 +463,7 @@ def providers_test_provider_connection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", - '422': "HTTPValidationError", + '200': "List[KnownProviderSummarySchema]", } response_data = self.api_client.call_api( *_param, @@ -2309,9 +472,8 @@ def providers_test_provider_connection_without_preload_content( return response_data.response - def _providers_test_provider_connection_serialize( + def _providers_provider_catalog_serialize( self, - test_provider_request, _request_auth, _content_type, _headers, @@ -2337,8 +499,6 @@ def _providers_test_provider_connection_serialize( # process the header parameters # process the form parameters # process the body parameter - if test_provider_request is not None: - _body_params = test_provider_request # set the HTTP header `Accept` @@ -2349,19 +509,6 @@ def _providers_test_provider_connection_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2370,8 +517,8 @@ def _providers_test_provider_connection_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/provider-credentials/test', + method='GET', + resource_path='/api/v1/providers/catalog', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2388,9 +535,9 @@ def _providers_test_provider_connection_serialize( @validate_call - def providers_test_stored_provider( + def providers_provider_catalog_detail( self, - instance: StrictStr, + provider_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2403,13 +550,13 @@ def providers_test_stored_provider( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TestProviderResponse: - """Test Stored Provider + ) -> KnownProviderSchema: + """Provider Catalog Detail - Verify a stored provider's key by listing its models, without exposing the key. + Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - :param instance: (required) - :type instance: str + :param provider_id: (required) + :type provider_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2432,8 +579,8 @@ def providers_test_stored_provider( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_stored_provider_serialize( - instance=instance, + _param = self._providers_provider_catalog_detail_serialize( + provider_id=provider_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2441,7 +588,7 @@ def providers_test_stored_provider( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", + '200': "KnownProviderSchema", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2456,9 +603,9 @@ def providers_test_stored_provider( @validate_call - def providers_test_stored_provider_with_http_info( + def providers_provider_catalog_detail_with_http_info( self, - instance: StrictStr, + provider_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2471,13 +618,13 @@ def providers_test_stored_provider_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TestProviderResponse]: - """Test Stored Provider + ) -> ApiResponse[KnownProviderSchema]: + """Provider Catalog Detail - Verify a stored provider's key by listing its models, without exposing the key. + Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - :param instance: (required) - :type instance: str + :param provider_id: (required) + :type provider_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2500,8 +647,8 @@ def providers_test_stored_provider_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_stored_provider_serialize( - instance=instance, + _param = self._providers_provider_catalog_detail_serialize( + provider_id=provider_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2509,7 +656,7 @@ def providers_test_stored_provider_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", + '200': "KnownProviderSchema", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2524,9 +671,9 @@ def providers_test_stored_provider_with_http_info( @validate_call - def providers_test_stored_provider_without_preload_content( + def providers_provider_catalog_detail_without_preload_content( self, - instance: StrictStr, + provider_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2540,12 +687,12 @@ def providers_test_stored_provider_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Test Stored Provider + """Provider Catalog Detail - Verify a stored provider's key by listing its models, without exposing the key. + Autofill hints for one provider the add-provider form has selected. Imports only the selected provider's any-llm module (not the whole catalog) to report its credential env var, default endpoint, whether a key is required, and whether that env var is already set on the server. Returns 404 for an unknown provider id. The SDK import is offloaded to a worker thread: the first fetch for a given provider imports that provider's module, which would otherwise block the event loop (and thus every concurrent request) for the import's duration. - :param instance: (required) - :type instance: str + :param provider_id: (required) + :type provider_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2568,8 +715,8 @@ def providers_test_stored_provider_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_test_stored_provider_serialize( - instance=instance, + _param = self._providers_provider_catalog_detail_serialize( + provider_id=provider_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2577,7 +724,7 @@ def providers_test_stored_provider_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TestProviderResponse", + '200': "KnownProviderSchema", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2587,9 +734,9 @@ def providers_test_stored_provider_without_preload_content( return response_data.response - def _providers_test_stored_provider_serialize( + def _providers_provider_catalog_detail_serialize( self, - instance, + provider_id, _request_auth, _content_type, _headers, @@ -2611,8 +758,8 @@ def _providers_test_stored_provider_serialize( _body_params: Optional[bytes] = None # process the path parameters - if instance is not None: - _path_params['instance'] = instance + if provider_id is not None: + _path_params['provider_id'] = provider_id # process the query parameters # process the header parameters # process the form parameters @@ -2635,8 +782,8 @@ def _providers_test_stored_provider_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/provider-credentials/{instance}/test', + method='GET', + resource_path='/api/v1/providers/catalog/{provider_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2653,10 +800,9 @@ def _providers_test_stored_provider_serialize( @validate_call - def providers_update_stored_provider( + def providers_provider_health( self, - instance: StrictStr, - update_stored_provider_request: UpdateStoredProviderRequest, + refresh: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2669,15 +815,13 @@ def providers_update_stored_provider( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> StoredProviderResponse: - """Update Stored Provider + ) -> ProviderHealthResponse: + """Provider Health - Update a stored provider. Omitted fields are left as-is; an explicit ``null`` clears them. ``api_key`` follows the same rule: omit it to keep the stored key, send a new one to rotate, or send ``null`` to clear it. The row is locked ``FOR UPDATE`` so the ``expected_updated_at`` check and the write it guards are atomic. + Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - :param instance: (required) - :type instance: str - :param update_stored_provider_request: (required) - :type update_stored_provider_request: UpdateStoredProviderRequest + :param refresh: + :type refresh: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2700,9 +844,8 @@ def providers_update_stored_provider( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_update_stored_provider_serialize( - instance=instance, - update_stored_provider_request=update_stored_provider_request, + _param = self._providers_provider_health_serialize( + refresh=refresh, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2710,7 +853,7 @@ def providers_update_stored_provider( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StoredProviderResponse", + '200': "ProviderHealthResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2725,10 +868,9 @@ def providers_update_stored_provider( @validate_call - def providers_update_stored_provider_with_http_info( + def providers_provider_health_with_http_info( self, - instance: StrictStr, - update_stored_provider_request: UpdateStoredProviderRequest, + refresh: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2741,15 +883,13 @@ def providers_update_stored_provider_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[StoredProviderResponse]: - """Update Stored Provider + ) -> ApiResponse[ProviderHealthResponse]: + """Provider Health - Update a stored provider. Omitted fields are left as-is; an explicit ``null`` clears them. ``api_key`` follows the same rule: omit it to keep the stored key, send a new one to rotate, or send ``null`` to clear it. The row is locked ``FOR UPDATE`` so the ``expected_updated_at`` check and the write it guards are atomic. + Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - :param instance: (required) - :type instance: str - :param update_stored_provider_request: (required) - :type update_stored_provider_request: UpdateStoredProviderRequest + :param refresh: + :type refresh: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2772,9 +912,8 @@ def providers_update_stored_provider_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_update_stored_provider_serialize( - instance=instance, - update_stored_provider_request=update_stored_provider_request, + _param = self._providers_provider_health_serialize( + refresh=refresh, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2782,7 +921,7 @@ def providers_update_stored_provider_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StoredProviderResponse", + '200': "ProviderHealthResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2797,10 +936,9 @@ def providers_update_stored_provider_with_http_info( @validate_call - def providers_update_stored_provider_without_preload_content( + def providers_provider_health_without_preload_content( self, - instance: StrictStr, - update_stored_provider_request: UpdateStoredProviderRequest, + refresh: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2814,14 +952,12 @@ def providers_update_stored_provider_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Stored Provider + """Provider Health - Update a stored provider. Omitted fields are left as-is; an explicit ``null`` clears them. ``api_key`` follows the same rule: omit it to keep the stored key, send a new one to rotate, or send ``null`` to clear it. The row is locked ``FOR UPDATE`` so the ``expected_updated_at`` check and the write it guards are atomic. + Report every configured provider's reachability, with a last-checked time. Covers the configured provider instances and every hosted provider switched on, each hosted provider under its provider name. A hosted provider that a configured instance of the same name shadows is not reported. One whose stored key cannot be decrypted with the configured `OTARI_SECRET_KEY` is reported unreachable with that reason. Reuses the per-provider model-discovery test path, so a provider is healthy when its credentials can list models. Results are served from the discovery cache (cheap enough to poll), so ``checked_at`` reflects when each provider was actually dialed. Pass ``refresh=true`` to force a live re-dial of every provider. A provider whose backend serves no model-listing endpoint cannot be verified this way, but it is not unreachable either: it is reported with ``discovery_unsupported`` and counted under ``degraded`` rather than as a reachability failure. - :param instance: (required) - :type instance: str - :param update_stored_provider_request: (required) - :type update_stored_provider_request: UpdateStoredProviderRequest + :param refresh: + :type refresh: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2844,9 +980,8 @@ def providers_update_stored_provider_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._providers_update_stored_provider_serialize( - instance=instance, - update_stored_provider_request=update_stored_provider_request, + _param = self._providers_provider_health_serialize( + refresh=refresh, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2854,7 +989,7 @@ def providers_update_stored_provider_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "StoredProviderResponse", + '200': "ProviderHealthResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2864,10 +999,9 @@ def providers_update_stored_provider_without_preload_content( return response_data.response - def _providers_update_stored_provider_serialize( + def _providers_provider_health_serialize( self, - instance, - update_stored_provider_request, + refresh, _request_auth, _content_type, _headers, @@ -2889,14 +1023,14 @@ def _providers_update_stored_provider_serialize( _body_params: Optional[bytes] = None # process the path parameters - if instance is not None: - _path_params['instance'] = instance # process the query parameters + if refresh is not None: + + _query_params.append(('refresh', refresh)) + # process the header parameters # process the form parameters # process the body parameter - if update_stored_provider_request is not None: - _body_params = update_stored_provider_request # set the HTTP header `Accept` @@ -2907,19 +1041,6 @@ def _providers_update_stored_provider_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2928,8 +1049,8 @@ def _providers_update_stored_provider_serialize( ] return self.api_client.param_serialize( - method='PATCH', - resource_path='/api/v1/provider-credentials/{instance}', + method='GET', + resource_path='/api/v1/providers/health', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/src/otari/_client/api/search_tools_api.py b/src/otari/_client/api/search_tools_api.py index 04f94531..74cd7cbe 100644 --- a/src/otari/_client/api/search_tools_api.py +++ b/src/otari/_client/api/search_tools_api.py @@ -1142,7 +1142,7 @@ def search_tools_reencrypt_stored_search_tool_keys( ) -> ReencryptSearchToolsResponse: """Reencrypt Stored Search Tool Keys - Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/provider-credentials/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. + Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/hosted-providers/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1205,7 +1205,7 @@ def search_tools_reencrypt_stored_search_tool_keys_with_http_info( ) -> ApiResponse[ReencryptSearchToolsResponse]: """Reencrypt Stored Search Tool Keys - Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/provider-credentials/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. + Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/hosted-providers/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1268,7 +1268,7 @@ def search_tools_reencrypt_stored_search_tool_keys_without_preload_content( ) -> RESTResponseType: """Reencrypt Stored Search Tool Keys - Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/provider-credentials/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. + Re-encrypt stored search-tool keys with the primary OTARI_SECRET_KEY. The search-tool half of the ``OTARI_SECRET_KEY`` rotation procedure; run it alongside ``POST /api/v1/hosted-providers/reencrypt``. Rows that cannot be decrypted are left untouched and must be recovered by replacing the affected tool's key. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/src/otari/_client/api/traces_api.py b/src/otari/_client/api/traces_api.py index bc1a8514..ded88859 100644 --- a/src/otari/_client/api/traces_api.py +++ b/src/otari/_client/api/traces_api.py @@ -55,7 +55,7 @@ def traces_count_traces( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -89,7 +89,7 @@ def traces_count_traces( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -155,7 +155,7 @@ def traces_count_traces_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -189,7 +189,7 @@ def traces_count_traces_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -255,7 +255,7 @@ def traces_count_traces_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -289,7 +289,7 @@ def traces_count_traces_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -756,6 +756,8 @@ def traces_list_traces( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -764,7 +766,7 @@ def traces_list_traces( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -780,12 +782,16 @@ def traces_list_traces( ) -> TraceListPublic: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -802,7 +808,7 @@ def traces_list_traces( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -829,6 +835,8 @@ def traces_list_traces( _param = self._traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -864,6 +872,8 @@ def traces_list_traces_with_http_info( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -872,7 +882,7 @@ def traces_list_traces_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -888,12 +898,16 @@ def traces_list_traces_with_http_info( ) -> ApiResponse[TraceListPublic]: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -910,7 +924,7 @@ def traces_list_traces_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -937,6 +951,8 @@ def traces_list_traces_with_http_info( _param = self._traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -972,6 +988,8 @@ def traces_list_traces_without_preload_content( self, skip: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, + sort: Annotated[Optional[StrictStr], Field(description="What to order by. Latency runs from a session's start to its last activity.")] = None, + order: Annotated[Optional[StrictStr], Field(description="The direction of `sort`.")] = None, workspace_id: Annotated[Optional[UUID], Field(description="Only sessions in this workspace. Narrows the caller's scope; never widens it.")] = None, start: Annotated[Optional[datetime], Field(description="Last activity at or after this instant (ISO 8601).")] = None, end: Annotated[Optional[datetime], Field(description="Last activity before this instant (ISO 8601).")] = None, @@ -980,7 +998,7 @@ def traces_list_traces_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -996,12 +1014,16 @@ def traces_list_traces_without_preload_content( ) -> RESTResponseType: """List Traces - List agent sessions, most recently active first. + List agent sessions, most recently active first unless ``sort`` says otherwise. :param skip: :type skip: int :param limit: :type limit: int + :param sort: What to order by. Latency runs from a session's start to its last activity. + :type sort: str + :param order: The direction of `sort`. + :type order: str :param workspace_id: Only sessions in this workspace. Narrows the caller's scope; never widens it. :type workspace_id: UUID :param start: Last activity at or after this instant (ISO 8601). @@ -1018,7 +1040,7 @@ def traces_list_traces_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1045,6 +1067,8 @@ def traces_list_traces_without_preload_content( _param = self._traces_list_traces_serialize( skip=skip, limit=limit, + sort=sort, + order=order, workspace_id=workspace_id, start=start, end=end, @@ -1075,6 +1099,8 @@ def _traces_list_traces_serialize( self, skip, limit, + sort, + order, workspace_id, start, end, @@ -1118,6 +1144,14 @@ def _traces_list_traces_serialize( _query_params.append(('limit', limit)) + if sort is not None: + + _query_params.append(('sort', sort)) + + if order is not None: + + _query_params.append(('order', order)) + if workspace_id is not None: _query_params.append(('workspace_id', workspace_id)) @@ -1487,7 +1521,7 @@ def traces_trace_series( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1503,7 +1537,7 @@ def traces_trace_series( ) -> TraceSeriesPublic: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1523,7 +1557,7 @@ def traces_trace_series( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1591,7 +1625,7 @@ def traces_trace_series_with_http_info( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1607,7 +1641,7 @@ def traces_trace_series_with_http_info( ) -> ApiResponse[TraceSeriesPublic]: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1627,7 +1661,7 @@ def traces_trace_series_with_http_info( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1695,7 +1729,7 @@ def traces_trace_series_without_preload_content( harness: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=50)]], Field(description="Agent harnesses.")] = None, session_source: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=4)]], Field(description="What grouped the session.")] = None, has_error: Annotated[Optional[StrictBool], Field(description="Only sessions with, or without, an unrecovered error.")] = None, - q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A trace id, or the start of one.")] = None, + q: Annotated[Optional[Annotated[str, Field(strict=True, max_length=128)]], Field(description="Part of a trace id, session name, harness or user id, in any case.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1711,7 +1745,7 @@ def traces_trace_series_without_preload_content( ) -> RESTResponseType: """Trace Series - Count sessions per bucket of their start, split by whether any span failed unrecovered. + Count sessions per bucket of their start, split by whether they failed. A session failed when it holds an unrecovered error other than a tool's. A tool's error goes back to the model, an MCP tool's included, so a session whose only errors are tools' counts as succeeded. :param bucket: :type bucket: str @@ -1731,7 +1765,7 @@ def traces_trace_series_without_preload_content( :type session_source: List[str] :param has_error: Only sessions with, or without, an unrecovered error. :type has_error: bool - :param q: A trace id, or the start of one. + :param q: Part of a trace id, session name, harness or user id, in any case. :type q: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request diff --git a/src/otari/_client/models/__init__.py b/src/otari/_client/models/__init__.py index 7c6f0818..ddfd8937 100644 --- a/src/otari/_client/models/__init__.py +++ b/src/otari/_client/models/__init__.py @@ -134,6 +134,7 @@ from otari._client.models.chat_completion_request import ChatCompletionRequest from otari._client.models.chat_completion_request_tools_inner import ChatCompletionRequestToolsInner from otari._client.models.chat_message_input import ChatMessageInput +from otari._client.models.check_failure import CheckFailure from otari._client.models.check_verdict_request import CheckVerdictRequest from otari._client.models.choice_question import ChoiceQuestion from otari._client.models.code_executor import CodeExecutor @@ -171,7 +172,6 @@ from otari._client.models.create_scoped_budget_request import CreateScopedBudgetRequest from otari._client.models.create_search_tool_request import CreateSearchToolRequest from otari._client.models.create_session_request import CreateSessionRequest -from otari._client.models.create_stored_provider_request import CreateStoredProviderRequest from otari._client.models.create_user_request import CreateUserRequest from otari._client.models.created_search_tool_schema import CreatedSearchToolSchema from otari._client.models.criteria_inner import CriteriaInner @@ -230,6 +230,12 @@ from otari._client.models.guardrail_profile_spec import GuardrailProfileSpec from otari._client.models.guardrail_stage import GuardrailStage from otari._client.models.http_validation_error import HTTPValidationError +from otari._client.models.health_check_disabled import HealthCheckDisabled +from otari._client.models.health_check_result_public import HealthCheckResultPublic +from otari._client.models.health_check_run_public import HealthCheckRunPublic +from otari._client.models.health_check_settings_public import HealthCheckSettingsPublic +from otari._client.models.health_check_settings_update import HealthCheckSettingsUpdate +from otari._client.models.health_check_status import HealthCheckStatus from otari._client.models.hosted_available_models_public import HostedAvailableModelsPublic from otari._client.models.hosted_catalog_kept_group_public import HostedCatalogKeptGroupPublic from otari._client.models.hosted_catalog_provider_refresh_public import HostedCatalogProviderRefreshPublic @@ -538,6 +544,8 @@ from otari._client.models.provider_endpoints_public import ProviderEndpointsPublic from otari._client.models.provider_health_response import ProviderHealthResponse from otari._client.models.provider_health_schema import ProviderHealthSchema +from otari._client.models.provider_health_summary import ProviderHealthSummary +from otari._client.models.provider_history_point import ProviderHistoryPoint from otari._client.models.provider_info_schema import ProviderInfoSchema from otari._client.models.providers_response import ProvidersResponse from otari._client.models.questions_value import QuestionsValue @@ -551,7 +559,6 @@ from otari._client.models.rate_limit_rule_update import RateLimitRuleUpdate from otari._client.models.rate_limit_rules_public import RateLimitRulesPublic from otari._client.models.recorded_pool import RecordedPool -from otari._client.models.reencrypt_provider_credentials_response import ReencryptProviderCredentialsResponse from otari._client.models.reencrypt_search_tools_response import ReencryptSearchToolsResponse from otari._client.models.register_passkey_request import RegisterPasskeyRequest from otari._client.models.request_password_reset_request import RequestPasswordResetRequest @@ -600,14 +607,11 @@ from otari._client.models.span_public import SpanPublic from otari._client.models.state import State from otari._client.models.stop import Stop -from otari._client.models.stored_provider_response import StoredProviderResponse from otari._client.models.stored_search_tool_schema import StoredSearchToolSchema from otari._client.models.stored_search_tool_test_request import StoredSearchToolTestRequest from otari._client.models.switch_active_organization_request import SwitchActiveOrganizationRequest from otari._client.models.system import System from otari._client.models.task_pool import TaskPool -from otari._client.models.test_provider_request import TestProviderRequest -from otari._client.models.test_provider_response import TestProviderResponse from otari._client.models.test_service_request import TestServiceRequest from otari._client.models.test_service_response import TestServiceResponse from otari._client.models.text_content import TextContent @@ -639,7 +643,6 @@ from otari._client.models.update_scoped_budget_request import UpdateScopedBudgetRequest from otari._client.models.update_search_tool_request import UpdateSearchToolRequest from otari._client.models.update_settings_request import UpdateSettingsRequest -from otari._client.models.update_stored_provider_request import UpdateStoredProviderRequest from otari._client.models.update_tool_settings_request import UpdateToolSettingsRequest from otari._client.models.update_user_request import UpdateUserRequest from otari._client.models.usage_count import UsageCount @@ -677,7 +680,9 @@ from otari._client.models.workspace_code_execution_policy_public import WorkspaceCodeExecutionPolicyPublic from otari._client.models.workspace_code_execution_policy_update import WorkspaceCodeExecutionPolicyUpdate from otari._client.models.workspace_create import WorkspaceCreate +from otari._client.models.workspace_mcp_server_check_request import WorkspaceMcpServerCheckRequest from otari._client.models.workspace_mcp_server_create import WorkspaceMcpServerCreate +from otari._client.models.workspace_mcp_server_health import WorkspaceMcpServerHealth from otari._client.models.workspace_mcp_server_public import WorkspaceMcpServerPublic from otari._client.models.workspace_mcp_server_update import WorkspaceMcpServerUpdate from otari._client.models.workspace_mcp_servers_public import WorkspaceMcpServersPublic diff --git a/src/otari/_client/models/check_failure.py b/src/otari/_client/models/check_failure.py new file mode 100644 index 00000000..a177465e --- /dev/null +++ b/src/otari/_client/models/check_failure.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CheckFailure(str, Enum): + """ + Why a stored server failed its connection check. Stored on the server's row and shown to whoever manages it, so each value names a cause an operator can act on, and none carries anything the remote server said. The first two are decided before any connection is opened. + """ + + """ + allowed enum values + """ + UNSAFE_URL = 'unsafe_url' + CREDENTIALS_UNAVAILABLE = 'credentials_unavailable' + UNREACHABLE = 'unreachable' + TLS_FAILED = 'tls_failed' + TIMEOUT = 'timeout' + REDIRECTED = 'redirected' + UNAUTHORIZED = 'unauthorized' + FORBIDDEN = 'forbidden' + NOT_FOUND = 'not_found' + SERVER_ERROR = 'server_error' + HTTP_ERROR = 'http_error' + NOT_MCP = 'not_mcp' + LIMITS_EXCEEDED = 'limits_exceeded' + CONNECTION_FAILED = 'connection_failed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CheckFailure from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/src/otari/_client/models/create_stored_provider_request.py b/src/otari/_client/models/create_stored_provider_request.py deleted file mode 100644 index 8f60121d..00000000 --- a/src/otari/_client/models/create_stored_provider_request.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - otari - - Otari, an OpenAI-compatible LLM gateway with API key management - - The version of the OpenAPI document: 0.0.0-dev - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self -from pydantic_core import to_jsonable_python - -class CreateStoredProviderRequest(BaseModel): - """ - Create a stored provider. ``api_key`` is write-only and requires OTARI_SECRET_KEY. - """ # noqa: E501 - api_base: Optional[StrictStr] = None - api_key: Optional[StrictStr] = Field(default=None, description="Provider API key. Stored encrypted; never returned.") - client_args: Optional[Dict[str, Any]] = Field(default=None, description="Tags for cost attribution, recorded on the request's usage rows and filterable in the usage API: up to 16 string pairs, keys up to 64 characters and values up to 512. A null value is ignored. LiteLLM's nested `spend_logs_metadata` object is also read, and wins over a flat key of the same name; it is never forwarded to the provider.") - instance: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Routing key, e.g. 'openai' or a named instance like 'home_lab'.") - provider_type: Optional[StrictStr] = Field(default=None, description="any-llm implementation when the instance name is not itself one.") - __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "instance", "provider_type"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateStoredProviderRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if api_base (nullable) is None - # and model_fields_set contains the field - if self.api_base is None and "api_base" in self.model_fields_set: - _dict['api_base'] = None - - # set to None if api_key (nullable) is None - # and model_fields_set contains the field - if self.api_key is None and "api_key" in self.model_fields_set: - _dict['api_key'] = None - - # set to None if client_args (nullable) is None - # and model_fields_set contains the field - if self.client_args is None and "client_args" in self.model_fields_set: - _dict['client_args'] = None - - # set to None if provider_type (nullable) is None - # and model_fields_set contains the field - if self.provider_type is None and "provider_type" in self.model_fields_set: - _dict['provider_type'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateStoredProviderRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "api_base": obj.get("api_base"), - "api_key": obj.get("api_key"), - "client_args": obj.get("client_args"), - "instance": obj.get("instance"), - "provider_type": obj.get("provider_type") - }) - return _obj - - diff --git a/src/otari/_client/models/deployment_bootstrap.py b/src/otari/_client/models/deployment_bootstrap.py index 712810a4..0e460c3d 100644 --- a/src/otari/_client/models/deployment_bootstrap.py +++ b/src/otari/_client/models/deployment_bootstrap.py @@ -29,7 +29,7 @@ class DeploymentBootstrap(BaseModel): """ # noqa: E501 data_plane_url: Optional[StrictStr] = Field(description="Where this deployment's inference traffic belongs, when it is not served here. The mirror of management_url: that one says where management lives when this deployment is not the control plane, this one says where the data plane is when this deployment is not it. Set only by a hosted control plane, which serves the dashboard but not inference (otari#822); null for standalone and hybrid, both of which serve inference at the address that reached this page. Not a human link target like management_url: it is the gateway's bare address, which the dashboard suffixes with the API root to build its request snippets. So it must carry no API root anywhere (a value ending in /api/v1, or a whole endpoint like /api/v1/chat/completions, renders that path twice) and no credential, since this response is unauthenticated. This gateway refuses both at startup; any deployment serving this contract should publish the same shape. Null on a hosted deployment means unconfigured, and the dashboard then shows no snippet rather than one naming this host.") deployment_type: StrictStr = Field(description="Which deployment serves this URL. 'standalone' owns its own data and serves one tenant; 'hosted' owns its own data and serves many (otari.ai, or any deployment run as a control plane), which is why its management surfaces are the per-organization ones; 'hybrid' is a gateway attached to otari.ai, which is data-plane only and holds no management surface of its own.") - docs_url: Optional[StrictStr] = Field(description="Where this deployment's documentation lives, when it is not the operator guide bundled with the gateway. Set, the dashboard's Documentation links open it in a new tab; null, they go to the bundled guide at /#/docs, which stays served either way. A link target an operator configured, validated at startup as an absolute http(s) URL carrying no credential, since this response is unauthenticated.") + docs_url: Optional[StrictStr] = Field(description="Where this deployment's documentation lives, when it is not docs.otari.ai. Set, the dashboard's Documentation links open it in a new tab; null, they open https://docs.otari.ai/. A link target an operator configured, validated at startup as an absolute http(s) URL carrying no credential, since this response is unauthenticated.") feedback_enabled: StrictBool = Field(description="Whether this deployment accepts deliberate feedback submissions.") mail_ready: StrictBool = Field(description="Whether this deployment can deliver a message carrying a link back to itself (an invitation's accept link, and the verification and reset links to come), not merely whether a transport is configured: it also needs to know its own public URL to put in one. Lets the dashboard disable or hide a mail-dependent affordance instead of offering one that would fail at send time. Every message this control plane sends carries such a link, which is why this is one flag and not one per feature. False for a hybrid gateway, whose control plane is otari.ai and which sends no mail of its own.") maintenance_mode: StrictBool = Field(description="Whether this deployment is refusing new dashboard sign-ins while an operator redeploys it. The sign-in screen says so rather than presenting a form whose only outcome is a 503. Sessions already issued keep working, and the management API and the data plane are unaffected. False for a hybrid gateway, which issues no session.") diff --git a/src/otari/_client/models/deployment_provider_migration_public.py b/src/otari/_client/models/deployment_provider_migration_public.py index eb581623..7093cfe1 100644 --- a/src/otari/_client/models/deployment_provider_migration_public.py +++ b/src/otari/_client/models/deployment_provider_migration_public.py @@ -26,7 +26,7 @@ class DeploymentProviderMigrationPublic(BaseModel): """ - The deployment providers stored through the dashboard, and how each moves onto a hosted provider. + The deployment providers the retired dashboard page stored, and how each moves onto a hosted provider. """ # noqa: E501 rows: List[DeploymentProviderMigrationRowPublic] __properties: ClassVar[List[str]] = ["rows"] diff --git a/src/otari/_client/models/deployment_provider_migration_row_public.py b/src/otari/_client/models/deployment_provider_migration_row_public.py index 40008578..6964fb18 100644 --- a/src/otari/_client/models/deployment_provider_migration_row_public.py +++ b/src/otari/_client/models/deployment_provider_migration_row_public.py @@ -26,7 +26,7 @@ class DeploymentProviderMigrationRowPublic(BaseModel): """ - What moving one deployment provider onto a hosted provider does, or did. ``instance`` is the deployment provider's name, which the hosted provider keeps, so ``instance:model`` selectors keep working. ``outcome`` is ``migrate`` in a preview and ``migrated`` once applied; ``conflict``, ``unreadable``, ``invalid`` and ``failed`` leave the row where it is, with ``detail`` saying why. ``source_removed`` says whether the deployment provider was removed: it is kept while the hosted provider offers no model, so nothing it serves stops being served. ``notes`` are what an operator should check afterwards. + What moving one deployment provider onto a hosted provider does, or did. ``instance`` is the deployment provider's name, which the hosted provider keeps, so ``instance:model`` selectors keep working. ``outcome`` is ``migrate`` in a preview and ``migrated`` once applied; ``conflict``, ``unreadable``, ``invalid`` and ``failed`` leave the row where it is, with ``detail`` saying why. ``source_removed`` says whether the deployment provider was removed: it is kept while the hosted provider offers no model, and when it changed while the move ran. ``notes`` are what an operator should check afterwards. """ # noqa: E501 api_base: Optional[StrictStr] = None detail: Optional[StrictStr] = None diff --git a/src/otari/_client/models/reencrypt_provider_credentials_response.py b/src/otari/_client/models/health_check_disabled.py similarity index 66% rename from src/otari/_client/models/reencrypt_provider_credentials_response.py rename to src/otari/_client/models/health_check_disabled.py index bf0c3054..27e502e7 100644 --- a/src/otari/_client/models/reencrypt_provider_credentials_response.py +++ b/src/otari/_client/models/health_check_disabled.py @@ -18,19 +18,17 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class ReencryptProviderCredentialsResponse(BaseModel): +class HealthCheckDisabled(BaseModel): """ - Result of re-encrypting stored provider keys with the primary secret key. + What switching off the failing models did. """ # noqa: E501 - reencrypted: StrictInt = Field(description="Number of stored provider keys re-encrypted.") - skipped: Optional[StrictInt] = Field(default=0, description="Number of rows whose stored key changed between the read and the write, so the re-encryption was not applied. They already hold whoever wrote them last.") - unreadable: StrictInt = Field(description="Number of encrypted keys left untouched because they could not be decrypted.") - __properties: ClassVar[List[str]] = ["reencrypted", "skipped", "unreadable"] + disabled: StrictInt = Field(description="How many models were switched off on their hosted provider.") + __properties: ClassVar[List[str]] = ["disabled"] model_config = ConfigDict( validate_by_name=True, @@ -50,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReencryptProviderCredentialsResponse from a JSON string""" + """Create an instance of HealthCheckDisabled from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReencryptProviderCredentialsResponse from a dict""" + """Create an instance of HealthCheckDisabled from a dict""" if obj is None: return None @@ -83,9 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "reencrypted": obj.get("reencrypted"), - "skipped": obj.get("skipped") if obj.get("skipped") is not None else 0, - "unreadable": obj.get("unreadable") + "disabled": obj.get("disabled") }) return _obj diff --git a/src/otari/_client/models/update_stored_provider_request.py b/src/otari/_client/models/health_check_result_public.py similarity index 50% rename from src/otari/_client/models/update_stored_provider_request.py rename to src/otari/_client/models/health_check_result_public.py index 7a37245f..c55168f6 100644 --- a/src/otari/_client/models/update_stored_provider_request.py +++ b/src/otari/_client/models/health_check_result_public.py @@ -17,22 +17,34 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class UpdateStoredProviderRequest(BaseModel): +class HealthCheckResultPublic(BaseModel): """ - Update a stored provider. Omitted fields are unchanged; ``api_key`` rotates in place. + What one offering answered in the latest finished run. """ # noqa: E501 - api_base: Optional[StrictStr] = None - api_key: Optional[StrictStr] = Field(default=None, description="New API key. Omit to keep the existing one. Never returned.") - client_args: Optional[Dict[str, Any]] = None - expected_updated_at: Optional[StrictStr] = Field(default=None, description="Optimistic concurrency: if set, the update 412s unless it matches the stored updated_at.") - provider_type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "expected_updated_at", "provider_type"] + checked_at: datetime + error: Optional[StrictStr] + failed_runs: Optional[StrictInt] = Field(default=0, description="How many runs in a row it has failed.") + failing_since: Optional[datetime] = Field(default=None, description="When a failing model's unbroken run of failures began, as far back as results are kept (48 hours). Null when it answered.") + latency_ms: StrictInt + provider: StrictStr + selector: StrictStr + status: StrictStr + status_code: Optional[StrictInt] + __properties: ClassVar[List[str]] = ["checked_at", "error", "failed_runs", "failing_since", "latency_ms", "provider", "selector", "status", "status_code"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pass', 'fail', 'skip']): + raise ValueError("must be one of enum values ('pass', 'fail', 'skip')") + return value model_config = ConfigDict( validate_by_name=True, @@ -52,7 +64,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateStoredProviderRequest from a JSON string""" + """Create an instance of HealthCheckResultPublic from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,36 +85,26 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if api_base (nullable) is None + # set to None if error (nullable) is None # and model_fields_set contains the field - if self.api_base is None and "api_base" in self.model_fields_set: - _dict['api_base'] = None + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None - # set to None if api_key (nullable) is None + # set to None if failing_since (nullable) is None # and model_fields_set contains the field - if self.api_key is None and "api_key" in self.model_fields_set: - _dict['api_key'] = None + if self.failing_since is None and "failing_since" in self.model_fields_set: + _dict['failing_since'] = None - # set to None if client_args (nullable) is None + # set to None if status_code (nullable) is None # and model_fields_set contains the field - if self.client_args is None and "client_args" in self.model_fields_set: - _dict['client_args'] = None - - # set to None if expected_updated_at (nullable) is None - # and model_fields_set contains the field - if self.expected_updated_at is None and "expected_updated_at" in self.model_fields_set: - _dict['expected_updated_at'] = None - - # set to None if provider_type (nullable) is None - # and model_fields_set contains the field - if self.provider_type is None and "provider_type" in self.model_fields_set: - _dict['provider_type'] = None + if self.status_code is None and "status_code" in self.model_fields_set: + _dict['status_code'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateStoredProviderRequest from a dict""" + """Create an instance of HealthCheckResultPublic from a dict""" if obj is None: return None @@ -110,11 +112,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "api_base": obj.get("api_base"), - "api_key": obj.get("api_key"), - "client_args": obj.get("client_args"), - "expected_updated_at": obj.get("expected_updated_at"), - "provider_type": obj.get("provider_type") + "checked_at": obj.get("checked_at"), + "error": obj.get("error"), + "failed_runs": obj.get("failed_runs") if obj.get("failed_runs") is not None else 0, + "failing_since": obj.get("failing_since"), + "latency_ms": obj.get("latency_ms"), + "provider": obj.get("provider"), + "selector": obj.get("selector"), + "status": obj.get("status"), + "status_code": obj.get("status_code") }) return _obj diff --git a/src/otari/_client/models/test_provider_response.py b/src/otari/_client/models/health_check_run_public.py similarity index 65% rename from src/otari/_client/models/test_provider_response.py rename to src/otari/_client/models/health_check_run_public.py index 32878f2f..c1096bb3 100644 --- a/src/otari/_client/models/test_provider_response.py +++ b/src/otari/_client/models/health_check_run_public.py @@ -17,21 +17,25 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class TestProviderResponse(BaseModel): +class HealthCheckRunPublic(BaseModel): """ - Result of a live provider connection test. + One pass over every offering. """ # noqa: E501 - discovery_unsupported: Optional[StrictBool] = Field(default=False, description="True when the test failed only because this backend serves no model-listing endpoint, so the credentials could not be verified this way but may still work for requests.") - error: Optional[StrictStr] = None - model_count: StrictInt - ok: StrictBool - __properties: ClassVar[List[str]] = ["discovery_unsupported", "error", "model_count", "ok"] + failed: StrictInt + finished_at: Optional[datetime] + id: StrictStr + included_reasoning: StrictBool + passed: StrictInt + started_at: datetime + total: StrictInt + __properties: ClassVar[List[str]] = ["failed", "finished_at", "id", "included_reasoning", "passed", "started_at", "total"] model_config = ConfigDict( validate_by_name=True, @@ -51,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TestProviderResponse from a JSON string""" + """Create an instance of HealthCheckRunPublic from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,16 +76,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if error (nullable) is None + # set to None if finished_at (nullable) is None # and model_fields_set contains the field - if self.error is None and "error" in self.model_fields_set: - _dict['error'] = None + if self.finished_at is None and "finished_at" in self.model_fields_set: + _dict['finished_at'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TestProviderResponse from a dict""" + """Create an instance of HealthCheckRunPublic from a dict""" if obj is None: return None @@ -89,10 +93,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "discovery_unsupported": obj.get("discovery_unsupported") if obj.get("discovery_unsupported") is not None else False, - "error": obj.get("error"), - "model_count": obj.get("model_count"), - "ok": obj.get("ok") + "failed": obj.get("failed"), + "finished_at": obj.get("finished_at"), + "id": obj.get("id"), + "included_reasoning": obj.get("included_reasoning"), + "passed": obj.get("passed"), + "started_at": obj.get("started_at"), + "total": obj.get("total") }) return _obj diff --git a/src/otari/_client/models/health_check_settings_public.py b/src/otari/_client/models/health_check_settings_public.py new file mode 100644 index 00000000..521e1398 --- /dev/null +++ b/src/otari/_client/models/health_check_settings_public.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HealthCheckSettingsPublic(BaseModel): + """ + Whether the checks run, how often, and what they send. + """ # noqa: E501 + alert_emails: List[StrictStr] + interval_minutes: StrictInt + max_tokens: StrictInt + next_run_at: Optional[datetime] + prompt: StrictStr + reasoning_every_runs: StrictInt + reasoning_max_tokens: StrictInt + run_requested: StrictBool + schedule_enabled: StrictBool + __properties: ClassVar[List[str]] = ["alert_emails", "interval_minutes", "max_tokens", "next_run_at", "prompt", "reasoning_every_runs", "reasoning_max_tokens", "run_requested", "schedule_enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HealthCheckSettingsPublic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if next_run_at (nullable) is None + # and model_fields_set contains the field + if self.next_run_at is None and "next_run_at" in self.model_fields_set: + _dict['next_run_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HealthCheckSettingsPublic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alert_emails": obj.get("alert_emails"), + "interval_minutes": obj.get("interval_minutes"), + "max_tokens": obj.get("max_tokens"), + "next_run_at": obj.get("next_run_at"), + "prompt": obj.get("prompt"), + "reasoning_every_runs": obj.get("reasoning_every_runs"), + "reasoning_max_tokens": obj.get("reasoning_max_tokens"), + "run_requested": obj.get("run_requested"), + "schedule_enabled": obj.get("schedule_enabled") + }) + return _obj + + diff --git a/src/otari/_client/models/health_check_settings_update.py b/src/otari/_client/models/health_check_settings_update.py new file mode 100644 index 00000000..dcc8f86d --- /dev/null +++ b/src/otari/_client/models/health_check_settings_update.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HealthCheckSettingsUpdate(BaseModel): + """ + Settings to change. An omitted field keeps its value. + """ # noqa: E501 + alert_emails: Optional[Any] = None + interval_minutes: Optional[Annotated[int, Field(le=1440, strict=True, ge=15)]] = Field(default=None, description="Minutes between scheduled runs.") + max_tokens: Optional[Annotated[int, Field(le=4096, strict=True, ge=1)]] = Field(default=None, description="Output cap for a model that does not reason.") + prompt: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2000)]] = Field(default=None, description="The user message every model is sent. A check passes on any answer, whatever it says.") + reasoning_every_runs: Optional[Annotated[int, Field(le=48, strict=True, ge=0)]] = Field(default=None, description="Include reasoning models every Nth run; 0 leaves them out.") + reasoning_max_tokens: Optional[Annotated[int, Field(le=8192, strict=True, ge=1)]] = Field(default=None, description="Output cap for a reasoning model.") + schedule_enabled: Optional[StrictBool] = Field(default=None, description="Run the checks on a schedule.") + __properties: ClassVar[List[str]] = ["alert_emails", "interval_minutes", "max_tokens", "prompt", "reasoning_every_runs", "reasoning_max_tokens", "schedule_enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HealthCheckSettingsUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if alert_emails (nullable) is None + # and model_fields_set contains the field + if self.alert_emails is None and "alert_emails" in self.model_fields_set: + _dict['alert_emails'] = None + + # set to None if interval_minutes (nullable) is None + # and model_fields_set contains the field + if self.interval_minutes is None and "interval_minutes" in self.model_fields_set: + _dict['interval_minutes'] = None + + # set to None if max_tokens (nullable) is None + # and model_fields_set contains the field + if self.max_tokens is None and "max_tokens" in self.model_fields_set: + _dict['max_tokens'] = None + + # set to None if prompt (nullable) is None + # and model_fields_set contains the field + if self.prompt is None and "prompt" in self.model_fields_set: + _dict['prompt'] = None + + # set to None if reasoning_every_runs (nullable) is None + # and model_fields_set contains the field + if self.reasoning_every_runs is None and "reasoning_every_runs" in self.model_fields_set: + _dict['reasoning_every_runs'] = None + + # set to None if reasoning_max_tokens (nullable) is None + # and model_fields_set contains the field + if self.reasoning_max_tokens is None and "reasoning_max_tokens" in self.model_fields_set: + _dict['reasoning_max_tokens'] = None + + # set to None if schedule_enabled (nullable) is None + # and model_fields_set contains the field + if self.schedule_enabled is None and "schedule_enabled" in self.model_fields_set: + _dict['schedule_enabled'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HealthCheckSettingsUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "alert_emails": obj.get("alert_emails"), + "interval_minutes": obj.get("interval_minutes"), + "max_tokens": obj.get("max_tokens"), + "prompt": obj.get("prompt"), + "reasoning_every_runs": obj.get("reasoning_every_runs"), + "reasoning_max_tokens": obj.get("reasoning_max_tokens"), + "schedule_enabled": obj.get("schedule_enabled") + }) + return _obj + + diff --git a/src/otari/_client/models/health_check_status.py b/src/otari/_client/models/health_check_status.py new file mode 100644 index 00000000..d68740bc --- /dev/null +++ b/src/otari/_client/models/health_check_status.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.health_check_result_public import HealthCheckResultPublic +from otari._client.models.health_check_run_public import HealthCheckRunPublic +from otari._client.models.health_check_settings_public import HealthCheckSettingsPublic +from otari._client.models.provider_health_summary import ProviderHealthSummary +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class HealthCheckStatus(BaseModel): + """ + The Health page: settings, the run in progress, and the latest finished run by provider. + """ # noqa: E501 + last_run: Optional[HealthCheckRunPublic] + providers: List[ProviderHealthSummary] + results: List[HealthCheckResultPublic] + running: Optional[HealthCheckRunPublic] + settings: HealthCheckSettingsPublic + __properties: ClassVar[List[str]] = ["last_run", "providers", "results", "running", "settings"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of HealthCheckStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of last_run + if self.last_run: + _dict['last_run'] = self.last_run.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in providers (list) + _items = [] + if self.providers: + for _item_providers in self.providers: + if _item_providers: + _items.append(_item_providers.to_dict()) + _dict['providers'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of running + if self.running: + _dict['running'] = self.running.to_dict() + # override the default output from pydantic by calling `to_dict()` of settings + if self.settings: + _dict['settings'] = self.settings.to_dict() + # set to None if last_run (nullable) is None + # and model_fields_set contains the field + if self.last_run is None and "last_run" in self.model_fields_set: + _dict['last_run'] = None + + # set to None if running (nullable) is None + # and model_fields_set contains the field + if self.running is None and "running" in self.model_fields_set: + _dict['running'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of HealthCheckStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "last_run": HealthCheckRunPublic.from_dict(obj["last_run"]) if obj.get("last_run") is not None else None, + "providers": [ProviderHealthSummary.from_dict(_item) for _item in obj["providers"]] if obj.get("providers") is not None else None, + "results": [HealthCheckResultPublic.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "running": HealthCheckRunPublic.from_dict(obj["running"]) if obj.get("running") is not None else None, + "settings": HealthCheckSettingsPublic.from_dict(obj["settings"]) if obj.get("settings") is not None else None + }) + return _obj + + diff --git a/src/otari/_client/models/hosted_provider_create_request.py b/src/otari/_client/models/hosted_provider_create_request.py index 8068425a..90ccda58 100644 --- a/src/otari/_client/models/hosted_provider_create_request.py +++ b/src/otari/_client/models/hosted_provider_create_request.py @@ -27,16 +27,17 @@ class HostedProviderCreateRequest(BaseModel): """ - Configure a provider this deployment will serve hosted inference on. ``provider`` is the any-llm implementation. ``name`` is what requests address it by (``name:model``), defaulting to ``provider``; a name of its own lets two endpoints of one implementation coexist. ``api_key`` may be left out for a backend that needs none, or for an endpoint of its own (``api_base``), which is called with a placeholder key. ``client_args`` is whatever the provider's SDK client needs beyond the key (Bedrock's region and IAM pair), the same shape an organization provider key takes. Values under credential-shaped names come back masked. ``restricted_to_organization_id`` keeps the provider to one organization; every other one is served as if it were not configured. + Configure a provider this deployment will serve hosted inference on. ``provider`` is the any-llm implementation. ``name`` is what requests address it by (``name:model``), defaulting to ``provider``; a name of its own lets two endpoints of one implementation coexist. ``api_key`` may be left out for a backend that needs none, or for an endpoint of its own (``api_base``), which is called with a placeholder key. ``client_args`` is whatever the provider's SDK client needs beyond the key (Bedrock's region and IAM pair), the same shape an organization provider key takes. Values under credential-shaped names come back masked. ``restricted_to_organization_id`` keeps the provider to one organization; every other one is served as if it were not configured. ``serves_unlisted_models`` serves a model the roster does not list, as a ``config.yml`` instance does, and switches on every model it offers whether or not something prices it. """ # noqa: E501 api_base: Optional[Annotated[str, Field(strict=True, max_length=1024)]] = None api_key: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1024)]] = None - client_args: Optional[Dict[str, Any]] = None + client_args: Optional[Dict[str, Any]] = Field(default=None, description="Tags for cost attribution, recorded on the request's usage rows and filterable in the usage API: up to 16 string pairs, keys up to 64 characters and values up to 512. A null value is ignored. LiteLLM's nested `spend_logs_metadata` object is also read, and wins over a flat key of the same name; it is never forwarded to the provider.") enabled: Optional[StrictBool] = True name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=64)]] = None provider: Annotated[str, Field(min_length=1, strict=True, max_length=64)] restricted_to_organization_id: Optional[UUID] = None - __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "enabled", "name", "provider", "restricted_to_organization_id"] + serves_unlisted_models: Optional[StrictBool] = False + __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "enabled", "name", "provider", "restricted_to_organization_id", "serves_unlisted_models"] model_config = ConfigDict( validate_by_name=True, @@ -120,7 +121,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, "name": obj.get("name"), "provider": obj.get("provider"), - "restricted_to_organization_id": obj.get("restricted_to_organization_id") + "restricted_to_organization_id": obj.get("restricted_to_organization_id"), + "serves_unlisted_models": obj.get("serves_unlisted_models") if obj.get("serves_unlisted_models") is not None else False }) return _obj diff --git a/src/otari/_client/models/hosted_provider_public.py b/src/otari/_client/models/hosted_provider_public.py index 9bb54652..0337bea3 100644 --- a/src/otari/_client/models/hosted_provider_public.py +++ b/src/otari/_client/models/hosted_provider_public.py @@ -27,7 +27,7 @@ class HostedProviderPublic(BaseModel): """ - One hosted provider, known by its name, its implementation and the tail of its key. No shape in this section carries key material: a stored credential is known by its last four characters and nothing else, ``client_args`` goes out with credential-shaped values masked, and ``api_base`` with the password in its userinfo and its query values masked. ``name`` is what requests address and every route takes; ``provider`` is the any-llm implementation. ``source`` says where the provider is defined. A ``config`` provider comes from the ``hosted_providers:`` block, has no row and so no ``id`` or timestamps, and is changed by editing the configuration rather than through this API; its models are administered as a stored provider's are. ``shadows_config`` marks a stored provider that wins over a configuration entry of the same name, which serves again once the row is deleted. ``has_api_key`` is false for one stored without a key, and ``decryptable`` false for one whose key or extras no configured ``OTARI_SECRET_KEY`` reads, which serves nothing until re-entered. + One hosted provider, known by its name, its implementation and the tail of its key. No shape in this section carries key material: a stored credential is known by its last four characters and nothing else, ``client_args`` goes out with credential-shaped values masked, and ``api_base`` with the password in its userinfo and its query values masked. ``name`` is what requests address and every route takes; ``provider`` is the any-llm implementation. ``source`` says where the provider is defined. A ``config`` provider comes from the ``hosted_providers:`` block, has no row and so no ``id`` or timestamps, and is changed by editing the configuration rather than through this API; its models are administered as a stored provider's are. ``shadows_config`` marks a stored provider that wins over a configuration entry of the same name, which serves again once the row is deleted. ``has_api_key`` is false for one stored without a key, and ``decryptable`` false for one whose key or extras no configured ``OTARI_SECRET_KEY`` reads, which serves nothing until re-entered. ``serves_unlisted_models`` is true for one that serves a model its roster does not list. """ # noqa: E501 api_base: Optional[StrictStr] = None api_key_last4: Optional[StrictStr] = None @@ -40,10 +40,11 @@ class HostedProviderPublic(BaseModel): name: StrictStr provider: StrictStr restricted_to_organization_id: Optional[UUID] = None + serves_unlisted_models: Optional[StrictBool] = False shadows_config: Optional[StrictBool] = False source: Optional[StrictStr] = 'database' updated_at: Optional[datetime] = None - __properties: ClassVar[List[str]] = ["api_base", "api_key_last4", "client_args", "created_at", "decryptable", "enabled", "has_api_key", "id", "name", "provider", "restricted_to_organization_id", "shadows_config", "source", "updated_at"] + __properties: ClassVar[List[str]] = ["api_base", "api_key_last4", "client_args", "created_at", "decryptable", "enabled", "has_api_key", "id", "name", "provider", "restricted_to_organization_id", "serves_unlisted_models", "shadows_config", "source", "updated_at"] @field_validator('source') def source_validate_enum(cls, value): @@ -152,6 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "provider": obj.get("provider"), "restricted_to_organization_id": obj.get("restricted_to_organization_id"), + "serves_unlisted_models": obj.get("serves_unlisted_models") if obj.get("serves_unlisted_models") is not None else False, "shadows_config": obj.get("shadows_config") if obj.get("shadows_config") is not None else False, "source": obj.get("source") if obj.get("source") is not None else 'database', "updated_at": obj.get("updated_at") diff --git a/src/otari/_client/models/hosted_provider_update_request.py b/src/otari/_client/models/hosted_provider_update_request.py index 2b1370c7..ced134b4 100644 --- a/src/otari/_client/models/hosted_provider_update_request.py +++ b/src/otari/_client/models/hosted_provider_update_request.py @@ -34,7 +34,8 @@ class HostedProviderUpdateRequest(BaseModel): client_args: Optional[Dict[str, Any]] = None enabled: Optional[StrictBool] = None restricted_to_organization_id: Optional[UUID] = None - __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "enabled", "restricted_to_organization_id"] + serves_unlisted_models: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "enabled", "restricted_to_organization_id", "serves_unlisted_models"] model_config = ConfigDict( validate_by_name=True, @@ -100,6 +101,11 @@ def to_dict(self) -> Dict[str, Any]: if self.restricted_to_organization_id is None and "restricted_to_organization_id" in self.model_fields_set: _dict['restricted_to_organization_id'] = None + # set to None if serves_unlisted_models (nullable) is None + # and model_fields_set contains the field + if self.serves_unlisted_models is None and "serves_unlisted_models" in self.model_fields_set: + _dict['serves_unlisted_models'] = None + return _dict @classmethod @@ -116,7 +122,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "api_key": obj.get("api_key"), "client_args": obj.get("client_args"), "enabled": obj.get("enabled"), - "restricted_to_organization_id": obj.get("restricted_to_organization_id") + "restricted_to_organization_id": obj.get("restricted_to_organization_id"), + "serves_unlisted_models": obj.get("serves_unlisted_models") }) return _obj diff --git a/src/otari/_client/models/provider_health_summary.py b/src/otari/_client/models/provider_health_summary.py new file mode 100644 index 00000000..280f157b --- /dev/null +++ b/src/otari/_client/models/provider_health_summary.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.provider_history_point import ProviderHistoryPoint +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProviderHealthSummary(BaseModel): + """ + One provider's offerings in the latest finished run. ``down`` when none answered, ``degraded`` when some did not, ``ok`` when all did. + """ # noqa: E501 + answered: StrictInt + history: List[ProviderHistoryPoint] = Field(description="Every finished run in the last 24 hours, oldest first.") + provider: StrictStr + status: StrictStr + top_error: Optional[StrictStr] = Field(description="The most common failure, with the model id taken out.") + top_error_count: StrictInt + total: StrictInt + __properties: ClassVar[List[str]] = ["answered", "history", "provider", "status", "top_error", "top_error_count", "total"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ok', 'degraded', 'down']): + raise ValueError("must be one of enum values ('ok', 'degraded', 'down')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProviderHealthSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in history (list) + _items = [] + if self.history: + for _item_history in self.history: + if _item_history: + _items.append(_item_history.to_dict()) + _dict['history'] = _items + # set to None if top_error (nullable) is None + # and model_fields_set contains the field + if self.top_error is None and "top_error" in self.model_fields_set: + _dict['top_error'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProviderHealthSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "answered": obj.get("answered"), + "history": [ProviderHistoryPoint.from_dict(_item) for _item in obj["history"]] if obj.get("history") is not None else None, + "provider": obj.get("provider"), + "status": obj.get("status"), + "top_error": obj.get("top_error"), + "top_error_count": obj.get("top_error_count"), + "total": obj.get("total") + }) + return _obj + + diff --git a/src/otari/_client/models/provider_history_point.py b/src/otari/_client/models/provider_history_point.py new file mode 100644 index 00000000..5b981d19 --- /dev/null +++ b/src/otari/_client/models/provider_history_point.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProviderHistoryPoint(BaseModel): + """ + How one provider did in one run. + """ # noqa: E501 + answered: StrictInt + started_at: datetime + total: StrictInt + __properties: ClassVar[List[str]] = ["answered", "started_at", "total"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProviderHistoryPoint from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProviderHistoryPoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "answered": obj.get("answered"), + "started_at": obj.get("started_at"), + "total": obj.get("total") + }) + return _obj + + diff --git a/src/otari/_client/models/provider_info_schema.py b/src/otari/_client/models/provider_info_schema.py index bfc5874c..08ea479e 100644 --- a/src/otari/_client/models/provider_info_schema.py +++ b/src/otari/_client/models/provider_info_schema.py @@ -36,7 +36,7 @@ class ProviderInfoSchema(BaseModel): name: StrictStr = Field(description="Human-friendly provider name.") pricing_urls: Optional[List[StrictStr]] = None provider_type: StrictStr = Field(description="Underlying any-llm provider type.") - source: Optional[StrictStr] = Field(default='config', description="Where the instance is defined: 'config' for config.yml (or OTARI_CONFIG_YAML), 'dashboard' for one stored through the deployment providers page.") + source: Optional[StrictStr] = Field(default='config', description="Where the instance is defined: 'config' for config.yml (or OTARI_CONFIG_YAML).") __properties: ClassVar[List[str]] = ["capabilities", "description", "doc_url", "env_key", "instance", "name", "pricing_urls", "provider_type", "source"] @field_validator('source') @@ -45,8 +45,8 @@ def source_validate_enum(cls, value): if value is None: return value - if value not in set(['config', 'dashboard']): - raise ValueError("must be one of enum values ('config', 'dashboard')") + if value not in set(['config']): + raise ValueError("must be one of enum values ('config')") return value model_config = ConfigDict( diff --git a/src/otari/_client/models/span_public.py b/src/otari/_client/models/span_public.py index 641d9c6f..462c1c06 100644 --- a/src/otari/_client/models/span_public.py +++ b/src/otari/_client/models/span_public.py @@ -31,11 +31,13 @@ class SpanPublic(BaseModel): """ # noqa: E501 approximate: StrictBool = Field(description="True when the start was inferred rather than measured.") attributes: Dict[str, AttributesValue] + cache_read_tokens: Optional[StrictInt] = Field(description="Input tokens read from the prompt cache.") + cache_write_tokens: Optional[StrictInt] = Field(description="Input tokens written to the prompt cache.") cost: Optional[Union[StrictFloat, StrictInt]] duration_ms: Optional[StrictInt] end_time: Optional[datetime] error_class: Optional[StrictStr] - input_tokens: Optional[StrictInt] + input_tokens: Optional[StrictInt] = Field(description="The whole prompt, cached tokens included.") kind: StrictStr model: Optional[StrictStr] name: StrictStr @@ -48,6 +50,7 @@ class SpanPublic(BaseModel): output_tokens: Optional[StrictInt] parent_span_id: Optional[StrictStr] provider: Optional[StrictStr] + reasoning_tokens: Optional[StrictInt] = Field(description="Output tokens spent reasoning.") recovered: StrictBool request_id: Optional[StrictStr] span_id: StrictStr @@ -55,7 +58,7 @@ class SpanPublic(BaseModel): tool_call_id: Optional[StrictStr] tool_name: Optional[StrictStr] tool_type: Optional[StrictStr] - __properties: ClassVar[List[str]] = ["approximate", "attributes", "cost", "duration_ms", "end_time", "error_class", "input_tokens", "kind", "model", "name", "opens_turn", "operation", "origin", "otel_span_id", "otel_trace_id", "outcome", "output_tokens", "parent_span_id", "provider", "recovered", "request_id", "span_id", "start_time", "tool_call_id", "tool_name", "tool_type"] + __properties: ClassVar[List[str]] = ["approximate", "attributes", "cache_read_tokens", "cache_write_tokens", "cost", "duration_ms", "end_time", "error_class", "input_tokens", "kind", "model", "name", "opens_turn", "operation", "origin", "otel_span_id", "otel_trace_id", "outcome", "output_tokens", "parent_span_id", "provider", "reasoning_tokens", "recovered", "request_id", "span_id", "start_time", "tool_call_id", "tool_name", "tool_type"] @field_validator('origin') def origin_validate_enum(cls, value): @@ -117,6 +120,16 @@ def to_dict(self) -> Dict[str, Any]: if self.attributes[_key_attributes]: _field_dict[_key_attributes] = self.attributes[_key_attributes].to_dict() _dict['attributes'] = _field_dict + # set to None if cache_read_tokens (nullable) is None + # and model_fields_set contains the field + if self.cache_read_tokens is None and "cache_read_tokens" in self.model_fields_set: + _dict['cache_read_tokens'] = None + + # set to None if cache_write_tokens (nullable) is None + # and model_fields_set contains the field + if self.cache_write_tokens is None and "cache_write_tokens" in self.model_fields_set: + _dict['cache_write_tokens'] = None + # set to None if cost (nullable) is None # and model_fields_set contains the field if self.cost is None and "cost" in self.model_fields_set: @@ -177,6 +190,11 @@ def to_dict(self) -> Dict[str, Any]: if self.provider is None and "provider" in self.model_fields_set: _dict['provider'] = None + # set to None if reasoning_tokens (nullable) is None + # and model_fields_set contains the field + if self.reasoning_tokens is None and "reasoning_tokens" in self.model_fields_set: + _dict['reasoning_tokens'] = None + # set to None if request_id (nullable) is None # and model_fields_set contains the field if self.request_id is None and "request_id" in self.model_fields_set: @@ -221,6 +239,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: ) if obj.get("attributes") is not None else None, + "cache_read_tokens": obj.get("cache_read_tokens"), + "cache_write_tokens": obj.get("cache_write_tokens"), "cost": obj.get("cost"), "duration_ms": obj.get("duration_ms"), "end_time": obj.get("end_time"), @@ -238,6 +258,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "output_tokens": obj.get("output_tokens"), "parent_span_id": obj.get("parent_span_id"), "provider": obj.get("provider"), + "reasoning_tokens": obj.get("reasoning_tokens"), "recovered": obj.get("recovered"), "request_id": obj.get("request_id"), "span_id": obj.get("span_id"), diff --git a/src/otari/_client/models/stored_provider_response.py b/src/otari/_client/models/stored_provider_response.py deleted file mode 100644 index b9a04297..00000000 --- a/src/otari/_client/models/stored_provider_response.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding: utf-8 - -""" - otari - - Otari, an OpenAI-compatible LLM gateway with API key management - - The version of the OpenAPI document: 0.0.0-dev - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self -from pydantic_core import to_jsonable_python - -class StoredProviderResponse(BaseModel): - """ - A runtime-stored provider. The API key is never returned, only ``last4``. - """ # noqa: E501 - api_base: Optional[StrictStr] = None - client_args: Optional[Dict[str, Any]] = None - created_at: Optional[StrictStr] = None - decryptable: Optional[StrictBool] = True - instance: StrictStr - last4: Optional[StrictStr] = None - provider_type: Optional[StrictStr] = None - updated_at: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["api_base", "client_args", "created_at", "decryptable", "instance", "last4", "provider_type", "updated_at"] - - model_config = ConfigDict( - validate_by_name=True, - validate_by_alias=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(to_jsonable_python(self.to_dict())) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of StoredProviderResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if api_base (nullable) is None - # and model_fields_set contains the field - if self.api_base is None and "api_base" in self.model_fields_set: - _dict['api_base'] = None - - # set to None if created_at (nullable) is None - # and model_fields_set contains the field - if self.created_at is None and "created_at" in self.model_fields_set: - _dict['created_at'] = None - - # set to None if last4 (nullable) is None - # and model_fields_set contains the field - if self.last4 is None and "last4" in self.model_fields_set: - _dict['last4'] = None - - # set to None if provider_type (nullable) is None - # and model_fields_set contains the field - if self.provider_type is None and "provider_type" in self.model_fields_set: - _dict['provider_type'] = None - - # set to None if updated_at (nullable) is None - # and model_fields_set contains the field - if self.updated_at is None and "updated_at" in self.model_fields_set: - _dict['updated_at'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of StoredProviderResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "api_base": obj.get("api_base"), - "client_args": obj.get("client_args"), - "created_at": obj.get("created_at"), - "decryptable": obj.get("decryptable") if obj.get("decryptable") is not None else True, - "instance": obj.get("instance"), - "last4": obj.get("last4"), - "provider_type": obj.get("provider_type"), - "updated_at": obj.get("updated_at") - }) - return _obj - - diff --git a/src/otari/_client/models/trace_bucket_public.py b/src/otari/_client/models/trace_bucket_public.py index f665e61f..9abc15fa 100644 --- a/src/otari/_client/models/trace_bucket_public.py +++ b/src/otari/_client/models/trace_bucket_public.py @@ -28,8 +28,8 @@ class TraceBucketPublic(BaseModel): TraceBucketPublic """ # noqa: E501 bucket: StrictStr = Field(description="Bucket start, ISO 8601 UTC.") - failed: StrictInt - succeeded: StrictInt + failed: StrictInt = Field(description="Sessions that started in the bucket and hold an unrecovered error other than a tool's. A tool's error, an MCP tool's included, goes back to the model, so it alone does not fail a session.") + succeeded: StrictInt = Field(description="Sessions that started in the bucket and did not fail.") __properties: ClassVar[List[str]] = ["bucket", "failed", "succeeded"] model_config = ConfigDict( diff --git a/src/otari/_client/models/trace_summary_public.py b/src/otari/_client/models/trace_summary_public.py index a7a65170..ad0d344f 100644 --- a/src/otari/_client/models/trace_summary_public.py +++ b/src/otari/_client/models/trace_summary_public.py @@ -31,7 +31,7 @@ class TraceSummaryPublic(BaseModel): """ # noqa: E501 api_key_id: Optional[StrictStr] cost: Union[StrictFloat, StrictInt] = Field(description="USD, a snapshot of the usage rows' cost. Usage stays the billing record.") - error_count: StrictInt = Field(description="Spans that ended in an error no fallback recovered.") + error_count: StrictInt = Field(description="Spans that ended in an error no fallback recovered, including tools' errors, which do not fail the session.") harness: Optional[StrictStr] = Field(description="The agent or client that sent the requests, from its User-Agent.") input_tokens: StrictInt last_activity_at: datetime diff --git a/src/otari/_client/models/turn_public.py b/src/otari/_client/models/turn_public.py index c030d8b7..ce73ead4 100644 --- a/src/otari/_client/models/turn_public.py +++ b/src/otari/_client/models/turn_public.py @@ -28,6 +28,7 @@ class TurnPublic(BaseModel): """ One user prompt and the steps it caused. """ # noqa: E501 + cache_read_tokens: StrictInt continued: StrictBool = Field(description="True for steps a session started with before any prompt was seen.") cost: Union[StrictFloat, StrictInt] ended_at: Optional[datetime] @@ -40,7 +41,7 @@ class TurnPublic(BaseModel): state: StrictStr step_ids: List[StrictStr] tool_calls: StrictInt - __properties: ClassVar[List[str]] = ["continued", "cost", "ended_at", "errors", "index", "input_tokens", "llm_calls", "output_tokens", "started_at", "state", "step_ids", "tool_calls"] + __properties: ClassVar[List[str]] = ["cache_read_tokens", "continued", "cost", "ended_at", "errors", "index", "input_tokens", "llm_calls", "output_tokens", "started_at", "state", "step_ids", "tool_calls"] @field_validator('state') def state_validate_enum(cls, value): @@ -110,6 +111,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "cache_read_tokens": obj.get("cache_read_tokens"), "continued": obj.get("continued"), "cost": obj.get("cost"), "ended_at": obj.get("ended_at"), diff --git a/src/otari/_client/models/test_provider_request.py b/src/otari/_client/models/workspace_mcp_server_check_request.py similarity index 52% rename from src/otari/_client/models/test_provider_request.py rename to src/otari/_client/models/workspace_mcp_server_check_request.py index d534fc28..b614ccc5 100644 --- a/src/otari/_client/models/test_provider_request.py +++ b/src/otari/_client/models/workspace_mcp_server_check_request.py @@ -17,22 +17,23 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from uuid import UUID from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -class TestProviderRequest(BaseModel): +class WorkspaceMcpServerCheckRequest(BaseModel): """ - Credentials to test before saving (from the add-provider form). + Connection details to check without storing them, for a form to test before it saves. ``server_id`` names a stored server whose token stands in when ``authorization_token`` is omitted, so an edit form can test a new URL with a token it was never shown. ``\"\"`` checks with no token at all. """ # noqa: E501 - api_base: Optional[StrictStr] = None - api_key: Optional[StrictStr] = None - client_args: Optional[Dict[str, Any]] = None - instance: Optional[StrictStr] = Field(default=None, description="Provider/instance name; the impl when no provider_type.") - provider_type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["api_base", "api_key", "client_args", "instance", "provider_type"] + allowed_tools: Optional[Annotated[List[Annotated[str, Field(strict=True, max_length=256)]], Field(max_length=200)]] = Field(default=None, description="The allow-list to report the catalog against") + authorization_token: Optional[Annotated[str, Field(strict=True, max_length=8192)]] = Field(default=None, description="Bearer token; omit to use the stored server's, if any") + server_id: Optional[UUID] = Field(default=None, description="A stored server whose token to use") + url: Annotated[str, Field(min_length=1, strict=True, max_length=2048)] = Field(description="Streamable HTTP MCP endpoint") + __properties: ClassVar[List[str]] = ["allowed_tools", "authorization_token", "server_id", "url"] model_config = ConfigDict( validate_by_name=True, @@ -52,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of TestProviderRequest from a JSON string""" + """Create an instance of WorkspaceMcpServerCheckRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,36 +74,26 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if api_base (nullable) is None + # set to None if allowed_tools (nullable) is None # and model_fields_set contains the field - if self.api_base is None and "api_base" in self.model_fields_set: - _dict['api_base'] = None + if self.allowed_tools is None and "allowed_tools" in self.model_fields_set: + _dict['allowed_tools'] = None - # set to None if api_key (nullable) is None + # set to None if authorization_token (nullable) is None # and model_fields_set contains the field - if self.api_key is None and "api_key" in self.model_fields_set: - _dict['api_key'] = None + if self.authorization_token is None and "authorization_token" in self.model_fields_set: + _dict['authorization_token'] = None - # set to None if client_args (nullable) is None + # set to None if server_id (nullable) is None # and model_fields_set contains the field - if self.client_args is None and "client_args" in self.model_fields_set: - _dict['client_args'] = None - - # set to None if instance (nullable) is None - # and model_fields_set contains the field - if self.instance is None and "instance" in self.model_fields_set: - _dict['instance'] = None - - # set to None if provider_type (nullable) is None - # and model_fields_set contains the field - if self.provider_type is None and "provider_type" in self.model_fields_set: - _dict['provider_type'] = None + if self.server_id is None and "server_id" in self.model_fields_set: + _dict['server_id'] = None return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of TestProviderRequest from a dict""" + """Create an instance of WorkspaceMcpServerCheckRequest from a dict""" if obj is None: return None @@ -110,11 +101,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "api_base": obj.get("api_base"), - "api_key": obj.get("api_key"), - "client_args": obj.get("client_args"), - "instance": obj.get("instance"), - "provider_type": obj.get("provider_type") + "allowed_tools": obj.get("allowed_tools"), + "authorization_token": obj.get("authorization_token"), + "server_id": obj.get("server_id"), + "url": obj.get("url") }) return _obj diff --git a/src/otari/_client/models/workspace_mcp_server_health.py b/src/otari/_client/models/workspace_mcp_server_health.py new file mode 100644 index 00000000..e92fe62a --- /dev/null +++ b/src/otari/_client/models/workspace_mcp_server_health.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + otari + + Otari, an OpenAI-compatible LLM gateway with API key management + + The version of the OpenAPI document: 0.0.0-dev + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from otari._client.models.check_failure import CheckFailure +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class WorkspaceMcpServerHealth(BaseModel): + """ + The last connection check: whether the gateway reached the server, and what it found. Describes the server as the gateway saw it at ``checked_at``, not now: a server that answered then can be down since, and the request path checks nothing in advance on the strength of this. + """ # noqa: E501 + checked_at: StrictStr + error: Optional[CheckFailure] = Field(default=None, description="Why the check failed; null when healthy") + http_status: Optional[StrictInt] = Field(default=None, description="The HTTP status the server refused with, if any") + missing_allowed_tools: Optional[List[StrictStr]] = Field(default=None, description="Allow-listed names the server did not offer") + status: StrictStr + tool_count: Optional[StrictInt] = Field(default=None, description="Live tools the allow-list admits; null when the check failed") + tools: Optional[List[StrictStr]] = Field(default=None, description="Every tool name the server offers, allowed or not, up to 200; empty on a failure") + __properties: ClassVar[List[str]] = ["checked_at", "error", "http_status", "missing_allowed_tools", "status", "tool_count", "tools"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['healthy', 'failing']): + raise ValueError("must be one of enum values ('healthy', 'failing')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WorkspaceMcpServerHealth from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if error (nullable) is None + # and model_fields_set contains the field + if self.error is None and "error" in self.model_fields_set: + _dict['error'] = None + + # set to None if http_status (nullable) is None + # and model_fields_set contains the field + if self.http_status is None and "http_status" in self.model_fields_set: + _dict['http_status'] = None + + # set to None if tool_count (nullable) is None + # and model_fields_set contains the field + if self.tool_count is None and "tool_count" in self.model_fields_set: + _dict['tool_count'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WorkspaceMcpServerHealth from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "checked_at": obj.get("checked_at"), + "error": obj.get("error"), + "http_status": obj.get("http_status"), + "missing_allowed_tools": obj.get("missing_allowed_tools"), + "status": obj.get("status"), + "tool_count": obj.get("tool_count"), + "tools": obj.get("tools") + }) + return _obj + + diff --git a/src/otari/_client/models/workspace_mcp_server_public.py b/src/otari/_client/models/workspace_mcp_server_public.py index 32965a07..631b2598 100644 --- a/src/otari/_client/models/workspace_mcp_server_public.py +++ b/src/otari/_client/models/workspace_mcp_server_public.py @@ -17,9 +17,10 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from uuid import UUID +from otari._client.models.workspace_mcp_server_health import WorkspaceMcpServerHealth from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -32,13 +33,14 @@ class WorkspaceMcpServerPublic(BaseModel): created_at: StrictStr enabled: StrictBool has_token: StrictBool + health: Optional[WorkspaceMcpServerHealth] = Field(description="The last connection check; null until one has run") id: UUID name: StrictStr purpose_hint: Optional[StrictStr] updated_at: StrictStr url: StrictStr workspace_id: UUID - __properties: ClassVar[List[str]] = ["allowed_tools", "created_at", "enabled", "has_token", "id", "name", "purpose_hint", "updated_at", "url", "workspace_id"] + __properties: ClassVar[List[str]] = ["allowed_tools", "created_at", "enabled", "has_token", "health", "id", "name", "purpose_hint", "updated_at", "url", "workspace_id"] model_config = ConfigDict( validate_by_name=True, @@ -79,11 +81,19 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of health + if self.health: + _dict['health'] = self.health.to_dict() # set to None if allowed_tools (nullable) is None # and model_fields_set contains the field if self.allowed_tools is None and "allowed_tools" in self.model_fields_set: _dict['allowed_tools'] = None + # set to None if health (nullable) is None + # and model_fields_set contains the field + if self.health is None and "health" in self.model_fields_set: + _dict['health'] = None + # set to None if purpose_hint (nullable) is None # and model_fields_set contains the field if self.purpose_hint is None and "purpose_hint" in self.model_fields_set: @@ -105,6 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "created_at": obj.get("created_at"), "enabled": obj.get("enabled"), "has_token": obj.get("has_token"), + "health": WorkspaceMcpServerHealth.from_dict(obj["health"]) if obj.get("health") is not None else None, "id": obj.get("id"), "name": obj.get("name"), "purpose_hint": obj.get("purpose_hint"),