blaxel 0.64.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blaxel/__init__.py +8 -0
- blaxel/agents/__init__.py +5 -0
- blaxel/agents/chain.py +153 -0
- blaxel/agents/chat.py +286 -0
- blaxel/agents/decorator.py +208 -0
- blaxel/agents/thread.py +24 -0
- blaxel/agents/voice/openai.py +255 -0
- blaxel/agents/voice/utils.py +25 -0
- blaxel/api/__init__.py +1 -0
- blaxel/api/agents/__init__.py +0 -0
- blaxel/api/agents/create_agent.py +155 -0
- blaxel/api/agents/delete_agent.py +146 -0
- blaxel/api/agents/get_agent.py +146 -0
- blaxel/api/agents/get_agent_logs.py +151 -0
- blaxel/api/agents/get_agent_metrics.py +150 -0
- blaxel/api/agents/get_agent_trace_ids.py +201 -0
- blaxel/api/agents/list_agent_revisions.py +155 -0
- blaxel/api/agents/list_agents.py +127 -0
- blaxel/api/agents/update_agent.py +168 -0
- blaxel/api/configurations/__init__.py +0 -0
- blaxel/api/configurations/get_configuration.py +122 -0
- blaxel/api/default/__init__.py +0 -0
- blaxel/api/default/get_trace.py +150 -0
- blaxel/api/default/get_trace_ids.py +218 -0
- blaxel/api/default/get_trace_logs.py +186 -0
- blaxel/api/default/list_mcp_hub_definitions.py +127 -0
- blaxel/api/functions/__init__.py +0 -0
- blaxel/api/functions/create_function.py +155 -0
- blaxel/api/functions/delete_function.py +146 -0
- blaxel/api/functions/get_function.py +146 -0
- blaxel/api/functions/get_function_logs.py +151 -0
- blaxel/api/functions/get_function_metrics.py +150 -0
- blaxel/api/functions/get_function_trace_ids.py +201 -0
- blaxel/api/functions/list_function_revisions.py +158 -0
- blaxel/api/functions/list_functions.py +131 -0
- blaxel/api/functions/update_function.py +168 -0
- blaxel/api/integrations/__init__.py +0 -0
- blaxel/api/integrations/create_integration_connection.py +167 -0
- blaxel/api/integrations/delete_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration.py +97 -0
- blaxel/api/integrations/get_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration_connection_model.py +104 -0
- blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
- blaxel/api/integrations/list_integration_connection_models.py +97 -0
- blaxel/api/integrations/list_integration_connections.py +139 -0
- blaxel/api/integrations/update_integration_connection.py +180 -0
- blaxel/api/invitations/__init__.py +0 -0
- blaxel/api/invitations/list_all_pending_invitations.py +142 -0
- blaxel/api/knowledgebases/__init__.py +0 -0
- blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
- blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
- blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
- blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
- blaxel/api/locations/__init__.py +0 -0
- blaxel/api/locations/list_locations.py +139 -0
- blaxel/api/metrics/__init__.py +0 -0
- blaxel/api/metrics/get_metrics.py +130 -0
- blaxel/api/models/__init__.py +0 -0
- blaxel/api/models/create_model.py +163 -0
- blaxel/api/models/delete_model.py +154 -0
- blaxel/api/models/get_model.py +154 -0
- blaxel/api/models/get_model_logs.py +155 -0
- blaxel/api/models/get_model_metrics.py +158 -0
- blaxel/api/models/get_model_trace_ids.py +201 -0
- blaxel/api/models/list_model_revisions.py +158 -0
- blaxel/api/models/list_models.py +135 -0
- blaxel/api/models/update_model.py +176 -0
- blaxel/api/policies/__init__.py +0 -0
- blaxel/api/policies/create_policy.py +167 -0
- blaxel/api/policies/delete_policy.py +154 -0
- blaxel/api/policies/get_policy.py +154 -0
- blaxel/api/policies/list_policies.py +139 -0
- blaxel/api/policies/update_policy.py +180 -0
- blaxel/api/privateclusters/__init__.py +0 -0
- blaxel/api/privateclusters/create_private_cluster.py +132 -0
- blaxel/api/privateclusters/delete_private_cluster.py +156 -0
- blaxel/api/privateclusters/get_private_cluster.py +159 -0
- blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
- blaxel/api/privateclusters/list_private_clusters.py +140 -0
- blaxel/api/privateclusters/update_private_cluster.py +156 -0
- blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
- blaxel/api/service_accounts/__init__.py +0 -0
- blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
- blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
- blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
- blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
- blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
- blaxel/api/store/__init__.py +0 -0
- blaxel/api/store/get_store_agent.py +146 -0
- blaxel/api/store/get_store_function.py +146 -0
- blaxel/api/store/list_store_agents.py +131 -0
- blaxel/api/store/list_store_functions.py +131 -0
- blaxel/api/workspaces/__init__.py +0 -0
- blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
- blaxel/api/workspaces/create_worspace.py +163 -0
- blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
- blaxel/api/workspaces/delete_workspace.py +154 -0
- blaxel/api/workspaces/get_workspace.py +154 -0
- blaxel/api/workspaces/invite_workspace_user.py +174 -0
- blaxel/api/workspaces/leave_workspace.py +161 -0
- blaxel/api/workspaces/list_workspace_users.py +139 -0
- blaxel/api/workspaces/list_workspaces.py +139 -0
- blaxel/api/workspaces/remove_workspace_user.py +101 -0
- blaxel/api/workspaces/update_workspace.py +176 -0
- blaxel/api/workspaces/update_workspace_user_role.py +187 -0
- blaxel/authentication/__init__.py +45 -0
- blaxel/authentication/apikey.py +50 -0
- blaxel/authentication/authentication.py +176 -0
- blaxel/authentication/clientcredentials.py +103 -0
- blaxel/authentication/credentials.py +295 -0
- blaxel/authentication/device_mode.py +197 -0
- blaxel/client.py +281 -0
- blaxel/common/__init__.py +17 -0
- blaxel/common/error.py +27 -0
- blaxel/common/instrumentation.py +317 -0
- blaxel/common/logger.py +60 -0
- blaxel/common/secrets.py +39 -0
- blaxel/common/settings.py +150 -0
- blaxel/common/slugify.py +18 -0
- blaxel/common/utils.py +34 -0
- blaxel/deploy/__init__.py +8 -0
- blaxel/deploy/deploy.py +316 -0
- blaxel/deploy/format.py +46 -0
- blaxel/deploy/parser.py +192 -0
- blaxel/errors.py +16 -0
- blaxel/functions/__init__.py +7 -0
- blaxel/functions/common.py +228 -0
- blaxel/functions/decorator.py +64 -0
- blaxel/functions/local/local.py +48 -0
- blaxel/functions/mcp/client.py +96 -0
- blaxel/functions/mcp/mcp.py +168 -0
- blaxel/functions/mcp/utils.py +56 -0
- blaxel/functions/remote/remote.py +183 -0
- blaxel/models/__init__.py +233 -0
- blaxel/models/acl.py +133 -0
- blaxel/models/agent.py +126 -0
- blaxel/models/agent_chain.py +88 -0
- blaxel/models/agent_spec.py +346 -0
- blaxel/models/api_key.py +142 -0
- blaxel/models/configuration.py +85 -0
- blaxel/models/continent.py +70 -0
- blaxel/models/core_event.py +97 -0
- blaxel/models/core_spec.py +249 -0
- blaxel/models/core_spec_configurations.py +77 -0
- blaxel/models/country.py +70 -0
- blaxel/models/create_api_key_for_service_account_body.py +69 -0
- blaxel/models/create_workspace_service_account_body.py +71 -0
- blaxel/models/create_workspace_service_account_response_200.py +105 -0
- blaxel/models/delete_workspace_service_account_response_200.py +96 -0
- blaxel/models/entrypoint.py +96 -0
- blaxel/models/entrypoint_env.py +45 -0
- blaxel/models/flavor.py +70 -0
- blaxel/models/form.py +120 -0
- blaxel/models/form_config.py +45 -0
- blaxel/models/form_oauthomitempty.py +45 -0
- blaxel/models/form_secrets.py +45 -0
- blaxel/models/function.py +126 -0
- blaxel/models/function_kit.py +97 -0
- blaxel/models/function_spec.py +310 -0
- blaxel/models/get_trace_ids_response_200.py +45 -0
- blaxel/models/get_trace_logs_response_200.py +45 -0
- blaxel/models/get_trace_response_200.py +45 -0
- blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
- blaxel/models/histogram_bucket.py +79 -0
- blaxel/models/histogram_stats.py +88 -0
- blaxel/models/integration_connection.py +96 -0
- blaxel/models/integration_connection_spec.py +114 -0
- blaxel/models/integration_connection_spec_config.py +45 -0
- blaxel/models/integration_connection_spec_secret.py +45 -0
- blaxel/models/integration_model.py +162 -0
- blaxel/models/integration_repository.py +88 -0
- blaxel/models/invite_workspace_user_body.py +60 -0
- blaxel/models/knowledgebase.py +126 -0
- blaxel/models/knowledgebase_spec.py +163 -0
- blaxel/models/knowledgebase_spec_options.py +45 -0
- blaxel/models/last_n_requests_metric.py +79 -0
- blaxel/models/latency_metric.py +144 -0
- blaxel/models/location_response.py +113 -0
- blaxel/models/mcp_definition.py +188 -0
- blaxel/models/mcp_definition_entrypoint.py +45 -0
- blaxel/models/mcp_definition_form.py +45 -0
- blaxel/models/metadata.py +139 -0
- blaxel/models/metadata_labels.py +45 -0
- blaxel/models/metric.py +79 -0
- blaxel/models/metrics.py +169 -0
- blaxel/models/metrics_models.py +45 -0
- blaxel/models/metrics_request_total_per_code.py +45 -0
- blaxel/models/metrics_rps_per_code.py +45 -0
- blaxel/models/model.py +126 -0
- blaxel/models/model_private_cluster.py +79 -0
- blaxel/models/model_spec.py +249 -0
- blaxel/models/o_auth.py +72 -0
- blaxel/models/owner_fields.py +70 -0
- blaxel/models/pending_invitation.py +124 -0
- blaxel/models/pending_invitation_accept.py +85 -0
- blaxel/models/pending_invitation_render.py +147 -0
- blaxel/models/pending_invitation_render_invited_by.py +88 -0
- blaxel/models/pending_invitation_render_workspace.py +70 -0
- blaxel/models/pending_invitation_workspace_details.py +72 -0
- blaxel/models/pod_template_spec.py +45 -0
- blaxel/models/policy.py +96 -0
- blaxel/models/policy_location.py +70 -0
- blaxel/models/policy_max_tokens.py +106 -0
- blaxel/models/policy_spec.py +151 -0
- blaxel/models/private_cluster.py +183 -0
- blaxel/models/private_location.py +61 -0
- blaxel/models/repository.py +70 -0
- blaxel/models/request_duration_over_time_metric.py +97 -0
- blaxel/models/request_duration_over_time_metrics.py +80 -0
- blaxel/models/request_total_by_origin_metric.py +115 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
- blaxel/models/request_total_metric.py +123 -0
- blaxel/models/request_total_metric_request_total_per_code.py +45 -0
- blaxel/models/request_total_metric_rps_per_code.py +45 -0
- blaxel/models/resource_log.py +79 -0
- blaxel/models/resource_metrics.py +270 -0
- blaxel/models/resource_metrics_request_total_per_code.py +45 -0
- blaxel/models/resource_metrics_rps_per_code.py +45 -0
- blaxel/models/revision_configuration.py +97 -0
- blaxel/models/revision_metadata.py +124 -0
- blaxel/models/runtime.py +196 -0
- blaxel/models/runtime_startup_probe.py +45 -0
- blaxel/models/serverless_config.py +80 -0
- blaxel/models/spec_configuration.py +70 -0
- blaxel/models/store_agent.py +178 -0
- blaxel/models/store_agent_labels.py +45 -0
- blaxel/models/store_configuration.py +151 -0
- blaxel/models/store_configuration_option.py +79 -0
- blaxel/models/store_function.py +211 -0
- blaxel/models/store_function_kit.py +97 -0
- blaxel/models/store_function_labels.py +45 -0
- blaxel/models/store_function_parameter.py +88 -0
- blaxel/models/time_fields.py +70 -0
- blaxel/models/token_rate_metric.py +88 -0
- blaxel/models/token_rate_metrics.py +120 -0
- blaxel/models/token_total_metric.py +106 -0
- blaxel/models/trace_ids_response.py +45 -0
- blaxel/models/update_workspace_service_account_body.py +69 -0
- blaxel/models/update_workspace_service_account_response_200.py +96 -0
- blaxel/models/update_workspace_user_role_body.py +60 -0
- blaxel/models/websocket_channel.py +88 -0
- blaxel/models/workspace.py +148 -0
- blaxel/models/workspace_labels.py +45 -0
- blaxel/models/workspace_user.py +115 -0
- blaxel/py.typed +1 -0
- blaxel/run.py +108 -0
- blaxel/serve/app.py +131 -0
- blaxel/serve/middlewares/__init__.py +10 -0
- blaxel/serve/middlewares/accesslog.py +32 -0
- blaxel/serve/middlewares/processtime.py +28 -0
- blaxel/types.py +46 -0
- blaxel-0.64.0.dist-info/METADATA +96 -0
- blaxel-0.64.0.dist-info/RECORD +261 -0
- blaxel-0.64.0.dist-info/WHEEL +4 -0
- blaxel-0.64.0.dist-info/entry_points.txt +2 -0
- blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
blaxel/models/metrics.py
ADDED
@@ -0,0 +1,169 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.metrics_models import MetricsModels
|
10
|
+
from ..models.metrics_request_total_per_code import MetricsRequestTotalPerCode
|
11
|
+
from ..models.metrics_rps_per_code import MetricsRpsPerCode
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="Metrics")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class Metrics:
|
19
|
+
"""Metrics for resources
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
agents (Union[Unset, Any]): Metrics for agents
|
23
|
+
functions (Union[Unset, Any]): Metrics for functions
|
24
|
+
inference_global (Union[Unset, list[Any]]): Historical requests for all resources globally
|
25
|
+
models (Union[Unset, MetricsModels]): Metrics for models
|
26
|
+
request_total (Union[Unset, float]): Number of requests for all resources globally
|
27
|
+
request_total_per_code (Union[Unset, MetricsRequestTotalPerCode]): Number of requests for all resources globally
|
28
|
+
per code
|
29
|
+
rps (Union[Unset, float]): Number of requests per second for all resources globally
|
30
|
+
rps_per_code (Union[Unset, MetricsRpsPerCode]): Number of requests per second for all resources globally per
|
31
|
+
code
|
32
|
+
"""
|
33
|
+
|
34
|
+
agents: Union[Unset, Any] = UNSET
|
35
|
+
functions: Union[Unset, Any] = UNSET
|
36
|
+
inference_global: Union[Unset, list[Any]] = UNSET
|
37
|
+
models: Union[Unset, "MetricsModels"] = UNSET
|
38
|
+
request_total: Union[Unset, float] = UNSET
|
39
|
+
request_total_per_code: Union[Unset, "MetricsRequestTotalPerCode"] = UNSET
|
40
|
+
rps: Union[Unset, float] = UNSET
|
41
|
+
rps_per_code: Union[Unset, "MetricsRpsPerCode"] = UNSET
|
42
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
43
|
+
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
45
|
+
agents = self.agents
|
46
|
+
|
47
|
+
functions = self.functions
|
48
|
+
|
49
|
+
inference_global: Union[Unset, list[Any]] = UNSET
|
50
|
+
if not isinstance(self.inference_global, Unset):
|
51
|
+
inference_global = self.inference_global
|
52
|
+
|
53
|
+
models: Union[Unset, dict[str, Any]] = UNSET
|
54
|
+
if self.models and not isinstance(self.models, Unset) and not isinstance(self.models, dict):
|
55
|
+
models = self.models.to_dict()
|
56
|
+
elif self.models and isinstance(self.models, dict):
|
57
|
+
models = self.models
|
58
|
+
|
59
|
+
request_total = self.request_total
|
60
|
+
|
61
|
+
request_total_per_code: Union[Unset, dict[str, Any]] = UNSET
|
62
|
+
if (
|
63
|
+
self.request_total_per_code
|
64
|
+
and not isinstance(self.request_total_per_code, Unset)
|
65
|
+
and not isinstance(self.request_total_per_code, dict)
|
66
|
+
):
|
67
|
+
request_total_per_code = self.request_total_per_code.to_dict()
|
68
|
+
elif self.request_total_per_code and isinstance(self.request_total_per_code, dict):
|
69
|
+
request_total_per_code = self.request_total_per_code
|
70
|
+
|
71
|
+
rps = self.rps
|
72
|
+
|
73
|
+
rps_per_code: Union[Unset, dict[str, Any]] = UNSET
|
74
|
+
if self.rps_per_code and not isinstance(self.rps_per_code, Unset) and not isinstance(self.rps_per_code, dict):
|
75
|
+
rps_per_code = self.rps_per_code.to_dict()
|
76
|
+
elif self.rps_per_code and isinstance(self.rps_per_code, dict):
|
77
|
+
rps_per_code = self.rps_per_code
|
78
|
+
|
79
|
+
field_dict: dict[str, Any] = {}
|
80
|
+
field_dict.update(self.additional_properties)
|
81
|
+
field_dict.update({})
|
82
|
+
if agents is not UNSET:
|
83
|
+
field_dict["agents"] = agents
|
84
|
+
if functions is not UNSET:
|
85
|
+
field_dict["functions"] = functions
|
86
|
+
if inference_global is not UNSET:
|
87
|
+
field_dict["inferenceGlobal"] = inference_global
|
88
|
+
if models is not UNSET:
|
89
|
+
field_dict["models"] = models
|
90
|
+
if request_total is not UNSET:
|
91
|
+
field_dict["requestTotal"] = request_total
|
92
|
+
if request_total_per_code is not UNSET:
|
93
|
+
field_dict["requestTotalPerCode"] = request_total_per_code
|
94
|
+
if rps is not UNSET:
|
95
|
+
field_dict["rps"] = rps
|
96
|
+
if rps_per_code is not UNSET:
|
97
|
+
field_dict["rpsPerCode"] = rps_per_code
|
98
|
+
|
99
|
+
return field_dict
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
103
|
+
from ..models.metrics_models import MetricsModels
|
104
|
+
from ..models.metrics_request_total_per_code import MetricsRequestTotalPerCode
|
105
|
+
from ..models.metrics_rps_per_code import MetricsRpsPerCode
|
106
|
+
|
107
|
+
if not src_dict:
|
108
|
+
return None
|
109
|
+
d = src_dict.copy()
|
110
|
+
agents = d.pop("agents", UNSET)
|
111
|
+
|
112
|
+
functions = d.pop("functions", UNSET)
|
113
|
+
|
114
|
+
inference_global = cast(list[Any], d.pop("inferenceGlobal", UNSET))
|
115
|
+
|
116
|
+
_models = d.pop("models", UNSET)
|
117
|
+
models: Union[Unset, MetricsModels]
|
118
|
+
if isinstance(_models, Unset):
|
119
|
+
models = UNSET
|
120
|
+
else:
|
121
|
+
models = MetricsModels.from_dict(_models)
|
122
|
+
|
123
|
+
request_total = d.pop("requestTotal", UNSET)
|
124
|
+
|
125
|
+
_request_total_per_code = d.pop("requestTotalPerCode", UNSET)
|
126
|
+
request_total_per_code: Union[Unset, MetricsRequestTotalPerCode]
|
127
|
+
if isinstance(_request_total_per_code, Unset):
|
128
|
+
request_total_per_code = UNSET
|
129
|
+
else:
|
130
|
+
request_total_per_code = MetricsRequestTotalPerCode.from_dict(_request_total_per_code)
|
131
|
+
|
132
|
+
rps = d.pop("rps", UNSET)
|
133
|
+
|
134
|
+
_rps_per_code = d.pop("rpsPerCode", UNSET)
|
135
|
+
rps_per_code: Union[Unset, MetricsRpsPerCode]
|
136
|
+
if isinstance(_rps_per_code, Unset):
|
137
|
+
rps_per_code = UNSET
|
138
|
+
else:
|
139
|
+
rps_per_code = MetricsRpsPerCode.from_dict(_rps_per_code)
|
140
|
+
|
141
|
+
metrics = cls(
|
142
|
+
agents=agents,
|
143
|
+
functions=functions,
|
144
|
+
inference_global=inference_global,
|
145
|
+
models=models,
|
146
|
+
request_total=request_total,
|
147
|
+
request_total_per_code=request_total_per_code,
|
148
|
+
rps=rps,
|
149
|
+
rps_per_code=rps_per_code,
|
150
|
+
)
|
151
|
+
|
152
|
+
metrics.additional_properties = d
|
153
|
+
return metrics
|
154
|
+
|
155
|
+
@property
|
156
|
+
def additional_keys(self) -> list[str]:
|
157
|
+
return list(self.additional_properties.keys())
|
158
|
+
|
159
|
+
def __getitem__(self, key: str) -> Any:
|
160
|
+
return self.additional_properties[key]
|
161
|
+
|
162
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
163
|
+
self.additional_properties[key] = value
|
164
|
+
|
165
|
+
def __delitem__(self, key: str) -> None:
|
166
|
+
del self.additional_properties[key]
|
167
|
+
|
168
|
+
def __contains__(self, key: str) -> bool:
|
169
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="MetricsModels")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class MetricsModels:
|
11
|
+
"""Metrics for models"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
metrics_models = cls()
|
27
|
+
|
28
|
+
metrics_models.additional_properties = d
|
29
|
+
return metrics_models
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="MetricsRequestTotalPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class MetricsRequestTotalPerCode:
|
11
|
+
"""Number of requests for all resources globally per code"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
metrics_request_total_per_code = cls()
|
27
|
+
|
28
|
+
metrics_request_total_per_code.additional_properties = d
|
29
|
+
return metrics_request_total_per_code
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="MetricsRpsPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class MetricsRpsPerCode:
|
11
|
+
"""Number of requests per second for all resources globally per code"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
metrics_rps_per_code = cls()
|
27
|
+
|
28
|
+
metrics_rps_per_code.additional_properties = d
|
29
|
+
return metrics_rps_per_code
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
blaxel/models/model.py
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.core_event import CoreEvent
|
10
|
+
from ..models.metadata import Metadata
|
11
|
+
from ..models.model_spec import ModelSpec
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="Model")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class Model:
|
19
|
+
"""Logical object representing a model
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
+
metadata (Union[Unset, Metadata]): Metadata
|
24
|
+
spec (Union[Unset, ModelSpec]): Model specification
|
25
|
+
status (Union[Unset, str]): Model status
|
26
|
+
"""
|
27
|
+
|
28
|
+
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
30
|
+
spec: Union[Unset, "ModelSpec"] = UNSET
|
31
|
+
status: Union[Unset, str] = UNSET
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
33
|
+
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
35
|
+
events: Union[Unset, list[dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.events, Unset):
|
37
|
+
events = []
|
38
|
+
for componentsschemas_core_events_item_data in self.events:
|
39
|
+
componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
|
40
|
+
events.append(componentsschemas_core_events_item)
|
41
|
+
|
42
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
43
|
+
if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
|
44
|
+
metadata = self.metadata.to_dict()
|
45
|
+
elif self.metadata and isinstance(self.metadata, dict):
|
46
|
+
metadata = self.metadata
|
47
|
+
|
48
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
49
|
+
if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
|
50
|
+
spec = self.spec.to_dict()
|
51
|
+
elif self.spec and isinstance(self.spec, dict):
|
52
|
+
spec = self.spec
|
53
|
+
|
54
|
+
status = self.status
|
55
|
+
|
56
|
+
field_dict: dict[str, Any] = {}
|
57
|
+
field_dict.update(self.additional_properties)
|
58
|
+
field_dict.update({})
|
59
|
+
if events is not UNSET:
|
60
|
+
field_dict["events"] = events
|
61
|
+
if metadata is not UNSET:
|
62
|
+
field_dict["metadata"] = metadata
|
63
|
+
if spec is not UNSET:
|
64
|
+
field_dict["spec"] = spec
|
65
|
+
if status is not UNSET:
|
66
|
+
field_dict["status"] = status
|
67
|
+
|
68
|
+
return field_dict
|
69
|
+
|
70
|
+
@classmethod
|
71
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
72
|
+
from ..models.core_event import CoreEvent
|
73
|
+
from ..models.metadata import Metadata
|
74
|
+
from ..models.model_spec import ModelSpec
|
75
|
+
|
76
|
+
if not src_dict:
|
77
|
+
return None
|
78
|
+
d = src_dict.copy()
|
79
|
+
events = []
|
80
|
+
_events = d.pop("events", UNSET)
|
81
|
+
for componentsschemas_core_events_item_data in _events or []:
|
82
|
+
componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
|
83
|
+
|
84
|
+
events.append(componentsschemas_core_events_item)
|
85
|
+
|
86
|
+
_metadata = d.pop("metadata", UNSET)
|
87
|
+
metadata: Union[Unset, Metadata]
|
88
|
+
if isinstance(_metadata, Unset):
|
89
|
+
metadata = UNSET
|
90
|
+
else:
|
91
|
+
metadata = Metadata.from_dict(_metadata)
|
92
|
+
|
93
|
+
_spec = d.pop("spec", UNSET)
|
94
|
+
spec: Union[Unset, ModelSpec]
|
95
|
+
if isinstance(_spec, Unset):
|
96
|
+
spec = UNSET
|
97
|
+
else:
|
98
|
+
spec = ModelSpec.from_dict(_spec)
|
99
|
+
|
100
|
+
status = d.pop("status", UNSET)
|
101
|
+
|
102
|
+
model = cls(
|
103
|
+
events=events,
|
104
|
+
metadata=metadata,
|
105
|
+
spec=spec,
|
106
|
+
status=status,
|
107
|
+
)
|
108
|
+
|
109
|
+
model.additional_properties = d
|
110
|
+
return model
|
111
|
+
|
112
|
+
@property
|
113
|
+
def additional_keys(self) -> list[str]:
|
114
|
+
return list(self.additional_properties.keys())
|
115
|
+
|
116
|
+
def __getitem__(self, key: str) -> Any:
|
117
|
+
return self.additional_properties[key]
|
118
|
+
|
119
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
120
|
+
self.additional_properties[key] = value
|
121
|
+
|
122
|
+
def __delitem__(self, key: str) -> None:
|
123
|
+
del self.additional_properties[key]
|
124
|
+
|
125
|
+
def __contains__(self, key: str) -> bool:
|
126
|
+
return key in self.additional_properties
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="ModelPrivateCluster")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class ModelPrivateCluster:
|
13
|
+
"""Private cluster where the model deployment is deployed
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
base_url (Union[Unset, str]): The base url of the model in the private cluster
|
17
|
+
enabled (Union[Unset, bool]): If true, the private cluster is available
|
18
|
+
name (Union[Unset, str]): The name of the private cluster
|
19
|
+
"""
|
20
|
+
|
21
|
+
base_url: Union[Unset, str] = UNSET
|
22
|
+
enabled: Union[Unset, bool] = UNSET
|
23
|
+
name: Union[Unset, str] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
base_url = self.base_url
|
28
|
+
|
29
|
+
enabled = self.enabled
|
30
|
+
|
31
|
+
name = self.name
|
32
|
+
|
33
|
+
field_dict: dict[str, Any] = {}
|
34
|
+
field_dict.update(self.additional_properties)
|
35
|
+
field_dict.update({})
|
36
|
+
if base_url is not UNSET:
|
37
|
+
field_dict["baseUrl"] = base_url
|
38
|
+
if enabled is not UNSET:
|
39
|
+
field_dict["enabled"] = enabled
|
40
|
+
if name is not UNSET:
|
41
|
+
field_dict["name"] = name
|
42
|
+
|
43
|
+
return field_dict
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
47
|
+
if not src_dict:
|
48
|
+
return None
|
49
|
+
d = src_dict.copy()
|
50
|
+
base_url = d.pop("baseUrl", UNSET)
|
51
|
+
|
52
|
+
enabled = d.pop("enabled", UNSET)
|
53
|
+
|
54
|
+
name = d.pop("name", UNSET)
|
55
|
+
|
56
|
+
model_private_cluster = cls(
|
57
|
+
base_url=base_url,
|
58
|
+
enabled=enabled,
|
59
|
+
name=name,
|
60
|
+
)
|
61
|
+
|
62
|
+
model_private_cluster.additional_properties = d
|
63
|
+
return model_private_cluster
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|