beamlit 0.0.24rc19__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. beamlit/agents/chat.py +37 -11
  2. beamlit/agents/decorator.py +97 -65
  3. beamlit/api/agents/create_agent.py +9 -14
  4. beamlit/api/agents/delete_agent.py +22 -1
  5. beamlit/api/agents/delete_agent_history.py +2 -6
  6. beamlit/api/agents/get_agent.py +22 -1
  7. beamlit/api/agents/get_agent_environment_logs.py +11 -11
  8. beamlit/api/agents/get_agent_history.py +2 -6
  9. beamlit/api/agents/get_agent_metrics.py +22 -1
  10. beamlit/api/agents/list_agent_history.py +11 -11
  11. beamlit/api/agents/list_agents.py +36 -4
  12. beamlit/api/agents/put_agent_history.py +2 -6
  13. beamlit/api/agents/update_agent.py +9 -14
  14. beamlit/api/functions/create_function.py +9 -14
  15. beamlit/api/functions/delete_function.py +22 -1
  16. beamlit/api/functions/get_function.py +22 -1
  17. beamlit/api/functions/get_function_environment_logs.py +11 -11
  18. beamlit/api/functions/get_function_metrics.py +22 -1
  19. beamlit/api/functions/list_functions.py +36 -4
  20. beamlit/api/functions/update_function.py +9 -14
  21. beamlit/api/history/get_agents_history.py +12 -12
  22. beamlit/api/history/list_agents_history.py +12 -12
  23. beamlit/api/integrations/get_integration_connection.py +16 -12
  24. beamlit/api/integrations/get_integration_connection_model.py +8 -1
  25. beamlit/api/integrations/get_integration_model.py +8 -1
  26. beamlit/api/locations/list_locations.py +12 -12
  27. beamlit/api/models/create_model.py +13 -14
  28. beamlit/api/models/delete_model.py +22 -1
  29. beamlit/api/models/get_model.py +22 -1
  30. beamlit/api/models/get_model_environment_logs.py +11 -11
  31. beamlit/api/models/get_model_metrics.py +38 -13
  32. beamlit/api/models/list_models.py +36 -4
  33. beamlit/api/models/update_model.py +13 -14
  34. beamlit/api/privateclusters/__init__.py +0 -0
  35. beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
  36. beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
  37. beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
  38. beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
  39. beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
  40. beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
  41. beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
  42. beamlit/authentication/device_mode.py +3 -9
  43. beamlit/common/generate.py +47 -34
  44. beamlit/common/settings.py +29 -27
  45. beamlit/deploy/deploy.py +101 -342
  46. beamlit/deploy/format.py +70 -0
  47. beamlit/deploy/parser.py +175 -0
  48. beamlit/functions/decorator.py +17 -14
  49. beamlit/models/__init__.py +64 -78
  50. beamlit/models/acl.py +4 -22
  51. beamlit/models/agent.py +34 -95
  52. beamlit/models/agent_history.py +7 -5
  53. beamlit/models/agent_history_event.py +11 -9
  54. beamlit/models/agent_metadata.py +5 -3
  55. beamlit/models/agent_spec.py +54 -45
  56. beamlit/models/api_key.py +14 -14
  57. beamlit/models/configuration.py +11 -0
  58. beamlit/models/core_spec.py +45 -32
  59. beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
  60. beamlit/models/environment.py +33 -105
  61. beamlit/models/environment_metadata.py +146 -0
  62. beamlit/models/environment_spec.py +8 -6
  63. beamlit/models/function.py +34 -95
  64. beamlit/models/function_metadata.py +5 -3
  65. beamlit/models/function_spec.py +53 -40
  66. beamlit/models/integration_connection.py +31 -137
  67. beamlit/models/integration_connection_spec.py +6 -4
  68. beamlit/models/metadata.py +5 -3
  69. beamlit/models/metadata_labels.py +4 -2
  70. beamlit/models/model.py +33 -94
  71. beamlit/models/model_metadata.py +5 -3
  72. beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
  73. beamlit/models/model_provider.py +27 -43
  74. beamlit/models/model_spec.py +45 -32
  75. beamlit/models/owner_fields.py +4 -2
  76. beamlit/models/pending_invitation.py +14 -14
  77. beamlit/models/pod_template_spec.py +4 -2
  78. beamlit/models/policy.py +33 -159
  79. beamlit/models/policy_spec.py +24 -28
  80. beamlit/models/private_cluster.py +183 -0
  81. beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
  82. beamlit/models/resource_deployment_metrics.py +0 -108
  83. beamlit/models/resource_environment_metrics.py +143 -71
  84. beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
  85. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
  86. beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
  87. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
  88. beamlit/models/resource_log.py +4 -2
  89. beamlit/models/runtime.py +20 -2
  90. beamlit/models/serverless_config.py +28 -21
  91. beamlit/models/spec_configuration.py +7 -5
  92. beamlit/models/store_agent.py +14 -14
  93. beamlit/models/store_function.py +14 -14
  94. beamlit/models/time_fields.py +4 -2
  95. beamlit/models/websocket_channel.py +4 -2
  96. beamlit/models/workspace.py +23 -14
  97. beamlit/run.py +0 -1
  98. beamlit/serve/app.py +1 -0
  99. beamlit/serve/middlewares/accesslog.py +3 -1
  100. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.dist-info/RECORD +243 -0
  102. beamlit/api/agents/delete_agent_deployment.py +0 -163
  103. beamlit/api/agents/delete_agent_deployment_history.py +0 -172
  104. beamlit/api/agents/get_agent_deployment_history.py +0 -172
  105. beamlit/api/agents/get_agent_deployment_logs.py +0 -164
  106. beamlit/api/agents/list_agent_deployment_history.py +0 -164
  107. beamlit/api/agents/put_agent_deployment.py +0 -185
  108. beamlit/api/agents/put_agent_deployment_history.py +0 -198
  109. beamlit/api/functions/delete_function_deployment.py +0 -163
  110. beamlit/api/functions/get_function_deployment.py +0 -163
  111. beamlit/api/functions/get_function_deployment_logs.py +0 -164
  112. beamlit/api/functions/get_function_deployment_metrics.py +0 -159
  113. beamlit/api/functions/put_function_deployment.py +0 -185
  114. beamlit/api/models/delete_model_deployment.py +0 -171
  115. beamlit/api/models/get_model_deployment.py +0 -171
  116. beamlit/api/models/get_model_deployment_logs.py +0 -168
  117. beamlit/api/models/get_model_deployment_metrics.py +0 -163
  118. beamlit/api/models/put_model_deployment.py +0 -193
  119. beamlit/models/agent_configuration.py +0 -70
  120. beamlit/models/agent_deployment.py +0 -340
  121. beamlit/models/agent_deployment_configuration.py +0 -45
  122. beamlit/models/agent_deployment_configuration_type_0.py +0 -43
  123. beamlit/models/agent_deployment_history.py +0 -185
  124. beamlit/models/agent_deployment_history_event.py +0 -133
  125. beamlit/models/agent_deployment_pod_template.py +0 -45
  126. beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
  127. beamlit/models/agent_with_deployments.py +0 -176
  128. beamlit/models/authentication_provider_model.py +0 -144
  129. beamlit/models/authentication_provider_organization.py +0 -88
  130. beamlit/models/deployment_configuration.py +0 -70
  131. beamlit/models/deployment_configurations.py +0 -58
  132. beamlit/models/deployment_serverless_config.py +0 -131
  133. beamlit/models/deployment_serverless_config_type_0.py +0 -220
  134. beamlit/models/function_configuration.py +0 -70
  135. beamlit/models/function_deployment.py +0 -340
  136. beamlit/models/function_deployment_configuration.py +0 -45
  137. beamlit/models/function_deployment_configuration_type_0.py +0 -43
  138. beamlit/models/function_deployment_pod_template.py +0 -45
  139. beamlit/models/function_deployment_pod_template_type_0.py +0 -43
  140. beamlit/models/function_with_deployments.py +0 -176
  141. beamlit/models/integration.py +0 -198
  142. beamlit/models/integration_config.py +0 -45
  143. beamlit/models/integration_secret.py +0 -61
  144. beamlit/models/labels_type_0.py +0 -45
  145. beamlit/models/location.py +0 -122
  146. beamlit/models/model_deployment.py +0 -296
  147. beamlit/models/model_deployment_log.py +0 -70
  148. beamlit/models/model_deployment_metrics.py +0 -172
  149. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
  150. beamlit/models/model_deployment_pod_template.py +0 -45
  151. beamlit/models/model_deployment_pod_template_type_0.py +0 -43
  152. beamlit/models/model_metrics.py +0 -96
  153. beamlit/models/model_with_deployments.py +0 -176
  154. beamlit/models/resource_deployment_log.py +0 -70
  155. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
  156. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
  157. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
  158. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
  159. beamlit/models/runtime_readiness_probe_type_0.py +0 -43
  160. beamlit/models/runtime_type_0.py +0 -111
  161. beamlit/models/runtime_type_0_readiness_probe.py +0 -43
  162. beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
  163. beamlit/models/runtime_type_0_resources.py +0 -59
  164. beamlit/models/standard_fields_dynamo_db.py +0 -88
  165. beamlit/models/store_agent_configuration.py +0 -97
  166. beamlit/models/store_agent_labels_type_0.py +0 -43
  167. beamlit/models/store_function_configuration.py +0 -97
  168. beamlit/models/store_function_labels_type_0.py +0 -43
  169. beamlit-0.0.24rc19.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -1,296 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- if TYPE_CHECKING:
9
- from ..models.deployment_serverless_config import DeploymentServerlessConfig
10
- from ..models.flavor import Flavor
11
- from ..models.labels_type_0 import LabelsType0
12
- from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
13
- from ..models.model_provider_ref import ModelProviderRef
14
- from ..models.runtime import Runtime
15
-
16
-
17
- T = TypeVar("T", bound="ModelDeployment")
18
-
19
-
20
- @_attrs_define
21
- class ModelDeployment:
22
- """An instance of a model, deployed in a specific environment
23
-
24
- Attributes:
25
- created_at (Union[Unset, str]): The date and time when the resource was created
26
- created_by (Union[Unset, str]): The user or service account who created the resource
27
- updated_at (Union[Unset, str]): The date and time when the resource was updated
28
- updated_by (Union[Unset, str]): The user or service account who updated the resource
29
- enabled (Union[Unset, bool]): If false, the model deployment will not be active nor serve requests
30
- environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
31
- flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
32
- integration_connections (Union[Unset, list[str]]):
33
- labels (Union['LabelsType0', None, Unset]): Labels
34
- metric_port (Union[Unset, int]): The port to serve the metrics on
35
- model (Union[Unset, str]): The name of the parent model
36
- model_provider_ref (Union[Unset, ModelProviderRef]): Reference to a model provider
37
- pod_template (Union[Unset, ModelDeploymentPodTemplate]): The pod template for the deployment. Should be a
38
- Kubernetes PodTemplateSpec
39
- policies (Union[Unset, list[str]]):
40
- runtime (Union[Unset, Runtime]): Set of configurations for a deployment
41
- serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
42
- serving_port (Union[Unset, int]): The port to serve the model on
43
- workspace (Union[Unset, str]): The workspace the model deployment belongs to
44
- """
45
-
46
- created_at: Union[Unset, str] = UNSET
47
- created_by: Union[Unset, str] = UNSET
48
- updated_at: Union[Unset, str] = UNSET
49
- updated_by: Union[Unset, str] = UNSET
50
- enabled: Union[Unset, bool] = UNSET
51
- environment: Union[Unset, str] = UNSET
52
- flavors: Union[Unset, list["Flavor"]] = UNSET
53
- integration_connections: Union[Unset, list[str]] = UNSET
54
- labels: Union["LabelsType0", None, Unset] = UNSET
55
- metric_port: Union[Unset, int] = UNSET
56
- model: Union[Unset, str] = UNSET
57
- model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
58
- pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
59
- policies: Union[Unset, list[str]] = UNSET
60
- runtime: Union[Unset, "Runtime"] = UNSET
61
- serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
62
- serving_port: Union[Unset, int] = UNSET
63
- workspace: Union[Unset, str] = UNSET
64
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
65
-
66
- def to_dict(self) -> dict[str, Any]:
67
- from ..models.labels_type_0 import LabelsType0
68
-
69
- created_at = self.created_at
70
-
71
- created_by = self.created_by
72
-
73
- updated_at = self.updated_at
74
-
75
- updated_by = self.updated_by
76
-
77
- enabled = self.enabled
78
-
79
- environment = self.environment
80
-
81
- flavors: Union[Unset, list[dict[str, Any]]] = UNSET
82
- if not isinstance(self.flavors, Unset):
83
- flavors = []
84
- for componentsschemas_flavors_item_data in self.flavors:
85
- componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
86
- flavors.append(componentsschemas_flavors_item)
87
-
88
- integration_connections: Union[Unset, list[str]] = UNSET
89
- if not isinstance(self.integration_connections, Unset):
90
- integration_connections = self.integration_connections
91
-
92
- labels: Union[None, Unset, dict[str, Any]]
93
- if isinstance(self.labels, Unset):
94
- labels = UNSET
95
- elif isinstance(self.labels, LabelsType0):
96
- labels = self.labels.to_dict()
97
- else:
98
- labels = self.labels
99
-
100
- metric_port = self.metric_port
101
-
102
- model = self.model
103
-
104
- model_provider_ref: Union[Unset, dict[str, Any]] = UNSET
105
- if not isinstance(self.model_provider_ref, Unset):
106
- model_provider_ref = self.model_provider_ref.to_dict()
107
-
108
- pod_template: Union[Unset, dict[str, Any]] = UNSET
109
- if not isinstance(self.pod_template, Unset):
110
- pod_template = self.pod_template.to_dict()
111
-
112
- policies: Union[Unset, list[str]] = UNSET
113
- if not isinstance(self.policies, Unset):
114
- policies = self.policies
115
-
116
- runtime: Union[Unset, dict[str, Any]] = UNSET
117
- if not isinstance(self.runtime, Unset):
118
- runtime = self.runtime.to_dict()
119
-
120
- serverless_config: Union[Unset, dict[str, Any]] = UNSET
121
- if not isinstance(self.serverless_config, Unset):
122
- serverless_config = self.serverless_config.to_dict()
123
-
124
- serving_port = self.serving_port
125
-
126
- workspace = self.workspace
127
-
128
- field_dict: dict[str, Any] = {}
129
- field_dict.update(self.additional_properties)
130
- field_dict.update({})
131
- if created_at is not UNSET:
132
- field_dict["created_at"] = created_at
133
- if created_by is not UNSET:
134
- field_dict["created_by"] = created_by
135
- if updated_at is not UNSET:
136
- field_dict["updated_at"] = updated_at
137
- if updated_by is not UNSET:
138
- field_dict["updated_by"] = updated_by
139
- if enabled is not UNSET:
140
- field_dict["enabled"] = enabled
141
- if environment is not UNSET:
142
- field_dict["environment"] = environment
143
- if flavors is not UNSET:
144
- field_dict["flavors"] = flavors
145
- if integration_connections is not UNSET:
146
- field_dict["integration_connections"] = integration_connections
147
- if labels is not UNSET:
148
- field_dict["labels"] = labels
149
- if metric_port is not UNSET:
150
- field_dict["metric_port"] = metric_port
151
- if model is not UNSET:
152
- field_dict["model"] = model
153
- if model_provider_ref is not UNSET:
154
- field_dict["model_provider_ref"] = model_provider_ref
155
- if pod_template is not UNSET:
156
- field_dict["pod_template"] = pod_template
157
- if policies is not UNSET:
158
- field_dict["policies"] = policies
159
- if runtime is not UNSET:
160
- field_dict["runtime"] = runtime
161
- if serverless_config is not UNSET:
162
- field_dict["serverless_config"] = serverless_config
163
- if serving_port is not UNSET:
164
- field_dict["serving_port"] = serving_port
165
- if workspace is not UNSET:
166
- field_dict["workspace"] = workspace
167
-
168
- return field_dict
169
-
170
- @classmethod
171
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
172
- from ..models.deployment_serverless_config import DeploymentServerlessConfig
173
- from ..models.flavor import Flavor
174
- from ..models.labels_type_0 import LabelsType0
175
- from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
176
- from ..models.model_provider_ref import ModelProviderRef
177
- from ..models.runtime import Runtime
178
-
179
- if not src_dict:
180
- return None
181
- d = src_dict.copy()
182
- created_at = d.pop("created_at", UNSET)
183
-
184
- created_by = d.pop("created_by", UNSET)
185
-
186
- updated_at = d.pop("updated_at", UNSET)
187
-
188
- updated_by = d.pop("updated_by", UNSET)
189
-
190
- enabled = d.pop("enabled", UNSET)
191
-
192
- environment = d.pop("environment", UNSET)
193
-
194
- flavors = []
195
- _flavors = d.pop("flavors", UNSET)
196
- for componentsschemas_flavors_item_data in _flavors or []:
197
- componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
198
-
199
- flavors.append(componentsschemas_flavors_item)
200
-
201
- integration_connections = cast(list[str], d.pop("integration_connections", UNSET))
202
-
203
- def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
204
- if data is None:
205
- return data
206
- if isinstance(data, Unset):
207
- return data
208
- try:
209
- if not isinstance(data, dict):
210
- raise TypeError()
211
- componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
212
-
213
- return componentsschemas_labels_type_0
214
- except: # noqa: E722
215
- pass
216
- return cast(Union["LabelsType0", None, Unset], data)
217
-
218
- labels = _parse_labels(d.pop("labels", UNSET))
219
-
220
- metric_port = d.pop("metric_port", UNSET)
221
-
222
- model = d.pop("model", UNSET)
223
-
224
- _model_provider_ref = d.pop("model_provider_ref", UNSET)
225
- model_provider_ref: Union[Unset, ModelProviderRef]
226
- if isinstance(_model_provider_ref, Unset):
227
- model_provider_ref = UNSET
228
- else:
229
- model_provider_ref = ModelProviderRef.from_dict(_model_provider_ref)
230
-
231
- _pod_template = d.pop("pod_template", UNSET)
232
- pod_template: Union[Unset, ModelDeploymentPodTemplate]
233
- if isinstance(_pod_template, Unset):
234
- pod_template = UNSET
235
- else:
236
- pod_template = ModelDeploymentPodTemplate.from_dict(_pod_template)
237
-
238
- policies = cast(list[str], d.pop("policies", UNSET))
239
-
240
- _runtime = d.pop("runtime", UNSET)
241
- runtime: Union[Unset, Runtime]
242
- if isinstance(_runtime, Unset):
243
- runtime = UNSET
244
- else:
245
- runtime = Runtime.from_dict(_runtime)
246
-
247
- _serverless_config = d.pop("serverless_config", UNSET)
248
- serverless_config: Union[Unset, DeploymentServerlessConfig]
249
- if isinstance(_serverless_config, Unset):
250
- serverless_config = UNSET
251
- else:
252
- serverless_config = DeploymentServerlessConfig.from_dict(_serverless_config)
253
-
254
- serving_port = d.pop("serving_port", UNSET)
255
-
256
- workspace = d.pop("workspace", UNSET)
257
-
258
- model_deployment = cls(
259
- created_at=created_at,
260
- created_by=created_by,
261
- updated_at=updated_at,
262
- updated_by=updated_by,
263
- enabled=enabled,
264
- environment=environment,
265
- flavors=flavors,
266
- integration_connections=integration_connections,
267
- labels=labels,
268
- metric_port=metric_port,
269
- model=model,
270
- model_provider_ref=model_provider_ref,
271
- pod_template=pod_template,
272
- policies=policies,
273
- runtime=runtime,
274
- serverless_config=serverless_config,
275
- serving_port=serving_port,
276
- workspace=workspace,
277
- )
278
-
279
- model_deployment.additional_properties = d
280
- return model_deployment
281
-
282
- @property
283
- def additional_keys(self) -> list[str]:
284
- return list(self.additional_properties.keys())
285
-
286
- def __getitem__(self, key: str) -> Any:
287
- return self.additional_properties[key]
288
-
289
- def __setitem__(self, key: str, value: Any) -> None:
290
- self.additional_properties[key] = value
291
-
292
- def __delitem__(self, key: str) -> None:
293
- del self.additional_properties[key]
294
-
295
- def __contains__(self, key: str) -> bool:
296
- return key in self.additional_properties
@@ -1,70 +0,0 @@
1
- from typing import Any, TypeVar, Union
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- T = TypeVar("T", bound="ModelDeploymentLog")
9
-
10
-
11
- @_attrs_define
12
- class ModelDeploymentLog:
13
- """Log for a model 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
- if not src_dict:
42
- return None
43
- d = src_dict.copy()
44
- message = d.pop("message", UNSET)
45
-
46
- timestamp = d.pop("timestamp", UNSET)
47
-
48
- model_deployment_log = cls(
49
- message=message,
50
- timestamp=timestamp,
51
- )
52
-
53
- model_deployment_log.additional_properties = d
54
- return model_deployment_log
55
-
56
- @property
57
- def additional_keys(self) -> list[str]:
58
- return list(self.additional_properties.keys())
59
-
60
- def __getitem__(self, key: str) -> Any:
61
- return self.additional_properties[key]
62
-
63
- def __setitem__(self, key: str, value: Any) -> None:
64
- self.additional_properties[key] = value
65
-
66
- def __delitem__(self, key: str) -> None:
67
- del self.additional_properties[key]
68
-
69
- def __contains__(self, key: str) -> bool:
70
- return key in self.additional_properties
@@ -1,172 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- if TYPE_CHECKING:
9
- from ..models.metric import Metric
10
- from ..models.model_deployment_metrics_inference_per_second_per_region import (
11
- ModelDeploymentMetricsInferencePerSecondPerRegion,
12
- )
13
- from ..models.model_deployment_metrics_query_per_second_per_region_per_code import (
14
- ModelDeploymentMetricsQueryPerSecondPerRegionPerCode,
15
- )
16
- from ..models.qps import QPS
17
-
18
-
19
- T = TypeVar("T", bound="ModelDeploymentMetrics")
20
-
21
-
22
- @_attrs_define
23
- class ModelDeploymentMetrics:
24
- """Metrics for a single model deployment
25
-
26
- Attributes:
27
- inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
28
- inference_per_second_per_region (Union[Unset, ModelDeploymentMetricsInferencePerSecondPerRegion]): Historical
29
- 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, ModelDeploymentMetricsQueryPerSecondPerRegionPerCode]): RPS
36
- 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, "ModelDeploymentMetricsInferencePerSecondPerRegion"] = 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, "ModelDeploymentMetricsQueryPerSecondPerRegionPerCode"] = UNSET
45
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
-
47
- def to_dict(self) -> dict[str, Any]:
48
- inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
49
- if not isinstance(self.inference_per_second_global, Unset):
50
- inference_per_second_global = []
51
- for componentsschemas_array_metric_item_data in self.inference_per_second_global:
52
- componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
53
- inference_per_second_global.append(componentsschemas_array_metric_item)
54
-
55
- inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
56
- if not isinstance(self.inference_per_second_per_region, Unset):
57
- inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
58
-
59
- query_per_second_global = self.query_per_second_global
60
-
61
- query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
62
- if not isinstance(self.query_per_second_per_code_global, Unset):
63
- query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
64
-
65
- query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
66
- if not isinstance(self.query_per_second_per_region, Unset):
67
- query_per_second_per_region = self.query_per_second_per_region.to_dict()
68
-
69
- query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
70
- if not isinstance(self.query_per_second_per_region_per_code, Unset):
71
- query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
72
-
73
- field_dict: dict[str, Any] = {}
74
- field_dict.update(self.additional_properties)
75
- field_dict.update({})
76
- if inference_per_second_global is not UNSET:
77
- field_dict["inference_per_second_global"] = inference_per_second_global
78
- if inference_per_second_per_region is not UNSET:
79
- field_dict["inference_per_second_per_region"] = inference_per_second_per_region
80
- if query_per_second_global is not UNSET:
81
- field_dict["query_per_second_global"] = query_per_second_global
82
- if query_per_second_per_code_global is not UNSET:
83
- field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
84
- if query_per_second_per_region is not UNSET:
85
- field_dict["query_per_second_per_region"] = query_per_second_per_region
86
- if query_per_second_per_region_per_code is not UNSET:
87
- field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
88
-
89
- return field_dict
90
-
91
- @classmethod
92
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
93
- from ..models.metric import Metric
94
- from ..models.model_deployment_metrics_inference_per_second_per_region import (
95
- ModelDeploymentMetricsInferencePerSecondPerRegion,
96
- )
97
- from ..models.model_deployment_metrics_query_per_second_per_region_per_code import (
98
- ModelDeploymentMetricsQueryPerSecondPerRegionPerCode,
99
- )
100
- from ..models.qps import QPS
101
-
102
- if not src_dict:
103
- return None
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, ModelDeploymentMetricsInferencePerSecondPerRegion]
114
- if isinstance(_inference_per_second_per_region, Unset):
115
- inference_per_second_per_region = UNSET
116
- else:
117
- inference_per_second_per_region = ModelDeploymentMetricsInferencePerSecondPerRegion.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, ModelDeploymentMetricsQueryPerSecondPerRegionPerCode]
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 = ModelDeploymentMetricsQueryPerSecondPerRegionPerCode.from_dict(
143
- _query_per_second_per_region_per_code
144
- )
145
-
146
- model_deployment_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
- model_deployment_metrics.additional_properties = d
156
- return model_deployment_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
@@ -1,77 +0,0 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- from ..types import UNSET, Unset
7
-
8
- if TYPE_CHECKING:
9
- from ..models.metric import Metric
10
-
11
-
12
- T = TypeVar("T", bound="ModelDeploymentMetricsInferencePerSecondPerRegion")
13
-
14
-
15
- @_attrs_define
16
- class ModelDeploymentMetricsInferencePerSecondPerRegion:
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
- if not src_dict:
47
- return None
48
- d = src_dict.copy()
49
- region = []
50
- _region = d.pop("region", UNSET)
51
- for componentsschemas_array_metric_item_data in _region or []:
52
- componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
53
-
54
- region.append(componentsschemas_array_metric_item)
55
-
56
- model_deployment_metrics_inference_per_second_per_region = cls(
57
- region=region,
58
- )
59
-
60
- model_deployment_metrics_inference_per_second_per_region.additional_properties = d
61
- return model_deployment_metrics_inference_per_second_per_region
62
-
63
- @property
64
- def additional_keys(self) -> list[str]:
65
- return list(self.additional_properties.keys())
66
-
67
- def __getitem__(self, key: str) -> Any:
68
- return self.additional_properties[key]
69
-
70
- def __setitem__(self, key: str, value: Any) -> None:
71
- self.additional_properties[key] = value
72
-
73
- def __delitem__(self, key: str) -> None:
74
- del self.additional_properties[key]
75
-
76
- def __contains__(self, key: str) -> bool:
77
- return key in self.additional_properties
@@ -1,45 +0,0 @@
1
- from typing import Any, TypeVar
2
-
3
- from attrs import define as _attrs_define
4
- from attrs import field as _attrs_field
5
-
6
- T = TypeVar("T", bound="ModelDeploymentPodTemplate")
7
-
8
-
9
- @_attrs_define
10
- class ModelDeploymentPodTemplate:
11
- """The pod template for the deployment. Should be a Kubernetes PodTemplateSpec"""
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
- model_deployment_pod_template = cls()
27
-
28
- model_deployment_pod_template.additional_properties = d
29
- return model_deployment_pod_template
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