beamlit 0.0.19__py3-none-any.whl → 0.0.20rc1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. beamlit/api/agents/create_agent.py +14 -9
  2. beamlit/api/agents/get_agent_deployment.py +22 -1
  3. beamlit/api/agents/update_agent.py +14 -9
  4. beamlit/api/functions/create_function.py +14 -9
  5. beamlit/api/functions/update_function.py +14 -9
  6. beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → integrations/create_integration_connection.py} +45 -41
  7. beamlit/api/integrations/delete_integration_connection.py +158 -0
  8. beamlit/api/integrations/get_integration.py +97 -0
  9. beamlit/api/integrations/get_integration_connection.py +154 -0
  10. beamlit/api/integrations/get_integration_connection_model.py +97 -0
  11. beamlit/api/integrations/get_integration_model.py +97 -0
  12. beamlit/api/integrations/list_integration_connection_models.py +97 -0
  13. beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → integrations/list_integration_connections.py} +24 -48
  14. beamlit/api/integrations/list_integration_models.py +97 -0
  15. beamlit/api/integrations/update_integration_connection.py +180 -0
  16. beamlit/authentication/__init__.py +2 -1
  17. beamlit/authentication/authentication.py +3 -0
  18. beamlit/authentication/clientcredentials.py +99 -0
  19. beamlit/authentication/credentials.py +7 -1
  20. beamlit/authentication/device_mode.py +0 -2
  21. beamlit/common/generate.py +166 -0
  22. beamlit/common/logger.py +30 -0
  23. beamlit/common/settings.py +112 -0
  24. beamlit/common/utils.py +13 -0
  25. beamlit/models/__init__.py +50 -24
  26. beamlit/models/agent_deployment.py +117 -49
  27. beamlit/models/{agent_deployment_configuration.py → agent_deployment_configuration_type_0.py} +5 -5
  28. beamlit/models/agent_deployment_history.py +46 -13
  29. beamlit/models/agent_deployment_history_event.py +78 -22
  30. beamlit/models/{function_deployment_pod_template.py → agent_deployment_pod_template_type_0.py} +5 -5
  31. beamlit/models/agent_with_deployments.py +174 -0
  32. beamlit/models/deployment_configurations.py +19 -6
  33. beamlit/models/deployment_serverless_config_type_0.py +218 -0
  34. beamlit/models/environment_metrics.py +19 -0
  35. beamlit/models/function_deployment.py +110 -42
  36. beamlit/models/{function_deployment_configuration.py → function_deployment_configuration_type_0.py} +5 -5
  37. beamlit/models/{agent_deployment_pod_template.py → function_deployment_pod_template_type_0.py} +5 -5
  38. beamlit/models/function_with_deployments.py +174 -0
  39. beamlit/models/increase_and_rate_metric.py +102 -0
  40. beamlit/models/integration.py +196 -0
  41. beamlit/models/integration_config.py +43 -0
  42. beamlit/models/integration_connection.py +196 -0
  43. beamlit/models/integration_connection_config.py +43 -0
  44. beamlit/models/integration_connection_secret.py +59 -0
  45. beamlit/models/integration_model.py +142 -0
  46. beamlit/models/integration_secret.py +59 -0
  47. beamlit/models/metrics.py +61 -20
  48. beamlit/models/model_deployment.py +96 -64
  49. beamlit/models/{model_deployment_pod_template.py → model_deployment_pod_template_type_0.py} +5 -5
  50. beamlit/models/policy.py +8 -34
  51. beamlit/models/provider_config.py +0 -9
  52. beamlit/models/resource_deployment_metrics.py +231 -36
  53. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +75 -0
  54. beamlit/models/{resource_deployment_metrics_inference_per_second_per_region.py → resource_deployment_metrics_inference_per_second_per_region_type_0.py} +5 -5
  55. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
  56. 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
  57. beamlit/models/resource_metrics.py +36 -0
  58. beamlit/models/runtime.py +29 -12
  59. beamlit/models/{runtime_readiness_probe.py → runtime_readiness_probe_type_0.py} +5 -5
  60. beamlit/models/store_agent.py +29 -13
  61. beamlit/models/{store_agent_labels.py → store_agent_labels_type_0.py} +5 -5
  62. beamlit/models/store_configuration.py +15 -4
  63. beamlit/models/store_configuration_option.py +18 -5
  64. beamlit/models/store_function.py +29 -13
  65. beamlit/models/{store_function_labels.py → store_function_labels_type_0.py} +5 -5
  66. beamlit/run.py +49 -0
  67. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/METADATA +5 -2
  68. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/RECORD +70 -46
  69. beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +0 -184
  70. beamlit/models/deployment_serverless_config.py +0 -129
  71. beamlit/models/labels.py +0 -43
  72. /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
  73. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc1.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -8,11 +8,17 @@ from ..types import UNSET, Unset
8
8
  if TYPE_CHECKING:
9
9
  from ..models.metric import Metric
10
10
  from ..models.qps import QPS
11
- from ..models.resource_deployment_metrics_inference_per_second_per_region import (
12
- ResourceDeploymentMetricsInferencePerSecondPerRegion,
11
+ from ..models.resource_deployment_metrics_inference_per_region_type_0 import (
12
+ ResourceDeploymentMetricsInferencePerRegionType0,
13
13
  )
14
- from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
15
- ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
14
+ from ..models.resource_deployment_metrics_inference_per_second_per_region_type_0 import (
15
+ ResourceDeploymentMetricsInferencePerSecondPerRegionType0,
16
+ )
17
+ from ..models.resource_deployment_metrics_query_per_region_per_code_type_0 import (
18
+ ResourceDeploymentMetricsQueryPerRegionPerCodeType0,
19
+ )
20
+ from ..models.resource_deployment_metrics_query_per_second_per_region_per_code_type_0 import (
21
+ ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0,
16
22
  )
17
23
 
18
24
 
@@ -24,29 +30,75 @@ class ResourceDeploymentMetrics:
24
30
  """Metrics for a single resource deployment (eg. model deployment, function deployment)
25
31
 
26
32
  Attributes:
33
+ inference_global (Union[Unset, List['Metric']]): Array of metrics
34
+ inference_per_region (Union['ResourceDeploymentMetricsInferencePerRegionType0', None, Unset]): Historical
35
+ requests (in last 24 hours) per location, for the model deployment
27
36
  inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
28
- inference_per_second_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]): Historical
29
- requests per second (RPS) per location, for the model deployment
37
+ inference_per_second_per_region (Union['ResourceDeploymentMetricsInferencePerSecondPerRegionType0', None,
38
+ Unset]): Historical requests per second (RPS) per location, for the model deployment
39
+ query_global (Union[Unset, float]): Number of requests done on the resource for the model deployment
40
+ query_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g.
41
+ 200, 400) or per location
42
+ query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
43
+ 400) or per location
44
+ query_per_region_per_code (Union['ResourceDeploymentMetricsQueryPerRegionPerCodeType0', None, Unset]): Number of
45
+ requests done on the resource for the model deployment
30
46
  query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
31
47
  query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
32
48
  code (e.g. 200, 400) or per location
33
49
  query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
34
50
  (e.g. 200, 400) or per location
35
- query_per_second_per_region_per_code (Union[Unset, ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode]):
36
- RPS value (in last 24 hours) per response status code per location, for the model deployment
51
+ query_per_second_per_region_per_code (Union['ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0',
52
+ None, Unset]): RPS value (in last 24 hours) per response status code per location, for the model deployment
37
53
  """
38
54
 
55
+ inference_global: Union[Unset, List["Metric"]] = UNSET
56
+ inference_per_region: Union["ResourceDeploymentMetricsInferencePerRegionType0", None, Unset] = UNSET
39
57
  inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
40
- inference_per_second_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
58
+ inference_per_second_per_region: Union["ResourceDeploymentMetricsInferencePerSecondPerRegionType0", None, Unset] = (
59
+ UNSET
60
+ )
61
+ query_global: Union[Unset, float] = UNSET
62
+ query_per_code_global: Union[Unset, "QPS"] = UNSET
63
+ query_per_region: Union[Unset, "QPS"] = UNSET
64
+ query_per_region_per_code: Union["ResourceDeploymentMetricsQueryPerRegionPerCodeType0", None, Unset] = UNSET
41
65
  query_per_second_global: Union[Unset, float] = UNSET
42
66
  query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
43
67
  query_per_second_per_region: Union[Unset, "QPS"] = UNSET
44
- query_per_second_per_region_per_code: Union[Unset, "ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode"] = (
45
- UNSET
46
- )
68
+ query_per_second_per_region_per_code: Union[
69
+ "ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0", None, Unset
70
+ ] = UNSET
47
71
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
48
72
 
49
73
  def to_dict(self) -> dict[str, Any]:
74
+ from ..models.resource_deployment_metrics_inference_per_region_type_0 import (
75
+ ResourceDeploymentMetricsInferencePerRegionType0,
76
+ )
77
+ from ..models.resource_deployment_metrics_inference_per_second_per_region_type_0 import (
78
+ ResourceDeploymentMetricsInferencePerSecondPerRegionType0,
79
+ )
80
+ from ..models.resource_deployment_metrics_query_per_region_per_code_type_0 import (
81
+ ResourceDeploymentMetricsQueryPerRegionPerCodeType0,
82
+ )
83
+ from ..models.resource_deployment_metrics_query_per_second_per_region_per_code_type_0 import (
84
+ ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0,
85
+ )
86
+
87
+ inference_global: Union[Unset, List[Dict[str, Any]]] = UNSET
88
+ if not isinstance(self.inference_global, Unset):
89
+ inference_global = []
90
+ for componentsschemas_array_metric_item_data in self.inference_global:
91
+ componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
92
+ inference_global.append(componentsschemas_array_metric_item)
93
+
94
+ inference_per_region: Union[Dict[str, Any], None, Unset]
95
+ if isinstance(self.inference_per_region, Unset):
96
+ inference_per_region = UNSET
97
+ elif isinstance(self.inference_per_region, ResourceDeploymentMetricsInferencePerRegionType0):
98
+ inference_per_region = self.inference_per_region.to_dict()
99
+ else:
100
+ inference_per_region = self.inference_per_region
101
+
50
102
  inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
51
103
  if not isinstance(self.inference_per_second_global, Unset):
52
104
  inference_per_second_global = []
@@ -54,9 +106,33 @@ class ResourceDeploymentMetrics:
54
106
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
55
107
  inference_per_second_global.append(componentsschemas_array_metric_item)
56
108
 
57
- inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
58
- if not isinstance(self.inference_per_second_per_region, Unset):
109
+ inference_per_second_per_region: Union[Dict[str, Any], None, Unset]
110
+ if isinstance(self.inference_per_second_per_region, Unset):
111
+ inference_per_second_per_region = UNSET
112
+ elif isinstance(
113
+ self.inference_per_second_per_region, ResourceDeploymentMetricsInferencePerSecondPerRegionType0
114
+ ):
59
115
  inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
116
+ else:
117
+ inference_per_second_per_region = self.inference_per_second_per_region
118
+
119
+ query_global = self.query_global
120
+
121
+ query_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
122
+ if not isinstance(self.query_per_code_global, Unset):
123
+ query_per_code_global = self.query_per_code_global.to_dict()
124
+
125
+ query_per_region: Union[Unset, Dict[str, Any]] = UNSET
126
+ if not isinstance(self.query_per_region, Unset):
127
+ query_per_region = self.query_per_region.to_dict()
128
+
129
+ query_per_region_per_code: Union[Dict[str, Any], None, Unset]
130
+ if isinstance(self.query_per_region_per_code, Unset):
131
+ query_per_region_per_code = UNSET
132
+ elif isinstance(self.query_per_region_per_code, ResourceDeploymentMetricsQueryPerRegionPerCodeType0):
133
+ query_per_region_per_code = self.query_per_region_per_code.to_dict()
134
+ else:
135
+ query_per_region_per_code = self.query_per_region_per_code
60
136
 
61
137
  query_per_second_global = self.query_per_second_global
62
138
 
@@ -68,17 +144,35 @@ class ResourceDeploymentMetrics:
68
144
  if not isinstance(self.query_per_second_per_region, Unset):
69
145
  query_per_second_per_region = self.query_per_second_per_region.to_dict()
70
146
 
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):
147
+ query_per_second_per_region_per_code: Union[Dict[str, Any], None, Unset]
148
+ if isinstance(self.query_per_second_per_region_per_code, Unset):
149
+ query_per_second_per_region_per_code = UNSET
150
+ elif isinstance(
151
+ self.query_per_second_per_region_per_code, ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0
152
+ ):
73
153
  query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
154
+ else:
155
+ query_per_second_per_region_per_code = self.query_per_second_per_region_per_code
74
156
 
75
157
  field_dict: dict[str, Any] = {}
76
158
  field_dict.update(self.additional_properties)
77
159
  field_dict.update({})
160
+ if inference_global is not UNSET:
161
+ field_dict["inference_global"] = inference_global
162
+ if inference_per_region is not UNSET:
163
+ field_dict["inference_per_region"] = inference_per_region
78
164
  if inference_per_second_global is not UNSET:
79
165
  field_dict["inference_per_second_global"] = inference_per_second_global
80
166
  if inference_per_second_per_region is not UNSET:
81
167
  field_dict["inference_per_second_per_region"] = inference_per_second_per_region
168
+ if query_global is not UNSET:
169
+ field_dict["query_global"] = query_global
170
+ if query_per_code_global is not UNSET:
171
+ field_dict["query_per_code_global"] = query_per_code_global
172
+ if query_per_region is not UNSET:
173
+ field_dict["query_per_region"] = query_per_region
174
+ if query_per_region_per_code is not UNSET:
175
+ field_dict["query_per_region_per_code"] = query_per_region_per_code
82
176
  if query_per_second_global is not UNSET:
83
177
  field_dict["query_per_second_global"] = query_per_second_global
84
178
  if query_per_second_per_code_global is not UNSET:
@@ -94,14 +188,46 @@ class ResourceDeploymentMetrics:
94
188
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
95
189
  from ..models.metric import Metric
96
190
  from ..models.qps import QPS
97
- from ..models.resource_deployment_metrics_inference_per_second_per_region import (
98
- ResourceDeploymentMetricsInferencePerSecondPerRegion,
191
+ from ..models.resource_deployment_metrics_inference_per_region_type_0 import (
192
+ ResourceDeploymentMetricsInferencePerRegionType0,
193
+ )
194
+ from ..models.resource_deployment_metrics_inference_per_second_per_region_type_0 import (
195
+ ResourceDeploymentMetricsInferencePerSecondPerRegionType0,
196
+ )
197
+ from ..models.resource_deployment_metrics_query_per_region_per_code_type_0 import (
198
+ ResourceDeploymentMetricsQueryPerRegionPerCodeType0,
99
199
  )
100
- from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
101
- ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
200
+ from ..models.resource_deployment_metrics_query_per_second_per_region_per_code_type_0 import (
201
+ ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0,
102
202
  )
103
203
 
104
204
  d = src_dict.copy()
205
+ inference_global = []
206
+ _inference_global = d.pop("inference_global", UNSET)
207
+ for componentsschemas_array_metric_item_data in _inference_global or []:
208
+ componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
209
+
210
+ inference_global.append(componentsschemas_array_metric_item)
211
+
212
+ def _parse_inference_per_region(
213
+ data: object,
214
+ ) -> Union["ResourceDeploymentMetricsInferencePerRegionType0", None, Unset]:
215
+ if data is None:
216
+ return data
217
+ if isinstance(data, Unset):
218
+ return data
219
+ try:
220
+ if not isinstance(data, dict):
221
+ raise TypeError()
222
+ inference_per_region_type_0 = ResourceDeploymentMetricsInferencePerRegionType0.from_dict(data)
223
+
224
+ return inference_per_region_type_0
225
+ except: # noqa: E722
226
+ pass
227
+ return cast(Union["ResourceDeploymentMetricsInferencePerRegionType0", None, Unset], data)
228
+
229
+ inference_per_region = _parse_inference_per_region(d.pop("inference_per_region", UNSET))
230
+
105
231
  inference_per_second_global = []
106
232
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
107
233
  for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
@@ -109,14 +235,63 @@ class ResourceDeploymentMetrics:
109
235
 
110
236
  inference_per_second_global.append(componentsschemas_array_metric_item)
111
237
 
112
- _inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
113
- inference_per_second_per_region: Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]
114
- if isinstance(_inference_per_second_per_region, Unset):
115
- inference_per_second_per_region = UNSET
238
+ def _parse_inference_per_second_per_region(
239
+ data: object,
240
+ ) -> Union["ResourceDeploymentMetricsInferencePerSecondPerRegionType0", None, Unset]:
241
+ if data is None:
242
+ return data
243
+ if isinstance(data, Unset):
244
+ return data
245
+ try:
246
+ if not isinstance(data, dict):
247
+ raise TypeError()
248
+ inference_per_second_per_region_type_0 = (
249
+ ResourceDeploymentMetricsInferencePerSecondPerRegionType0.from_dict(data)
250
+ )
251
+
252
+ return inference_per_second_per_region_type_0
253
+ except: # noqa: E722
254
+ pass
255
+ return cast(Union["ResourceDeploymentMetricsInferencePerSecondPerRegionType0", None, Unset], data)
256
+
257
+ inference_per_second_per_region = _parse_inference_per_second_per_region(
258
+ d.pop("inference_per_second_per_region", UNSET)
259
+ )
260
+
261
+ query_global = d.pop("query_global", UNSET)
262
+
263
+ _query_per_code_global = d.pop("query_per_code_global", UNSET)
264
+ query_per_code_global: Union[Unset, QPS]
265
+ if isinstance(_query_per_code_global, Unset):
266
+ query_per_code_global = UNSET
116
267
  else:
117
- inference_per_second_per_region = ResourceDeploymentMetricsInferencePerSecondPerRegion.from_dict(
118
- _inference_per_second_per_region
119
- )
268
+ query_per_code_global = QPS.from_dict(_query_per_code_global)
269
+
270
+ _query_per_region = d.pop("query_per_region", UNSET)
271
+ query_per_region: Union[Unset, QPS]
272
+ if isinstance(_query_per_region, Unset):
273
+ query_per_region = UNSET
274
+ else:
275
+ query_per_region = QPS.from_dict(_query_per_region)
276
+
277
+ def _parse_query_per_region_per_code(
278
+ data: object,
279
+ ) -> Union["ResourceDeploymentMetricsQueryPerRegionPerCodeType0", None, Unset]:
280
+ if data is None:
281
+ return data
282
+ if isinstance(data, Unset):
283
+ return data
284
+ try:
285
+ if not isinstance(data, dict):
286
+ raise TypeError()
287
+ query_per_region_per_code_type_0 = ResourceDeploymentMetricsQueryPerRegionPerCodeType0.from_dict(data)
288
+
289
+ return query_per_region_per_code_type_0
290
+ except: # noqa: E722
291
+ pass
292
+ return cast(Union["ResourceDeploymentMetricsQueryPerRegionPerCodeType0", None, Unset], data)
293
+
294
+ query_per_region_per_code = _parse_query_per_region_per_code(d.pop("query_per_region_per_code", UNSET))
120
295
 
121
296
  query_per_second_global = d.pop("query_per_second_global", UNSET)
122
297
 
@@ -134,18 +309,38 @@ class ResourceDeploymentMetrics:
134
309
  else:
135
310
  query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
136
311
 
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, ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode]
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 = ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode.from_dict(
143
- _query_per_second_per_region_per_code
144
- )
312
+ def _parse_query_per_second_per_region_per_code(
313
+ data: object,
314
+ ) -> Union["ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0", None, Unset]:
315
+ if data is None:
316
+ return data
317
+ if isinstance(data, Unset):
318
+ return data
319
+ try:
320
+ if not isinstance(data, dict):
321
+ raise TypeError()
322
+ query_per_second_per_region_per_code_type_0 = (
323
+ ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0.from_dict(data)
324
+ )
325
+
326
+ return query_per_second_per_region_per_code_type_0
327
+ except: # noqa: E722
328
+ pass
329
+ return cast(Union["ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0", None, Unset], data)
330
+
331
+ query_per_second_per_region_per_code = _parse_query_per_second_per_region_per_code(
332
+ d.pop("query_per_second_per_region_per_code", UNSET)
333
+ )
145
334
 
146
335
  resource_deployment_metrics = cls(
336
+ inference_global=inference_global,
337
+ inference_per_region=inference_per_region,
147
338
  inference_per_second_global=inference_per_second_global,
148
339
  inference_per_second_per_region=inference_per_second_per_region,
340
+ query_global=query_global,
341
+ query_per_code_global=query_per_code_global,
342
+ query_per_region=query_per_region,
343
+ query_per_region_per_code=query_per_region_per_code,
149
344
  query_per_second_global=query_per_second_global,
150
345
  query_per_second_per_code_global=query_per_second_per_code_global,
151
346
  query_per_second_per_region=query_per_second_per_region,
@@ -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="ResourceDeploymentMetricsInferencePerRegionType0")
13
+
14
+
15
+ @_attrs_define
16
+ class ResourceDeploymentMetricsInferencePerRegionType0:
17
+ """Historical requests (in last 24 hours) 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_deployment_metrics_inference_per_region_type_0 = cls(
55
+ region=region,
56
+ )
57
+
58
+ resource_deployment_metrics_inference_per_region_type_0.additional_properties = d
59
+ return resource_deployment_metrics_inference_per_region_type_0
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
@@ -9,11 +9,11 @@ if TYPE_CHECKING:
9
9
  from ..models.metric import Metric
10
10
 
11
11
 
12
- T = TypeVar("T", bound="ResourceDeploymentMetricsInferencePerSecondPerRegion")
12
+ T = TypeVar("T", bound="ResourceDeploymentMetricsInferencePerSecondPerRegionType0")
13
13
 
14
14
 
15
15
  @_attrs_define
16
- class ResourceDeploymentMetricsInferencePerSecondPerRegion:
16
+ class ResourceDeploymentMetricsInferencePerSecondPerRegionType0:
17
17
  """Historical requests per second (RPS) per location, for the model deployment
18
18
 
19
19
  Attributes:
@@ -51,12 +51,12 @@ class ResourceDeploymentMetricsInferencePerSecondPerRegion:
51
51
 
52
52
  region.append(componentsschemas_array_metric_item)
53
53
 
54
- resource_deployment_metrics_inference_per_second_per_region = cls(
54
+ resource_deployment_metrics_inference_per_second_per_region_type_0 = cls(
55
55
  region=region,
56
56
  )
57
57
 
58
- resource_deployment_metrics_inference_per_second_per_region.additional_properties = d
59
- return resource_deployment_metrics_inference_per_second_per_region
58
+ resource_deployment_metrics_inference_per_second_per_region_type_0.additional_properties = d
59
+ return resource_deployment_metrics_inference_per_second_per_region_type_0
60
60
 
61
61
  @property
62
62
  def additional_keys(self) -> list[str]:
@@ -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="ResourceDeploymentMetricsQueryPerRegionPerCodeType0")
13
+
14
+
15
+ @_attrs_define
16
+ class ResourceDeploymentMetricsQueryPerRegionPerCodeType0:
17
+ """Number of requests done on the resource 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_deployment_metrics_query_per_region_per_code_type_0 = cls(
53
+ region=region,
54
+ )
55
+
56
+ resource_deployment_metrics_query_per_region_per_code_type_0.additional_properties = d
57
+ return resource_deployment_metrics_query_per_region_per_code_type_0
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
@@ -9,11 +9,11 @@ if TYPE_CHECKING:
9
9
  from ..models.qps import QPS
10
10
 
11
11
 
12
- T = TypeVar("T", bound="ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode")
12
+ T = TypeVar("T", bound="ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0")
13
13
 
14
14
 
15
15
  @_attrs_define
16
- class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
16
+ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0:
17
17
  """RPS value (in last 24 hours) per response status code per location, for the model deployment
18
18
 
19
19
  Attributes:
@@ -49,12 +49,12 @@ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
49
49
  else:
50
50
  region = QPS.from_dict(_region)
51
51
 
52
- resource_deployment_metrics_query_per_second_per_region_per_code = cls(
52
+ resource_deployment_metrics_query_per_second_per_region_per_code_type_0 = cls(
53
53
  region=region,
54
54
  )
55
55
 
56
- resource_deployment_metrics_query_per_second_per_region_per_code.additional_properties = d
57
- return resource_deployment_metrics_query_per_second_per_region_per_code
56
+ resource_deployment_metrics_query_per_second_per_region_per_code_type_0.additional_properties = d
57
+ return resource_deployment_metrics_query_per_second_per_region_per_code_type_0
58
58
 
59
59
  @property
60
60
  def additional_keys(self) -> list[str]:
@@ -18,16 +18,28 @@ class ResourceMetrics:
18
18
  """Metrics for a single resource (eg. model, function)
19
19
 
20
20
  Attributes:
21
+ inference_global (Union[Unset, List['Metric']]): Array of metrics
21
22
  inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
23
+ query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
24
+ 400) or per location
22
25
  query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
23
26
  (e.g. 200, 400) or per location
24
27
  """
25
28
 
29
+ inference_global: Union[Unset, List["Metric"]] = UNSET
26
30
  inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
31
+ query_per_region: Union[Unset, "QPS"] = UNSET
27
32
  query_per_second_per_region: Union[Unset, "QPS"] = UNSET
28
33
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
34
 
30
35
  def to_dict(self) -> dict[str, Any]:
36
+ inference_global: Union[Unset, List[Dict[str, Any]]] = UNSET
37
+ if not isinstance(self.inference_global, Unset):
38
+ inference_global = []
39
+ for componentsschemas_array_metric_item_data in self.inference_global:
40
+ componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
41
+ inference_global.append(componentsschemas_array_metric_item)
42
+
31
43
  inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
32
44
  if not isinstance(self.inference_per_second_global, Unset):
33
45
  inference_per_second_global = []
@@ -35,6 +47,10 @@ class ResourceMetrics:
35
47
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
36
48
  inference_per_second_global.append(componentsschemas_array_metric_item)
37
49
 
50
+ query_per_region: Union[Unset, Dict[str, Any]] = UNSET
51
+ if not isinstance(self.query_per_region, Unset):
52
+ query_per_region = self.query_per_region.to_dict()
53
+
38
54
  query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
39
55
  if not isinstance(self.query_per_second_per_region, Unset):
40
56
  query_per_second_per_region = self.query_per_second_per_region.to_dict()
@@ -42,8 +58,12 @@ class ResourceMetrics:
42
58
  field_dict: dict[str, Any] = {}
43
59
  field_dict.update(self.additional_properties)
44
60
  field_dict.update({})
61
+ if inference_global is not UNSET:
62
+ field_dict["inference_global"] = inference_global
45
63
  if inference_per_second_global is not UNSET:
46
64
  field_dict["inference_per_second_global"] = inference_per_second_global
65
+ if query_per_region is not UNSET:
66
+ field_dict["query_per_region"] = query_per_region
47
67
  if query_per_second_per_region is not UNSET:
48
68
  field_dict["query_per_second_per_region"] = query_per_second_per_region
49
69
 
@@ -55,6 +75,13 @@ class ResourceMetrics:
55
75
  from ..models.qps import QPS
56
76
 
57
77
  d = src_dict.copy()
78
+ inference_global = []
79
+ _inference_global = d.pop("inference_global", UNSET)
80
+ for componentsschemas_array_metric_item_data in _inference_global or []:
81
+ componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
82
+
83
+ inference_global.append(componentsschemas_array_metric_item)
84
+
58
85
  inference_per_second_global = []
59
86
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
60
87
  for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
@@ -62,6 +89,13 @@ class ResourceMetrics:
62
89
 
63
90
  inference_per_second_global.append(componentsschemas_array_metric_item)
64
91
 
92
+ _query_per_region = d.pop("query_per_region", UNSET)
93
+ query_per_region: Union[Unset, QPS]
94
+ if isinstance(_query_per_region, Unset):
95
+ query_per_region = UNSET
96
+ else:
97
+ query_per_region = QPS.from_dict(_query_per_region)
98
+
65
99
  _query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
66
100
  query_per_second_per_region: Union[Unset, QPS]
67
101
  if isinstance(_query_per_second_per_region, Unset):
@@ -70,7 +104,9 @@ class ResourceMetrics:
70
104
  query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
71
105
 
72
106
  resource_metrics = cls(
107
+ inference_global=inference_global,
73
108
  inference_per_second_global=inference_per_second_global,
109
+ query_per_region=query_per_region,
74
110
  query_per_second_per_region=query_per_second_per_region,
75
111
  )
76
112