beamlit 0.0.19__py3-none-any.whl → 0.0.20rc1__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.
- beamlit/api/agents/create_agent.py +14 -9
- beamlit/api/agents/get_agent_deployment.py +22 -1
- beamlit/api/agents/update_agent.py +14 -9
- beamlit/api/functions/create_function.py +14 -9
- beamlit/api/functions/update_function.py +14 -9
- beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → integrations/create_integration_connection.py} +45 -41
- beamlit/api/integrations/delete_integration_connection.py +158 -0
- beamlit/api/integrations/get_integration.py +97 -0
- beamlit/api/integrations/get_integration_connection.py +154 -0
- beamlit/api/integrations/get_integration_connection_model.py +97 -0
- beamlit/api/integrations/get_integration_model.py +97 -0
- beamlit/api/integrations/list_integration_connection_models.py +97 -0
- beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → integrations/list_integration_connections.py} +24 -48
- beamlit/api/integrations/list_integration_models.py +97 -0
- beamlit/api/integrations/update_integration_connection.py +180 -0
- beamlit/authentication/__init__.py +2 -1
- beamlit/authentication/authentication.py +3 -0
- beamlit/authentication/clientcredentials.py +99 -0
- beamlit/authentication/credentials.py +7 -1
- beamlit/authentication/device_mode.py +0 -2
- beamlit/common/generate.py +166 -0
- beamlit/common/logger.py +30 -0
- beamlit/common/settings.py +112 -0
- beamlit/common/utils.py +13 -0
- beamlit/models/__init__.py +50 -24
- beamlit/models/agent_deployment.py +117 -49
- beamlit/models/{agent_deployment_configuration.py → agent_deployment_configuration_type_0.py} +5 -5
- beamlit/models/agent_deployment_history.py +46 -13
- beamlit/models/agent_deployment_history_event.py +78 -22
- beamlit/models/{function_deployment_pod_template.py → agent_deployment_pod_template_type_0.py} +5 -5
- beamlit/models/agent_with_deployments.py +174 -0
- beamlit/models/deployment_configurations.py +19 -6
- beamlit/models/deployment_serverless_config_type_0.py +218 -0
- beamlit/models/environment_metrics.py +19 -0
- beamlit/models/function_deployment.py +110 -42
- beamlit/models/{function_deployment_configuration.py → function_deployment_configuration_type_0.py} +5 -5
- beamlit/models/{agent_deployment_pod_template.py → function_deployment_pod_template_type_0.py} +5 -5
- beamlit/models/function_with_deployments.py +174 -0
- beamlit/models/increase_and_rate_metric.py +102 -0
- beamlit/models/integration.py +196 -0
- beamlit/models/integration_config.py +43 -0
- beamlit/models/integration_connection.py +196 -0
- beamlit/models/integration_connection_config.py +43 -0
- beamlit/models/integration_connection_secret.py +59 -0
- beamlit/models/integration_model.py +142 -0
- beamlit/models/integration_secret.py +59 -0
- beamlit/models/metrics.py +61 -20
- beamlit/models/model_deployment.py +96 -64
- beamlit/models/{model_deployment_pod_template.py → model_deployment_pod_template_type_0.py} +5 -5
- beamlit/models/policy.py +8 -34
- beamlit/models/provider_config.py +0 -9
- beamlit/models/resource_deployment_metrics.py +231 -36
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +75 -0
- beamlit/models/{resource_deployment_metrics_inference_per_second_per_region.py → resource_deployment_metrics_inference_per_second_per_region_type_0.py} +5 -5
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
- beamlit/models/{resource_deployment_metrics_query_per_second_per_region_per_code.py → resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py} +5 -5
- beamlit/models/resource_metrics.py +36 -0
- beamlit/models/runtime.py +29 -12
- beamlit/models/{runtime_readiness_probe.py → runtime_readiness_probe_type_0.py} +5 -5
- beamlit/models/store_agent.py +29 -13
- beamlit/models/{store_agent_labels.py → store_agent_labels_type_0.py} +5 -5
- beamlit/models/store_configuration.py +15 -4
- beamlit/models/store_configuration_option.py +18 -5
- beamlit/models/store_function.py +29 -13
- beamlit/models/{store_function_labels.py → store_function_labels_type_0.py} +5 -5
- beamlit/run.py +49 -0
- {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/METADATA +5 -2
- {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/RECORD +70 -46
- beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +0 -184
- beamlit/models/deployment_serverless_config.py +0 -129
- beamlit/models/labels.py +0 -43
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, 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
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.agent_deployment import AgentDeployment
|
10
|
+
from ..models.labels_type_0 import LabelsType0
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="AgentWithDeployments")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class AgentWithDeployments:
|
18
|
+
"""Logical object representing an agent but with deployment definition inside
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
22
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
23
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
24
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
25
|
+
display_name (Union[Unset, str]): Agent display name
|
26
|
+
labels (Union['LabelsType0', None, Unset]): Labels
|
27
|
+
name (Union[Unset, str]): Agent name
|
28
|
+
workspace (Union[Unset, str]): Workspace name
|
29
|
+
deployments (Union[Unset, List['AgentDeployment']]):
|
30
|
+
"""
|
31
|
+
|
32
|
+
created_at: Union[Unset, str] = UNSET
|
33
|
+
created_by: Union[Unset, str] = UNSET
|
34
|
+
updated_at: Union[Unset, str] = UNSET
|
35
|
+
updated_by: Union[Unset, str] = UNSET
|
36
|
+
display_name: Union[Unset, str] = UNSET
|
37
|
+
labels: Union["LabelsType0", None, Unset] = UNSET
|
38
|
+
name: Union[Unset, str] = UNSET
|
39
|
+
workspace: Union[Unset, str] = UNSET
|
40
|
+
deployments: Union[Unset, List["AgentDeployment"]] = UNSET
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
+
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
44
|
+
from ..models.labels_type_0 import LabelsType0
|
45
|
+
|
46
|
+
created_at = self.created_at
|
47
|
+
|
48
|
+
created_by = self.created_by
|
49
|
+
|
50
|
+
updated_at = self.updated_at
|
51
|
+
|
52
|
+
updated_by = self.updated_by
|
53
|
+
|
54
|
+
display_name = self.display_name
|
55
|
+
|
56
|
+
labels: Union[Dict[str, Any], None, Unset]
|
57
|
+
if isinstance(self.labels, Unset):
|
58
|
+
labels = UNSET
|
59
|
+
elif isinstance(self.labels, LabelsType0):
|
60
|
+
labels = self.labels.to_dict()
|
61
|
+
else:
|
62
|
+
labels = self.labels
|
63
|
+
|
64
|
+
name = self.name
|
65
|
+
|
66
|
+
workspace = self.workspace
|
67
|
+
|
68
|
+
deployments: Union[Unset, List[Dict[str, Any]]] = UNSET
|
69
|
+
if not isinstance(self.deployments, Unset):
|
70
|
+
deployments = []
|
71
|
+
for componentsschemas_agent_deployments_item_data in self.deployments:
|
72
|
+
componentsschemas_agent_deployments_item = componentsschemas_agent_deployments_item_data.to_dict()
|
73
|
+
deployments.append(componentsschemas_agent_deployments_item)
|
74
|
+
|
75
|
+
field_dict: dict[str, Any] = {}
|
76
|
+
field_dict.update(self.additional_properties)
|
77
|
+
field_dict.update({})
|
78
|
+
if created_at is not UNSET:
|
79
|
+
field_dict["created_at"] = created_at
|
80
|
+
if created_by is not UNSET:
|
81
|
+
field_dict["created_by"] = created_by
|
82
|
+
if updated_at is not UNSET:
|
83
|
+
field_dict["updated_at"] = updated_at
|
84
|
+
if updated_by is not UNSET:
|
85
|
+
field_dict["updated_by"] = updated_by
|
86
|
+
if display_name is not UNSET:
|
87
|
+
field_dict["display_name"] = display_name
|
88
|
+
if labels is not UNSET:
|
89
|
+
field_dict["labels"] = labels
|
90
|
+
if name is not UNSET:
|
91
|
+
field_dict["name"] = name
|
92
|
+
if workspace is not UNSET:
|
93
|
+
field_dict["workspace"] = workspace
|
94
|
+
if deployments is not UNSET:
|
95
|
+
field_dict["deployments"] = deployments
|
96
|
+
|
97
|
+
return field_dict
|
98
|
+
|
99
|
+
@classmethod
|
100
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
101
|
+
from ..models.agent_deployment import AgentDeployment
|
102
|
+
from ..models.labels_type_0 import LabelsType0
|
103
|
+
|
104
|
+
d = src_dict.copy()
|
105
|
+
created_at = d.pop("created_at", UNSET)
|
106
|
+
|
107
|
+
created_by = d.pop("created_by", UNSET)
|
108
|
+
|
109
|
+
updated_at = d.pop("updated_at", UNSET)
|
110
|
+
|
111
|
+
updated_by = d.pop("updated_by", UNSET)
|
112
|
+
|
113
|
+
display_name = d.pop("display_name", UNSET)
|
114
|
+
|
115
|
+
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
116
|
+
if data is None:
|
117
|
+
return data
|
118
|
+
if isinstance(data, Unset):
|
119
|
+
return data
|
120
|
+
try:
|
121
|
+
if not isinstance(data, dict):
|
122
|
+
raise TypeError()
|
123
|
+
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
124
|
+
|
125
|
+
return componentsschemas_labels_type_0
|
126
|
+
except: # noqa: E722
|
127
|
+
pass
|
128
|
+
return cast(Union["LabelsType0", None, Unset], data)
|
129
|
+
|
130
|
+
labels = _parse_labels(d.pop("labels", UNSET))
|
131
|
+
|
132
|
+
name = d.pop("name", UNSET)
|
133
|
+
|
134
|
+
workspace = d.pop("workspace", UNSET)
|
135
|
+
|
136
|
+
deployments = []
|
137
|
+
_deployments = d.pop("deployments", UNSET)
|
138
|
+
for componentsschemas_agent_deployments_item_data in _deployments or []:
|
139
|
+
componentsschemas_agent_deployments_item = AgentDeployment.from_dict(
|
140
|
+
componentsschemas_agent_deployments_item_data
|
141
|
+
)
|
142
|
+
|
143
|
+
deployments.append(componentsschemas_agent_deployments_item)
|
144
|
+
|
145
|
+
agent_with_deployments = cls(
|
146
|
+
created_at=created_at,
|
147
|
+
created_by=created_by,
|
148
|
+
updated_at=updated_at,
|
149
|
+
updated_by=updated_by,
|
150
|
+
display_name=display_name,
|
151
|
+
labels=labels,
|
152
|
+
name=name,
|
153
|
+
workspace=workspace,
|
154
|
+
deployments=deployments,
|
155
|
+
)
|
156
|
+
|
157
|
+
agent_with_deployments.additional_properties = d
|
158
|
+
return agent_with_deployments
|
159
|
+
|
160
|
+
@property
|
161
|
+
def additional_keys(self) -> list[str]:
|
162
|
+
return list(self.additional_properties.keys())
|
163
|
+
|
164
|
+
def __getitem__(self, key: str) -> Any:
|
165
|
+
return self.additional_properties[key]
|
166
|
+
|
167
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
168
|
+
self.additional_properties[key] = value
|
169
|
+
|
170
|
+
def __delitem__(self, key: str) -> None:
|
171
|
+
del self.additional_properties[key]
|
172
|
+
|
173
|
+
def __contains__(self, key: str) -> bool:
|
174
|
+
return key in self.additional_properties
|
@@ -1,8 +1,12 @@
|
|
1
|
-
from typing import Any, Type, TypeVar
|
1
|
+
from typing import TYPE_CHECKING, Any, Type, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
+
if TYPE_CHECKING:
|
7
|
+
from ..models.deployment_configuration import DeploymentConfiguration
|
8
|
+
|
9
|
+
|
6
10
|
T = TypeVar("T", bound="DeploymentConfigurations")
|
7
11
|
|
8
12
|
|
@@ -10,30 +14,39 @@ T = TypeVar("T", bound="DeploymentConfigurations")
|
|
10
14
|
class DeploymentConfigurations:
|
11
15
|
"""Deployment configurations key value and also a boolean secret to specify if it should be stored in secret manager"""
|
12
16
|
|
13
|
-
additional_properties: dict[str,
|
17
|
+
additional_properties: dict[str, "DeploymentConfiguration"] = _attrs_field(init=False, factory=dict)
|
14
18
|
|
15
19
|
def to_dict(self) -> dict[str, Any]:
|
16
20
|
field_dict: dict[str, Any] = {}
|
17
|
-
|
21
|
+
for prop_name, prop in self.additional_properties.items():
|
22
|
+
field_dict[prop_name] = prop.to_dict()
|
18
23
|
|
19
24
|
return field_dict
|
20
25
|
|
21
26
|
@classmethod
|
22
27
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
28
|
+
from ..models.deployment_configuration import DeploymentConfiguration
|
29
|
+
|
23
30
|
d = src_dict.copy()
|
24
31
|
deployment_configurations = cls()
|
25
32
|
|
26
|
-
|
33
|
+
additional_properties = {}
|
34
|
+
for prop_name, prop_dict in d.items():
|
35
|
+
additional_property = DeploymentConfiguration.from_dict(prop_dict)
|
36
|
+
|
37
|
+
additional_properties[prop_name] = additional_property
|
38
|
+
|
39
|
+
deployment_configurations.additional_properties = additional_properties
|
27
40
|
return deployment_configurations
|
28
41
|
|
29
42
|
@property
|
30
43
|
def additional_keys(self) -> list[str]:
|
31
44
|
return list(self.additional_properties.keys())
|
32
45
|
|
33
|
-
def __getitem__(self, key: str) ->
|
46
|
+
def __getitem__(self, key: str) -> "DeploymentConfiguration":
|
34
47
|
return self.additional_properties[key]
|
35
48
|
|
36
|
-
def __setitem__(self, key: str, value:
|
49
|
+
def __setitem__(self, key: str, value: "DeploymentConfiguration") -> None:
|
37
50
|
self.additional_properties[key] = value
|
38
51
|
|
39
52
|
def __delitem__(self, key: str) -> None:
|
@@ -0,0 +1,218 @@
|
|
1
|
+
from typing import Any, 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="DeploymentServerlessConfigType0")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class DeploymentServerlessConfigType0:
|
13
|
+
"""Configuration for a serverless deployment
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
last_pod_retention_period (Union[None, Unset, str]): The minimum amount of time that the last replica will
|
17
|
+
remain active AFTER a scale-to-zero decision is made
|
18
|
+
max_num_replicas (Union[None, Unset, int]): The maximum number of replicas for the deployment.
|
19
|
+
metric (Union[None, Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
|
20
|
+
"concurrency"
|
21
|
+
min_num_replicas (Union[None, Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in
|
22
|
+
which case the deployment is always running in at least one location).
|
23
|
+
scale_down_delay (Union[None, Unset, str]): The time window which must pass at reduced concurrency before a
|
24
|
+
scale-down decision is applied. This can be useful, for example, to keep containers around for a configurable
|
25
|
+
duration to avoid a cold start penalty if new requests come in.
|
26
|
+
scale_up_minimum (Union[None, Unset, int]): The minimum number of replicas that will be created when the
|
27
|
+
deployment scales up from zero.
|
28
|
+
stable_window (Union[None, Unset, str]): The sliding time window over which metrics are averaged to provide the
|
29
|
+
input for scaling decisions
|
30
|
+
target (Union[None, Unset, str]): Target value for the watched metric
|
31
|
+
"""
|
32
|
+
|
33
|
+
last_pod_retention_period: Union[None, Unset, str] = UNSET
|
34
|
+
max_num_replicas: Union[None, Unset, int] = UNSET
|
35
|
+
metric: Union[None, Unset, str] = UNSET
|
36
|
+
min_num_replicas: Union[None, Unset, int] = UNSET
|
37
|
+
scale_down_delay: Union[None, Unset, str] = UNSET
|
38
|
+
scale_up_minimum: Union[None, Unset, int] = UNSET
|
39
|
+
stable_window: Union[None, Unset, str] = UNSET
|
40
|
+
target: Union[None, Unset, str] = UNSET
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
+
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
44
|
+
last_pod_retention_period: Union[None, Unset, str]
|
45
|
+
if isinstance(self.last_pod_retention_period, Unset):
|
46
|
+
last_pod_retention_period = UNSET
|
47
|
+
else:
|
48
|
+
last_pod_retention_period = self.last_pod_retention_period
|
49
|
+
|
50
|
+
max_num_replicas: Union[None, Unset, int]
|
51
|
+
if isinstance(self.max_num_replicas, Unset):
|
52
|
+
max_num_replicas = UNSET
|
53
|
+
else:
|
54
|
+
max_num_replicas = self.max_num_replicas
|
55
|
+
|
56
|
+
metric: Union[None, Unset, str]
|
57
|
+
if isinstance(self.metric, Unset):
|
58
|
+
metric = UNSET
|
59
|
+
else:
|
60
|
+
metric = self.metric
|
61
|
+
|
62
|
+
min_num_replicas: Union[None, Unset, int]
|
63
|
+
if isinstance(self.min_num_replicas, Unset):
|
64
|
+
min_num_replicas = UNSET
|
65
|
+
else:
|
66
|
+
min_num_replicas = self.min_num_replicas
|
67
|
+
|
68
|
+
scale_down_delay: Union[None, Unset, str]
|
69
|
+
if isinstance(self.scale_down_delay, Unset):
|
70
|
+
scale_down_delay = UNSET
|
71
|
+
else:
|
72
|
+
scale_down_delay = self.scale_down_delay
|
73
|
+
|
74
|
+
scale_up_minimum: Union[None, Unset, int]
|
75
|
+
if isinstance(self.scale_up_minimum, Unset):
|
76
|
+
scale_up_minimum = UNSET
|
77
|
+
else:
|
78
|
+
scale_up_minimum = self.scale_up_minimum
|
79
|
+
|
80
|
+
stable_window: Union[None, Unset, str]
|
81
|
+
if isinstance(self.stable_window, Unset):
|
82
|
+
stable_window = UNSET
|
83
|
+
else:
|
84
|
+
stable_window = self.stable_window
|
85
|
+
|
86
|
+
target: Union[None, Unset, str]
|
87
|
+
if isinstance(self.target, Unset):
|
88
|
+
target = UNSET
|
89
|
+
else:
|
90
|
+
target = self.target
|
91
|
+
|
92
|
+
field_dict: dict[str, Any] = {}
|
93
|
+
field_dict.update(self.additional_properties)
|
94
|
+
field_dict.update({})
|
95
|
+
if last_pod_retention_period is not UNSET:
|
96
|
+
field_dict["last_pod_retention_period"] = last_pod_retention_period
|
97
|
+
if max_num_replicas is not UNSET:
|
98
|
+
field_dict["max_num_replicas"] = max_num_replicas
|
99
|
+
if metric is not UNSET:
|
100
|
+
field_dict["metric"] = metric
|
101
|
+
if min_num_replicas is not UNSET:
|
102
|
+
field_dict["min_num_replicas"] = min_num_replicas
|
103
|
+
if scale_down_delay is not UNSET:
|
104
|
+
field_dict["scale_down_delay"] = scale_down_delay
|
105
|
+
if scale_up_minimum is not UNSET:
|
106
|
+
field_dict["scale_up_minimum"] = scale_up_minimum
|
107
|
+
if stable_window is not UNSET:
|
108
|
+
field_dict["stable_window"] = stable_window
|
109
|
+
if target is not UNSET:
|
110
|
+
field_dict["target"] = target
|
111
|
+
|
112
|
+
return field_dict
|
113
|
+
|
114
|
+
@classmethod
|
115
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
116
|
+
d = src_dict.copy()
|
117
|
+
|
118
|
+
def _parse_last_pod_retention_period(data: object) -> Union[None, Unset, str]:
|
119
|
+
if data is None:
|
120
|
+
return data
|
121
|
+
if isinstance(data, Unset):
|
122
|
+
return data
|
123
|
+
return cast(Union[None, Unset, str], data)
|
124
|
+
|
125
|
+
last_pod_retention_period = _parse_last_pod_retention_period(d.pop("last_pod_retention_period", UNSET))
|
126
|
+
|
127
|
+
def _parse_max_num_replicas(data: object) -> Union[None, Unset, int]:
|
128
|
+
if data is None:
|
129
|
+
return data
|
130
|
+
if isinstance(data, Unset):
|
131
|
+
return data
|
132
|
+
return cast(Union[None, Unset, int], data)
|
133
|
+
|
134
|
+
max_num_replicas = _parse_max_num_replicas(d.pop("max_num_replicas", UNSET))
|
135
|
+
|
136
|
+
def _parse_metric(data: object) -> Union[None, Unset, str]:
|
137
|
+
if data is None:
|
138
|
+
return data
|
139
|
+
if isinstance(data, Unset):
|
140
|
+
return data
|
141
|
+
return cast(Union[None, Unset, str], data)
|
142
|
+
|
143
|
+
metric = _parse_metric(d.pop("metric", UNSET))
|
144
|
+
|
145
|
+
def _parse_min_num_replicas(data: object) -> Union[None, Unset, int]:
|
146
|
+
if data is None:
|
147
|
+
return data
|
148
|
+
if isinstance(data, Unset):
|
149
|
+
return data
|
150
|
+
return cast(Union[None, Unset, int], data)
|
151
|
+
|
152
|
+
min_num_replicas = _parse_min_num_replicas(d.pop("min_num_replicas", UNSET))
|
153
|
+
|
154
|
+
def _parse_scale_down_delay(data: object) -> Union[None, Unset, str]:
|
155
|
+
if data is None:
|
156
|
+
return data
|
157
|
+
if isinstance(data, Unset):
|
158
|
+
return data
|
159
|
+
return cast(Union[None, Unset, str], data)
|
160
|
+
|
161
|
+
scale_down_delay = _parse_scale_down_delay(d.pop("scale_down_delay", UNSET))
|
162
|
+
|
163
|
+
def _parse_scale_up_minimum(data: object) -> Union[None, Unset, int]:
|
164
|
+
if data is None:
|
165
|
+
return data
|
166
|
+
if isinstance(data, Unset):
|
167
|
+
return data
|
168
|
+
return cast(Union[None, Unset, int], data)
|
169
|
+
|
170
|
+
scale_up_minimum = _parse_scale_up_minimum(d.pop("scale_up_minimum", UNSET))
|
171
|
+
|
172
|
+
def _parse_stable_window(data: object) -> Union[None, Unset, str]:
|
173
|
+
if data is None:
|
174
|
+
return data
|
175
|
+
if isinstance(data, Unset):
|
176
|
+
return data
|
177
|
+
return cast(Union[None, Unset, str], data)
|
178
|
+
|
179
|
+
stable_window = _parse_stable_window(d.pop("stable_window", UNSET))
|
180
|
+
|
181
|
+
def _parse_target(data: object) -> Union[None, Unset, str]:
|
182
|
+
if data is None:
|
183
|
+
return data
|
184
|
+
if isinstance(data, Unset):
|
185
|
+
return data
|
186
|
+
return cast(Union[None, Unset, str], data)
|
187
|
+
|
188
|
+
target = _parse_target(d.pop("target", UNSET))
|
189
|
+
|
190
|
+
deployment_serverless_config_type_0 = cls(
|
191
|
+
last_pod_retention_period=last_pod_retention_period,
|
192
|
+
max_num_replicas=max_num_replicas,
|
193
|
+
metric=metric,
|
194
|
+
min_num_replicas=min_num_replicas,
|
195
|
+
scale_down_delay=scale_down_delay,
|
196
|
+
scale_up_minimum=scale_up_minimum,
|
197
|
+
stable_window=stable_window,
|
198
|
+
target=target,
|
199
|
+
)
|
200
|
+
|
201
|
+
deployment_serverless_config_type_0.additional_properties = d
|
202
|
+
return deployment_serverless_config_type_0
|
203
|
+
|
204
|
+
@property
|
205
|
+
def additional_keys(self) -> list[str]:
|
206
|
+
return list(self.additional_properties.keys())
|
207
|
+
|
208
|
+
def __getitem__(self, key: str) -> Any:
|
209
|
+
return self.additional_properties[key]
|
210
|
+
|
211
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
212
|
+
self.additional_properties[key] = value
|
213
|
+
|
214
|
+
def __delitem__(self, key: str) -> None:
|
215
|
+
del self.additional_properties[key]
|
216
|
+
|
217
|
+
def __contains__(self, key: str) -> bool:
|
218
|
+
return key in self.additional_properties
|
@@ -17,13 +17,22 @@ class EnvironmentMetrics:
|
|
17
17
|
"""Metrics for the environment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
+
inference_global (Union[Unset, List['Metric']]): Array of metrics
|
20
21
|
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
21
22
|
"""
|
22
23
|
|
24
|
+
inference_global: Union[Unset, List["Metric"]] = UNSET
|
23
25
|
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
24
26
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
27
|
|
26
28
|
def to_dict(self) -> dict[str, Any]:
|
29
|
+
inference_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
30
|
+
if not isinstance(self.inference_global, Unset):
|
31
|
+
inference_global = []
|
32
|
+
for componentsschemas_array_metric_item_data in self.inference_global:
|
33
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
34
|
+
inference_global.append(componentsschemas_array_metric_item)
|
35
|
+
|
27
36
|
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
28
37
|
if not isinstance(self.inference_per_second_global, Unset):
|
29
38
|
inference_per_second_global = []
|
@@ -34,6 +43,8 @@ class EnvironmentMetrics:
|
|
34
43
|
field_dict: dict[str, Any] = {}
|
35
44
|
field_dict.update(self.additional_properties)
|
36
45
|
field_dict.update({})
|
46
|
+
if inference_global is not UNSET:
|
47
|
+
field_dict["inference_global"] = inference_global
|
37
48
|
if inference_per_second_global is not UNSET:
|
38
49
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
39
50
|
|
@@ -44,6 +55,13 @@ class EnvironmentMetrics:
|
|
44
55
|
from ..models.metric import Metric
|
45
56
|
|
46
57
|
d = src_dict.copy()
|
58
|
+
inference_global = []
|
59
|
+
_inference_global = d.pop("inference_global", UNSET)
|
60
|
+
for componentsschemas_array_metric_item_data in _inference_global or []:
|
61
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
62
|
+
|
63
|
+
inference_global.append(componentsschemas_array_metric_item)
|
64
|
+
|
47
65
|
inference_per_second_global = []
|
48
66
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
49
67
|
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
@@ -52,6 +70,7 @@ class EnvironmentMetrics:
|
|
52
70
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
53
71
|
|
54
72
|
environment_metrics = cls(
|
73
|
+
inference_global=inference_global,
|
55
74
|
inference_per_second_global=inference_per_second_global,
|
56
75
|
)
|
57
76
|
|