beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc4__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/api/agents/delete_agent_history.py +155 -0
- beamlit/api/agents/get_agent_deployment.py +1 -22
- beamlit/api/agents/get_agent_environment_logs.py +151 -0
- beamlit/api/agents/get_agent_history.py +155 -0
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/put_agent_history.py +181 -0
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/models/get_model_environment_logs.py +155 -0
- beamlit/common/generate.py +8 -3
- beamlit/common/settings.py +1 -5
- beamlit/models/__init__.py +28 -30
- beamlit/models/acl.py +2 -0
- beamlit/models/agent.py +2 -0
- beamlit/models/agent_chain.py +2 -0
- beamlit/models/agent_configuration.py +2 -0
- beamlit/models/agent_deployment.py +44 -99
- beamlit/models/agent_deployment_configuration.py +45 -0
- beamlit/models/agent_deployment_history.py +15 -46
- beamlit/models/agent_deployment_history_event.py +24 -78
- beamlit/models/agent_deployment_pod_template.py +45 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +2 -0
- beamlit/models/agent_spec.py +238 -0
- beamlit/models/agent_with_deployments.py +2 -0
- beamlit/models/api_key.py +2 -0
- beamlit/models/authentication_provider_model.py +2 -0
- beamlit/models/authentication_provider_organization.py +2 -0
- beamlit/models/configuration.py +2 -0
- beamlit/models/continent.py +2 -0
- beamlit/models/core_spec.py +179 -0
- beamlit/models/country.py +2 -0
- beamlit/models/create_api_key_for_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_response_200.py +2 -0
- beamlit/models/delete_workspace_service_account_response_200.py +2 -0
- beamlit/models/deployment_configuration.py +2 -0
- beamlit/models/deployment_configurations.py +2 -0
- beamlit/models/deployment_serverless_config.py +131 -0
- beamlit/models/environment.py +2 -0
- beamlit/models/environment_metrics.py +2 -0
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +2 -0
- beamlit/models/function.py +2 -0
- beamlit/models/function_configuration.py +2 -0
- beamlit/models/function_deployment.py +44 -99
- beamlit/models/function_deployment_configuration.py +45 -0
- beamlit/models/function_deployment_pod_template.py +45 -0
- beamlit/models/function_kit.py +2 -0
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +2 -0
- beamlit/models/function_release.py +2 -0
- beamlit/models/function_spec.py +240 -0
- beamlit/models/function_with_deployments.py +2 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
- beamlit/models/increase_and_rate_metric.py +2 -0
- beamlit/models/integration.py +2 -0
- beamlit/models/integration_config.py +2 -0
- beamlit/models/integration_connection.py +2 -0
- beamlit/models/integration_connection_config.py +2 -0
- beamlit/models/integration_connection_secret.py +2 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +2 -0
- beamlit/models/integration_secret.py +2 -0
- beamlit/models/invite_workspace_user_body.py +2 -0
- beamlit/models/labels_type_0.py +2 -0
- beamlit/models/location.py +2 -0
- beamlit/models/location_response.py +2 -0
- beamlit/models/metadata.py +135 -0
- beamlit/models/metadata_labels.py +43 -0
- beamlit/models/metric.py +2 -0
- beamlit/models/metrics.py +2 -0
- beamlit/models/model.py +2 -0
- beamlit/models/model_deployment.py +66 -85
- beamlit/models/model_deployment_log.py +2 -0
- beamlit/models/model_deployment_metrics.py +2 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
- beamlit/models/model_deployment_pod_template.py +45 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +2 -0
- beamlit/models/model_provider.py +2 -0
- beamlit/models/model_provider_ref.py +2 -0
- beamlit/models/model_release.py +2 -0
- beamlit/models/model_spec.py +188 -0
- beamlit/models/model_with_deployments.py +2 -0
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +2 -0
- beamlit/models/pending_invitation_accept.py +2 -0
- beamlit/models/pending_invitation_render.py +2 -0
- beamlit/models/pending_invitation_render_invited_by.py +2 -0
- beamlit/models/pending_invitation_render_workspace.py +2 -0
- beamlit/models/pending_invitation_workspace_details.py +2 -0
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +36 -8
- beamlit/models/policy_location.py +2 -0
- beamlit/models/policy_spec.py +119 -0
- beamlit/models/provider_config.py +2 -0
- beamlit/models/qps.py +2 -0
- beamlit/models/resource_deployment_log.py +2 -0
- beamlit/models/resource_deployment_metrics.py +70 -155
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
- beamlit/models/resource_environment_metrics.py +172 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +2 -0
- beamlit/models/runtime.py +14 -29
- beamlit/models/runtime_readiness_probe.py +45 -0
- beamlit/models/runtime_resources.py +2 -0
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +2 -0
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +2 -0
- beamlit/models/store_agent.py +15 -29
- beamlit/models/store_agent_configuration.py +2 -0
- beamlit/models/store_agent_labels.py +45 -0
- beamlit/models/store_configuration.py +6 -15
- beamlit/models/store_configuration_option.py +7 -18
- beamlit/models/store_function.py +15 -29
- beamlit/models/store_function_configuration.py +2 -0
- beamlit/models/store_function_kit.py +2 -0
- beamlit/models/store_function_labels.py +45 -0
- beamlit/models/store_function_parameter.py +2 -0
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +2 -0
- beamlit/models/update_workspace_service_account_response_200.py +2 -0
- beamlit/models/update_workspace_user_role_body.py +2 -0
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +2 -0
- beamlit/models/workspace_labels.py +2 -0
- beamlit/models/workspace_user.py +2 -0
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,172 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, 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.metric import Metric
|
10
|
+
from ..models.qps import QPS
|
11
|
+
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
12
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
13
|
+
)
|
14
|
+
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
15
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetrics")
|
20
|
+
|
21
|
+
|
22
|
+
@_attrs_define
|
23
|
+
class ResourceEnvironmentMetrics:
|
24
|
+
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
25
|
+
|
26
|
+
Attributes:
|
27
|
+
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
28
|
+
inference_per_second_per_region (Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]):
|
29
|
+
Historical requests per second (RPS) per location, for the model deployment
|
30
|
+
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
31
|
+
query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
|
32
|
+
code (e.g. 200, 400) or per location
|
33
|
+
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
34
|
+
(e.g. 200, 400) or per location
|
35
|
+
query_per_second_per_region_per_code (Union[Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode]):
|
36
|
+
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
37
|
+
"""
|
38
|
+
|
39
|
+
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
40
|
+
inference_per_second_per_region: Union[Unset, "ResourceEnvironmentMetricsInferencePerSecondPerRegion"] = UNSET
|
41
|
+
query_per_second_global: Union[Unset, float] = UNSET
|
42
|
+
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
43
|
+
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
44
|
+
query_per_second_per_region_per_code: Union[Unset, "ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode"] = (
|
45
|
+
UNSET
|
46
|
+
)
|
47
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
48
|
+
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
50
|
+
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
51
|
+
if not isinstance(self.inference_per_second_global, Unset):
|
52
|
+
inference_per_second_global = []
|
53
|
+
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
54
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
55
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
56
|
+
|
57
|
+
inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
58
|
+
if not isinstance(self.inference_per_second_per_region, Unset):
|
59
|
+
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
60
|
+
|
61
|
+
query_per_second_global = self.query_per_second_global
|
62
|
+
|
63
|
+
query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
|
64
|
+
if not isinstance(self.query_per_second_per_code_global, Unset):
|
65
|
+
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
66
|
+
|
67
|
+
query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
68
|
+
if not isinstance(self.query_per_second_per_region, Unset):
|
69
|
+
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
70
|
+
|
71
|
+
query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
|
72
|
+
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
73
|
+
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
74
|
+
|
75
|
+
field_dict: dict[str, Any] = {}
|
76
|
+
field_dict.update(self.additional_properties)
|
77
|
+
field_dict.update({})
|
78
|
+
if inference_per_second_global is not UNSET:
|
79
|
+
field_dict["inference_per_second_global"] = inference_per_second_global
|
80
|
+
if inference_per_second_per_region is not UNSET:
|
81
|
+
field_dict["inference_per_second_per_region"] = inference_per_second_per_region
|
82
|
+
if query_per_second_global is not UNSET:
|
83
|
+
field_dict["query_per_second_global"] = query_per_second_global
|
84
|
+
if query_per_second_per_code_global is not UNSET:
|
85
|
+
field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
|
86
|
+
if query_per_second_per_region is not UNSET:
|
87
|
+
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
88
|
+
if query_per_second_per_region_per_code is not UNSET:
|
89
|
+
field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
|
90
|
+
|
91
|
+
return field_dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
95
|
+
from ..models.metric import Metric
|
96
|
+
from ..models.qps import QPS
|
97
|
+
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
98
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
99
|
+
)
|
100
|
+
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
101
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
102
|
+
)
|
103
|
+
|
104
|
+
d = src_dict.copy()
|
105
|
+
inference_per_second_global = []
|
106
|
+
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
107
|
+
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
108
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
109
|
+
|
110
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
111
|
+
|
112
|
+
_inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
|
113
|
+
inference_per_second_per_region: Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]
|
114
|
+
if isinstance(_inference_per_second_per_region, Unset):
|
115
|
+
inference_per_second_per_region = UNSET
|
116
|
+
else:
|
117
|
+
inference_per_second_per_region = ResourceEnvironmentMetricsInferencePerSecondPerRegion.from_dict(
|
118
|
+
_inference_per_second_per_region
|
119
|
+
)
|
120
|
+
|
121
|
+
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
122
|
+
|
123
|
+
_query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
|
124
|
+
query_per_second_per_code_global: Union[Unset, QPS]
|
125
|
+
if isinstance(_query_per_second_per_code_global, Unset):
|
126
|
+
query_per_second_per_code_global = UNSET
|
127
|
+
else:
|
128
|
+
query_per_second_per_code_global = QPS.from_dict(_query_per_second_per_code_global)
|
129
|
+
|
130
|
+
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
131
|
+
query_per_second_per_region: Union[Unset, QPS]
|
132
|
+
if isinstance(_query_per_second_per_region, Unset):
|
133
|
+
query_per_second_per_region = UNSET
|
134
|
+
else:
|
135
|
+
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
136
|
+
|
137
|
+
_query_per_second_per_region_per_code = d.pop("query_per_second_per_region_per_code", UNSET)
|
138
|
+
query_per_second_per_region_per_code: Union[Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode]
|
139
|
+
if isinstance(_query_per_second_per_region_per_code, Unset):
|
140
|
+
query_per_second_per_region_per_code = UNSET
|
141
|
+
else:
|
142
|
+
query_per_second_per_region_per_code = ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode.from_dict(
|
143
|
+
_query_per_second_per_region_per_code
|
144
|
+
)
|
145
|
+
|
146
|
+
resource_environment_metrics = cls(
|
147
|
+
inference_per_second_global=inference_per_second_global,
|
148
|
+
inference_per_second_per_region=inference_per_second_per_region,
|
149
|
+
query_per_second_global=query_per_second_global,
|
150
|
+
query_per_second_per_code_global=query_per_second_per_code_global,
|
151
|
+
query_per_second_per_region=query_per_second_per_region,
|
152
|
+
query_per_second_per_region_per_code=query_per_second_per_region_per_code,
|
153
|
+
)
|
154
|
+
|
155
|
+
resource_environment_metrics.additional_properties = d
|
156
|
+
return resource_environment_metrics
|
157
|
+
|
158
|
+
@property
|
159
|
+
def additional_keys(self) -> list[str]:
|
160
|
+
return list(self.additional_properties.keys())
|
161
|
+
|
162
|
+
def __getitem__(self, key: str) -> Any:
|
163
|
+
return self.additional_properties[key]
|
164
|
+
|
165
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
166
|
+
self.additional_properties[key] = value
|
167
|
+
|
168
|
+
def __delitem__(self, key: str) -> None:
|
169
|
+
del self.additional_properties[key]
|
170
|
+
|
171
|
+
def __contains__(self, key: str) -> bool:
|
172
|
+
return key in self.additional_properties
|
@@ -0,0 +1,75 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, 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.metric import Metric
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetricsInferencePerSecondPerRegion")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
17
|
+
"""Historical requests per second (RPS) per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, List['Metric']]): Array of metrics
|
21
|
+
"""
|
22
|
+
|
23
|
+
region: Union[Unset, List["Metric"]] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
region: Union[Unset, List[Dict[str, Any]]] = UNSET
|
28
|
+
if not isinstance(self.region, Unset):
|
29
|
+
region = []
|
30
|
+
for componentsschemas_array_metric_item_data in self.region:
|
31
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
32
|
+
region.append(componentsschemas_array_metric_item)
|
33
|
+
|
34
|
+
field_dict: dict[str, Any] = {}
|
35
|
+
field_dict.update(self.additional_properties)
|
36
|
+
field_dict.update({})
|
37
|
+
if region is not UNSET:
|
38
|
+
field_dict["region"] = region
|
39
|
+
|
40
|
+
return field_dict
|
41
|
+
|
42
|
+
@classmethod
|
43
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
44
|
+
from ..models.metric import Metric
|
45
|
+
|
46
|
+
d = src_dict.copy()
|
47
|
+
region = []
|
48
|
+
_region = d.pop("region", UNSET)
|
49
|
+
for componentsschemas_array_metric_item_data in _region or []:
|
50
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
51
|
+
|
52
|
+
region.append(componentsschemas_array_metric_item)
|
53
|
+
|
54
|
+
resource_environment_metrics_inference_per_second_per_region = cls(
|
55
|
+
region=region,
|
56
|
+
)
|
57
|
+
|
58
|
+
resource_environment_metrics_inference_per_second_per_region.additional_properties = d
|
59
|
+
return resource_environment_metrics_inference_per_second_per_region
|
60
|
+
|
61
|
+
@property
|
62
|
+
def additional_keys(self) -> list[str]:
|
63
|
+
return list(self.additional_properties.keys())
|
64
|
+
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
66
|
+
return self.additional_properties[key]
|
67
|
+
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
69
|
+
self.additional_properties[key] = value
|
70
|
+
|
71
|
+
def __delitem__(self, key: str) -> None:
|
72
|
+
del self.additional_properties[key]
|
73
|
+
|
74
|
+
def __contains__(self, key: str) -> bool:
|
75
|
+
return key in self.additional_properties
|
@@ -0,0 +1,73 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, 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.qps import QPS
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode:
|
17
|
+
"""RPS value (in last 24 hours) per response status code per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200, 400) or per
|
21
|
+
location
|
22
|
+
"""
|
23
|
+
|
24
|
+
region: Union[Unset, "QPS"] = UNSET
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
|
+
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
28
|
+
region: Union[Unset, Dict[str, Any]] = UNSET
|
29
|
+
if not isinstance(self.region, Unset):
|
30
|
+
region = self.region.to_dict()
|
31
|
+
|
32
|
+
field_dict: dict[str, Any] = {}
|
33
|
+
field_dict.update(self.additional_properties)
|
34
|
+
field_dict.update({})
|
35
|
+
if region is not UNSET:
|
36
|
+
field_dict["region"] = region
|
37
|
+
|
38
|
+
return field_dict
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
42
|
+
from ..models.qps import QPS
|
43
|
+
|
44
|
+
d = src_dict.copy()
|
45
|
+
_region = d.pop("region", UNSET)
|
46
|
+
region: Union[Unset, QPS]
|
47
|
+
if isinstance(_region, Unset):
|
48
|
+
region = UNSET
|
49
|
+
else:
|
50
|
+
region = QPS.from_dict(_region)
|
51
|
+
|
52
|
+
resource_environment_metrics_query_per_second_per_region_per_code = cls(
|
53
|
+
region=region,
|
54
|
+
)
|
55
|
+
|
56
|
+
resource_environment_metrics_query_per_second_per_region_per_code.additional_properties = d
|
57
|
+
return resource_environment_metrics_query_per_second_per_region_per_code
|
58
|
+
|
59
|
+
@property
|
60
|
+
def additional_keys(self) -> list[str]:
|
61
|
+
return list(self.additional_properties.keys())
|
62
|
+
|
63
|
+
def __getitem__(self, key: str) -> Any:
|
64
|
+
return self.additional_properties[key]
|
65
|
+
|
66
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
67
|
+
self.additional_properties[key] = value
|
68
|
+
|
69
|
+
def __delitem__(self, key: str) -> None:
|
70
|
+
del self.additional_properties[key]
|
71
|
+
|
72
|
+
def __contains__(self, key: str) -> bool:
|
73
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, 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="ResourceLog")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class ResourceLog:
|
13
|
+
"""Log for a resource deployment (eg. model deployment, function deployment)
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
message (Union[Unset, str]): Content of the log
|
17
|
+
timestamp (Union[Unset, str]): The timestamp of the log
|
18
|
+
"""
|
19
|
+
|
20
|
+
message: Union[Unset, str] = UNSET
|
21
|
+
timestamp: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
message = self.message
|
26
|
+
|
27
|
+
timestamp = self.timestamp
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if message is not UNSET:
|
33
|
+
field_dict["message"] = message
|
34
|
+
if timestamp is not UNSET:
|
35
|
+
field_dict["timestamp"] = timestamp
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
message = d.pop("message", UNSET)
|
43
|
+
|
44
|
+
timestamp = d.pop("timestamp", UNSET)
|
45
|
+
|
46
|
+
resource_log = cls(
|
47
|
+
message=message,
|
48
|
+
timestamp=timestamp,
|
49
|
+
)
|
50
|
+
|
51
|
+
resource_log.additional_properties = d
|
52
|
+
return resource_log
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
beamlit/models/runtime.py
CHANGED
@@ -6,7 +6,7 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
9
|
+
from ..models.runtime_readiness_probe import RuntimeReadinessProbe
|
10
10
|
from ..models.runtime_resources import RuntimeResources
|
11
11
|
|
12
12
|
|
@@ -24,8 +24,7 @@ class Runtime:
|
|
24
24
|
Kubernetes EnvVar types
|
25
25
|
image (Union[Unset, str]): The Docker image for the deployment
|
26
26
|
model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
|
27
|
-
readiness_probe (Union[
|
28
|
-
Probe type
|
27
|
+
readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
|
29
28
|
resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
|
30
29
|
ResourceRequirements type
|
31
30
|
type (Union[Unset, str]): The type of origin for the deployment
|
@@ -36,14 +35,12 @@ class Runtime:
|
|
36
35
|
envs: Union[Unset, List[Any]] = UNSET
|
37
36
|
image: Union[Unset, str] = UNSET
|
38
37
|
model: Union[Unset, str] = UNSET
|
39
|
-
readiness_probe: Union["
|
38
|
+
readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
|
40
39
|
resources: Union[Unset, "RuntimeResources"] = UNSET
|
41
40
|
type: Union[Unset, str] = UNSET
|
42
41
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
43
42
|
|
44
43
|
def to_dict(self) -> dict[str, Any]:
|
45
|
-
from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
|
46
|
-
|
47
44
|
args: Union[Unset, List[Any]] = UNSET
|
48
45
|
if not isinstance(self.args, Unset):
|
49
46
|
args = self.args
|
@@ -60,13 +57,9 @@ class Runtime:
|
|
60
57
|
|
61
58
|
model = self.model
|
62
59
|
|
63
|
-
readiness_probe: Union[Dict[str, Any]
|
64
|
-
if isinstance(self.readiness_probe, Unset):
|
65
|
-
readiness_probe = UNSET
|
66
|
-
elif isinstance(self.readiness_probe, RuntimeReadinessProbeType0):
|
60
|
+
readiness_probe: Union[Unset, Dict[str, Any]] = UNSET
|
61
|
+
if not isinstance(self.readiness_probe, Unset):
|
67
62
|
readiness_probe = self.readiness_probe.to_dict()
|
68
|
-
else:
|
69
|
-
readiness_probe = self.readiness_probe
|
70
63
|
|
71
64
|
resources: Union[Unset, Dict[str, Any]] = UNSET
|
72
65
|
if not isinstance(self.resources, Unset):
|
@@ -98,9 +91,11 @@ class Runtime:
|
|
98
91
|
|
99
92
|
@classmethod
|
100
93
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
101
|
-
from ..models.
|
94
|
+
from ..models.runtime_readiness_probe import RuntimeReadinessProbe
|
102
95
|
from ..models.runtime_resources import RuntimeResources
|
103
96
|
|
97
|
+
if not src_dict:
|
98
|
+
return None
|
104
99
|
d = src_dict.copy()
|
105
100
|
args = cast(List[Any], d.pop("args", UNSET))
|
106
101
|
|
@@ -112,22 +107,12 @@ class Runtime:
|
|
112
107
|
|
113
108
|
model = d.pop("model", UNSET)
|
114
109
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if not isinstance(data, dict):
|
122
|
-
raise TypeError()
|
123
|
-
readiness_probe_type_0 = RuntimeReadinessProbeType0.from_dict(data)
|
124
|
-
|
125
|
-
return readiness_probe_type_0
|
126
|
-
except: # noqa: E722
|
127
|
-
pass
|
128
|
-
return cast(Union["RuntimeReadinessProbeType0", None, Unset], data)
|
129
|
-
|
130
|
-
readiness_probe = _parse_readiness_probe(d.pop("readiness_probe", UNSET))
|
110
|
+
_readiness_probe = d.pop("readiness_probe", UNSET)
|
111
|
+
readiness_probe: Union[Unset, RuntimeReadinessProbe]
|
112
|
+
if isinstance(_readiness_probe, Unset):
|
113
|
+
readiness_probe = UNSET
|
114
|
+
else:
|
115
|
+
readiness_probe = RuntimeReadinessProbe.from_dict(_readiness_probe)
|
131
116
|
|
132
117
|
_resources = d.pop("resources", UNSET)
|
133
118
|
resources: Union[Unset, RuntimeResources]
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeReadinessProbe")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeReadinessProbe:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
runtime_readiness_probe = cls()
|
27
|
+
|
28
|
+
runtime_readiness_probe.additional_properties = d
|
29
|
+
return runtime_readiness_probe
|
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,111 @@
|
|
1
|
+
from typing import Any, List, Type, 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
|
+
T = TypeVar("T", bound="RuntimeType0")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RuntimeType0:
|
13
|
+
"""Set of configurations for a deployment
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
args (Union[Unset, List[Any]]): The arguments to pass to the deployment runtime
|
17
|
+
command (Union[Unset, List[Any]]): The command to run the deployment
|
18
|
+
envs (Union[Unset, List[Any]]): The environment variables to set in the deployment. Should be a list of
|
19
|
+
Kubernetes EnvVar types
|
20
|
+
image (Union[Unset, str]): The Docker image for the deployment
|
21
|
+
model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
|
22
|
+
type (Union[Unset, str]): The type of origin for the deployment
|
23
|
+
"""
|
24
|
+
|
25
|
+
args: Union[Unset, List[Any]] = UNSET
|
26
|
+
command: Union[Unset, List[Any]] = UNSET
|
27
|
+
envs: Union[Unset, List[Any]] = UNSET
|
28
|
+
image: Union[Unset, str] = UNSET
|
29
|
+
model: Union[Unset, str] = UNSET
|
30
|
+
type: Union[Unset, str] = UNSET
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
32
|
+
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
34
|
+
args: Union[Unset, List[Any]] = UNSET
|
35
|
+
if not isinstance(self.args, Unset):
|
36
|
+
args = self.args
|
37
|
+
|
38
|
+
command: Union[Unset, List[Any]] = UNSET
|
39
|
+
if not isinstance(self.command, Unset):
|
40
|
+
command = self.command
|
41
|
+
|
42
|
+
envs: Union[Unset, List[Any]] = UNSET
|
43
|
+
if not isinstance(self.envs, Unset):
|
44
|
+
envs = self.envs
|
45
|
+
|
46
|
+
image = self.image
|
47
|
+
|
48
|
+
model = self.model
|
49
|
+
|
50
|
+
type = self.type
|
51
|
+
|
52
|
+
field_dict: dict[str, Any] = {}
|
53
|
+
field_dict.update(self.additional_properties)
|
54
|
+
field_dict.update({})
|
55
|
+
if args is not UNSET:
|
56
|
+
field_dict["args"] = args
|
57
|
+
if command is not UNSET:
|
58
|
+
field_dict["command"] = command
|
59
|
+
if envs is not UNSET:
|
60
|
+
field_dict["envs"] = envs
|
61
|
+
if image is not UNSET:
|
62
|
+
field_dict["image"] = image
|
63
|
+
if model is not UNSET:
|
64
|
+
field_dict["model"] = model
|
65
|
+
if type is not UNSET:
|
66
|
+
field_dict["type"] = type
|
67
|
+
|
68
|
+
return field_dict
|
69
|
+
|
70
|
+
@classmethod
|
71
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
72
|
+
d = src_dict.copy()
|
73
|
+
args = cast(List[Any], d.pop("args", UNSET))
|
74
|
+
|
75
|
+
command = cast(List[Any], d.pop("command", UNSET))
|
76
|
+
|
77
|
+
envs = cast(List[Any], d.pop("envs", UNSET))
|
78
|
+
|
79
|
+
image = d.pop("image", UNSET)
|
80
|
+
|
81
|
+
model = d.pop("model", UNSET)
|
82
|
+
|
83
|
+
type = d.pop("type", UNSET)
|
84
|
+
|
85
|
+
runtime_type_0 = cls(
|
86
|
+
args=args,
|
87
|
+
command=command,
|
88
|
+
envs=envs,
|
89
|
+
image=image,
|
90
|
+
model=model,
|
91
|
+
type=type,
|
92
|
+
)
|
93
|
+
|
94
|
+
runtime_type_0.additional_properties = d
|
95
|
+
return runtime_type_0
|
96
|
+
|
97
|
+
@property
|
98
|
+
def additional_keys(self) -> list[str]:
|
99
|
+
return list(self.additional_properties.keys())
|
100
|
+
|
101
|
+
def __getitem__(self, key: str) -> Any:
|
102
|
+
return self.additional_properties[key]
|
103
|
+
|
104
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
105
|
+
self.additional_properties[key] = value
|
106
|
+
|
107
|
+
def __delitem__(self, key: str) -> None:
|
108
|
+
del self.additional_properties[key]
|
109
|
+
|
110
|
+
def __contains__(self, key: str) -> bool:
|
111
|
+
return key in self.additional_properties
|