beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc4__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. beamlit/api/agents/delete_agent_history.py +155 -0
  2. beamlit/api/agents/get_agent_deployment.py +1 -22
  3. beamlit/api/agents/get_agent_environment_logs.py +151 -0
  4. beamlit/api/agents/get_agent_history.py +155 -0
  5. beamlit/api/agents/list_agent_history.py +151 -0
  6. beamlit/api/agents/put_agent_history.py +181 -0
  7. beamlit/api/functions/get_function_environment_logs.py +151 -0
  8. beamlit/api/models/get_model_environment_logs.py +155 -0
  9. beamlit/common/generate.py +8 -3
  10. beamlit/common/settings.py +1 -5
  11. beamlit/models/__init__.py +28 -30
  12. beamlit/models/acl.py +2 -0
  13. beamlit/models/agent.py +2 -0
  14. beamlit/models/agent_chain.py +2 -0
  15. beamlit/models/agent_configuration.py +2 -0
  16. beamlit/models/agent_deployment.py +44 -99
  17. beamlit/models/agent_deployment_configuration.py +45 -0
  18. beamlit/models/agent_deployment_history.py +15 -46
  19. beamlit/models/agent_deployment_history_event.py +24 -78
  20. beamlit/models/agent_deployment_pod_template.py +45 -0
  21. beamlit/models/agent_history.py +165 -0
  22. beamlit/models/agent_history_event.py +131 -0
  23. beamlit/models/agent_metadata.py +144 -0
  24. beamlit/models/agent_release.py +2 -0
  25. beamlit/models/agent_spec.py +238 -0
  26. beamlit/models/agent_with_deployments.py +2 -0
  27. beamlit/models/api_key.py +2 -0
  28. beamlit/models/authentication_provider_model.py +2 -0
  29. beamlit/models/authentication_provider_organization.py +2 -0
  30. beamlit/models/configuration.py +2 -0
  31. beamlit/models/continent.py +2 -0
  32. beamlit/models/core_spec.py +179 -0
  33. beamlit/models/country.py +2 -0
  34. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  35. beamlit/models/create_workspace_service_account_body.py +2 -0
  36. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  37. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  38. beamlit/models/deployment_configuration.py +2 -0
  39. beamlit/models/deployment_configurations.py +2 -0
  40. beamlit/models/deployment_serverless_config.py +131 -0
  41. beamlit/models/environment.py +2 -0
  42. beamlit/models/environment_metrics.py +2 -0
  43. beamlit/models/environment_spec.py +61 -0
  44. beamlit/models/flavor.py +2 -0
  45. beamlit/models/function.py +2 -0
  46. beamlit/models/function_configuration.py +2 -0
  47. beamlit/models/function_deployment.py +44 -99
  48. beamlit/models/function_deployment_configuration.py +45 -0
  49. beamlit/models/function_deployment_pod_template.py +45 -0
  50. beamlit/models/function_kit.py +2 -0
  51. beamlit/models/function_metadata.py +144 -0
  52. beamlit/models/function_provider_ref.py +2 -0
  53. beamlit/models/function_release.py +2 -0
  54. beamlit/models/function_spec.py +240 -0
  55. beamlit/models/function_with_deployments.py +2 -0
  56. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  57. beamlit/models/increase_and_rate_metric.py +2 -0
  58. beamlit/models/integration.py +2 -0
  59. beamlit/models/integration_config.py +2 -0
  60. beamlit/models/integration_connection.py +2 -0
  61. beamlit/models/integration_connection_config.py +2 -0
  62. beamlit/models/integration_connection_secret.py +2 -0
  63. beamlit/models/integration_connection_spec.py +99 -0
  64. beamlit/models/integration_model.py +2 -0
  65. beamlit/models/integration_secret.py +2 -0
  66. beamlit/models/invite_workspace_user_body.py +2 -0
  67. beamlit/models/labels_type_0.py +2 -0
  68. beamlit/models/location.py +2 -0
  69. beamlit/models/location_response.py +2 -0
  70. beamlit/models/metadata.py +135 -0
  71. beamlit/models/metadata_labels.py +43 -0
  72. beamlit/models/metric.py +2 -0
  73. beamlit/models/metrics.py +2 -0
  74. beamlit/models/model.py +2 -0
  75. beamlit/models/model_deployment.py +66 -85
  76. beamlit/models/model_deployment_log.py +2 -0
  77. beamlit/models/model_deployment_metrics.py +2 -0
  78. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  79. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  80. beamlit/models/model_deployment_pod_template.py +45 -0
  81. beamlit/models/model_metadata.py +144 -0
  82. beamlit/models/model_metrics.py +2 -0
  83. beamlit/models/model_provider.py +2 -0
  84. beamlit/models/model_provider_ref.py +2 -0
  85. beamlit/models/model_release.py +2 -0
  86. beamlit/models/model_spec.py +188 -0
  87. beamlit/models/model_with_deployments.py +2 -0
  88. beamlit/models/owner_fields.py +68 -0
  89. beamlit/models/pending_invitation.py +2 -0
  90. beamlit/models/pending_invitation_accept.py +2 -0
  91. beamlit/models/pending_invitation_render.py +2 -0
  92. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  93. beamlit/models/pending_invitation_render_workspace.py +2 -0
  94. beamlit/models/pending_invitation_workspace_details.py +2 -0
  95. beamlit/models/pod_template_spec.py +43 -0
  96. beamlit/models/policy.py +36 -8
  97. beamlit/models/policy_location.py +2 -0
  98. beamlit/models/policy_spec.py +119 -0
  99. beamlit/models/provider_config.py +2 -0
  100. beamlit/models/qps.py +2 -0
  101. beamlit/models/resource_deployment_log.py +2 -0
  102. beamlit/models/resource_deployment_metrics.py +70 -155
  103. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  104. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  105. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  106. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  107. beamlit/models/resource_environment_metrics.py +172 -0
  108. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  109. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  110. beamlit/models/resource_log.py +68 -0
  111. beamlit/models/resource_metrics.py +2 -0
  112. beamlit/models/runtime.py +14 -29
  113. beamlit/models/runtime_readiness_probe.py +45 -0
  114. beamlit/models/runtime_resources.py +2 -0
  115. beamlit/models/runtime_type_0.py +111 -0
  116. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  117. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  118. beamlit/models/runtime_type_0_resources.py +59 -0
  119. beamlit/models/serverless_config.py +2 -0
  120. beamlit/models/spec_configuration.py +68 -0
  121. beamlit/models/standard_fields_dynamo_db.py +2 -0
  122. beamlit/models/store_agent.py +15 -29
  123. beamlit/models/store_agent_configuration.py +2 -0
  124. beamlit/models/store_agent_labels.py +45 -0
  125. beamlit/models/store_configuration.py +6 -15
  126. beamlit/models/store_configuration_option.py +7 -18
  127. beamlit/models/store_function.py +15 -29
  128. beamlit/models/store_function_configuration.py +2 -0
  129. beamlit/models/store_function_kit.py +2 -0
  130. beamlit/models/store_function_labels.py +45 -0
  131. beamlit/models/store_function_parameter.py +2 -0
  132. beamlit/models/time_fields.py +68 -0
  133. beamlit/models/update_workspace_service_account_body.py +2 -0
  134. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  135. beamlit/models/update_workspace_user_role_body.py +2 -0
  136. beamlit/models/websocket_channel.py +86 -0
  137. beamlit/models/workspace.py +2 -0
  138. beamlit/models/workspace_labels.py +2 -0
  139. beamlit/models/workspace_user.py +2 -0
  140. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
  141. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
  142. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/WHEEL +0 -0
beamlit/models/model.py CHANGED
@@ -88,6 +88,8 @@ class Model:
88
88
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
89
89
  from ..models.labels_type_0 import LabelsType0
90
90
 
91
+ if not src_dict:
92
+ return None
91
93
  d = src_dict.copy()
92
94
  created_at = d.pop("created_at", UNSET)
93
95
 
@@ -6,9 +6,12 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
+ from ..models.deployment_serverless_config import DeploymentServerlessConfig
9
10
  from ..models.flavor import Flavor
10
11
  from ..models.labels_type_0 import LabelsType0
11
- from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
12
+ from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
13
+ from ..models.model_provider_ref import ModelProviderRef
14
+ from ..models.runtime import Runtime
12
15
 
13
16
 
14
17
  T = TypeVar("T", bound="ModelDeployment")
@@ -23,20 +26,20 @@ class ModelDeployment:
23
26
  created_by (Union[Unset, str]): The user or service account who created the resource
24
27
  updated_at (Union[Unset, str]): The date and time when the resource was updated
25
28
  updated_by (Union[Unset, str]): The user or service account who updated the resource
26
- enabled (Union[None, Unset, bool]): If false, the model deployment will not be active nor serve requests
29
+ enabled (Union[Unset, bool]): If false, the model deployment will not be active nor serve requests
27
30
  environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
28
31
  flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
29
32
  integration_connections (Union[Unset, List[str]]):
30
33
  labels (Union['LabelsType0', None, Unset]): Labels
31
- metric_port (Union[None, Unset, int]): The port to serve the metrics on
34
+ metric_port (Union[Unset, int]): The port to serve the metrics on
32
35
  model (Union[Unset, str]): The name of the parent model
33
- model_provider_ref (Union[Unset, Any]): The reference for the origin of the model
34
- pod_template (Union['ModelDeploymentPodTemplateType0', None, Unset]): The pod template for the deployment.
35
- Should be a Kubernetes PodTemplateSpec
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
36
39
  policies (Union[Unset, List[str]]):
37
- runtime (Union[Unset, Any]): Configurations that describe which model is being served and how it is served
38
- serverless_config (Union[Unset, Any]): The configuration for scaling the model deployment
39
- serving_port (Union[None, Unset, int]): The port to serve the model on
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
40
43
  workspace (Union[Unset, str]): The workspace the model deployment belongs to
41
44
  """
42
45
 
@@ -44,25 +47,24 @@ class ModelDeployment:
44
47
  created_by: Union[Unset, str] = UNSET
45
48
  updated_at: Union[Unset, str] = UNSET
46
49
  updated_by: Union[Unset, str] = UNSET
47
- enabled: Union[None, Unset, bool] = UNSET
50
+ enabled: Union[Unset, bool] = UNSET
48
51
  environment: Union[Unset, str] = UNSET
49
52
  flavors: Union[Unset, List["Flavor"]] = UNSET
50
53
  integration_connections: Union[Unset, List[str]] = UNSET
51
54
  labels: Union["LabelsType0", None, Unset] = UNSET
52
- metric_port: Union[None, Unset, int] = UNSET
55
+ metric_port: Union[Unset, int] = UNSET
53
56
  model: Union[Unset, str] = UNSET
54
- model_provider_ref: Union[Unset, Any] = UNSET
55
- pod_template: Union["ModelDeploymentPodTemplateType0", None, Unset] = UNSET
57
+ model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
58
+ pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
56
59
  policies: Union[Unset, List[str]] = UNSET
57
- runtime: Union[Unset, Any] = UNSET
58
- serverless_config: Union[Unset, Any] = UNSET
59
- serving_port: Union[None, Unset, int] = UNSET
60
+ runtime: Union[Unset, "Runtime"] = UNSET
61
+ serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
62
+ serving_port: Union[Unset, int] = UNSET
60
63
  workspace: Union[Unset, str] = UNSET
61
64
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
62
65
 
63
66
  def to_dict(self) -> dict[str, Any]:
64
67
  from ..models.labels_type_0 import LabelsType0
65
- from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
66
68
 
67
69
  created_at = self.created_at
68
70
 
@@ -72,11 +74,7 @@ class ModelDeployment:
72
74
 
73
75
  updated_by = self.updated_by
74
76
 
75
- enabled: Union[None, Unset, bool]
76
- if isinstance(self.enabled, Unset):
77
- enabled = UNSET
78
- else:
79
- enabled = self.enabled
77
+ enabled = self.enabled
80
78
 
81
79
  environment = self.environment
82
80
 
@@ -99,37 +97,31 @@ class ModelDeployment:
99
97
  else:
100
98
  labels = self.labels
101
99
 
102
- metric_port: Union[None, Unset, int]
103
- if isinstance(self.metric_port, Unset):
104
- metric_port = UNSET
105
- else:
106
- metric_port = self.metric_port
100
+ metric_port = self.metric_port
107
101
 
108
102
  model = self.model
109
103
 
110
- model_provider_ref = self.model_provider_ref
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()
111
107
 
112
- pod_template: Union[Dict[str, Any], None, Unset]
113
- if isinstance(self.pod_template, Unset):
114
- pod_template = UNSET
115
- elif isinstance(self.pod_template, ModelDeploymentPodTemplateType0):
108
+ pod_template: Union[Unset, Dict[str, Any]] = UNSET
109
+ if not isinstance(self.pod_template, Unset):
116
110
  pod_template = self.pod_template.to_dict()
117
- else:
118
- pod_template = self.pod_template
119
111
 
120
112
  policies: Union[Unset, List[str]] = UNSET
121
113
  if not isinstance(self.policies, Unset):
122
114
  policies = self.policies
123
115
 
124
- runtime = self.runtime
116
+ runtime: Union[Unset, Dict[str, Any]] = UNSET
117
+ if not isinstance(self.runtime, Unset):
118
+ runtime = self.runtime.to_dict()
125
119
 
126
- serverless_config = self.serverless_config
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()
127
123
 
128
- serving_port: Union[None, Unset, int]
129
- if isinstance(self.serving_port, Unset):
130
- serving_port = UNSET
131
- else:
132
- serving_port = self.serving_port
124
+ serving_port = self.serving_port
133
125
 
134
126
  workspace = self.workspace
135
127
 
@@ -177,10 +169,15 @@ class ModelDeployment:
177
169
 
178
170
  @classmethod
179
171
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
172
+ from ..models.deployment_serverless_config import DeploymentServerlessConfig
180
173
  from ..models.flavor import Flavor
181
174
  from ..models.labels_type_0 import LabelsType0
182
- from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
175
+ from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
176
+ from ..models.model_provider_ref import ModelProviderRef
177
+ from ..models.runtime import Runtime
183
178
 
179
+ if not src_dict:
180
+ return None
184
181
  d = src_dict.copy()
185
182
  created_at = d.pop("created_at", UNSET)
186
183
 
@@ -190,14 +187,7 @@ class ModelDeployment:
190
187
 
191
188
  updated_by = d.pop("updated_by", UNSET)
192
189
 
193
- def _parse_enabled(data: object) -> Union[None, Unset, bool]:
194
- if data is None:
195
- return data
196
- if isinstance(data, Unset):
197
- return data
198
- return cast(Union[None, Unset, bool], data)
199
-
200
- enabled = _parse_enabled(d.pop("enabled", UNSET))
190
+ enabled = d.pop("enabled", UNSET)
201
191
 
202
192
  environment = d.pop("environment", UNSET)
203
193
 
@@ -227,50 +217,41 @@ class ModelDeployment:
227
217
 
228
218
  labels = _parse_labels(d.pop("labels", UNSET))
229
219
 
230
- def _parse_metric_port(data: object) -> Union[None, Unset, int]:
231
- if data is None:
232
- return data
233
- if isinstance(data, Unset):
234
- return data
235
- return cast(Union[None, Unset, int], data)
236
-
237
- metric_port = _parse_metric_port(d.pop("metric_port", UNSET))
220
+ metric_port = d.pop("metric_port", UNSET)
238
221
 
239
222
  model = d.pop("model", UNSET)
240
223
 
241
- model_provider_ref = d.pop("model_provider_ref", UNSET)
242
-
243
- def _parse_pod_template(data: object) -> Union["ModelDeploymentPodTemplateType0", None, Unset]:
244
- if data is None:
245
- return data
246
- if isinstance(data, Unset):
247
- return data
248
- try:
249
- if not isinstance(data, dict):
250
- raise TypeError()
251
- pod_template_type_0 = ModelDeploymentPodTemplateType0.from_dict(data)
252
-
253
- return pod_template_type_0
254
- except: # noqa: E722
255
- pass
256
- return cast(Union["ModelDeploymentPodTemplateType0", None, Unset], data)
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)
257
230
 
258
- pod_template = _parse_pod_template(d.pop("pod_template", UNSET))
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)
259
237
 
260
238
  policies = cast(List[str], d.pop("policies", UNSET))
261
239
 
262
- runtime = d.pop("runtime", UNSET)
263
-
264
- serverless_config = d.pop("serverless_config", UNSET)
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)
265
246
 
266
- def _parse_serving_port(data: object) -> Union[None, Unset, int]:
267
- if data is None:
268
- return data
269
- if isinstance(data, Unset):
270
- return data
271
- return cast(Union[None, Unset, int], data)
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)
272
253
 
273
- serving_port = _parse_serving_port(d.pop("serving_port", UNSET))
254
+ serving_port = d.pop("serving_port", UNSET)
274
255
 
275
256
  workspace = d.pop("workspace", UNSET)
276
257
 
@@ -38,6 +38,8 @@ class ModelDeploymentLog:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  message = d.pop("message", UNSET)
43
45
 
@@ -99,6 +99,8 @@ class ModelDeploymentMetrics:
99
99
  )
100
100
  from ..models.qps import QPS
101
101
 
102
+ if not src_dict:
103
+ return None
102
104
  d = src_dict.copy()
103
105
  inference_per_second_global = []
104
106
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -43,6 +43,8 @@ class ModelDeploymentMetricsInferencePerSecondPerRegion:
43
43
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
44
44
  from ..models.metric import Metric
45
45
 
46
+ if not src_dict:
47
+ return None
46
48
  d = src_dict.copy()
47
49
  region = []
48
50
  _region = d.pop("region", UNSET)
@@ -41,6 +41,8 @@ class ModelDeploymentMetricsQueryPerSecondPerRegionPerCode:
41
41
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
42
42
  from ..models.qps import QPS
43
43
 
44
+ if not src_dict:
45
+ return None
44
46
  d = src_dict.copy()
45
47
  _region = d.pop("region", UNSET)
46
48
  region: Union[Unset, QPS]
@@ -0,0 +1,45 @@
1
+ from typing import Any, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="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
@@ -0,0 +1,144 @@
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.metadata_labels import MetadataLabels
10
+
11
+
12
+ T = TypeVar("T", bound="ModelMetadata")
13
+
14
+
15
+ @_attrs_define
16
+ class ModelMetadata:
17
+ """Model metadata
18
+
19
+ Attributes:
20
+ created_at (Union[Unset, str]): The date and time when the resource was created
21
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
22
+ created_by (Union[Unset, str]): The user or service account who created the resource
23
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
24
+ display_name (Union[Unset, str]): Model display name
25
+ labels (Union[Unset, MetadataLabels]): Labels
26
+ name (Union[Unset, str]): Model name
27
+ workspace (Union[Unset, str]): Workspace name
28
+ environment (Union[Unset, str]): Environment name
29
+ """
30
+
31
+ created_at: Union[Unset, str] = UNSET
32
+ updated_at: Union[Unset, str] = UNSET
33
+ created_by: Union[Unset, str] = UNSET
34
+ updated_by: Union[Unset, str] = UNSET
35
+ display_name: Union[Unset, str] = UNSET
36
+ labels: Union[Unset, "MetadataLabels"] = UNSET
37
+ name: Union[Unset, str] = UNSET
38
+ workspace: Union[Unset, str] = UNSET
39
+ environment: Union[Unset, str] = UNSET
40
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ created_at = self.created_at
44
+
45
+ updated_at = self.updated_at
46
+
47
+ created_by = self.created_by
48
+
49
+ updated_by = self.updated_by
50
+
51
+ display_name = self.display_name
52
+
53
+ labels: Union[Unset, Dict[str, Any]] = UNSET
54
+ if not isinstance(self.labels, Unset):
55
+ labels = self.labels.to_dict()
56
+
57
+ name = self.name
58
+
59
+ workspace = self.workspace
60
+
61
+ environment = self.environment
62
+
63
+ field_dict: dict[str, Any] = {}
64
+ field_dict.update(self.additional_properties)
65
+ field_dict.update({})
66
+ if created_at is not UNSET:
67
+ field_dict["createdAt"] = created_at
68
+ if updated_at is not UNSET:
69
+ field_dict["updatedAt"] = updated_at
70
+ if created_by is not UNSET:
71
+ field_dict["createdBy"] = created_by
72
+ if updated_by is not UNSET:
73
+ field_dict["updatedBy"] = updated_by
74
+ if display_name is not UNSET:
75
+ field_dict["displayName"] = display_name
76
+ if labels is not UNSET:
77
+ field_dict["labels"] = labels
78
+ if name is not UNSET:
79
+ field_dict["name"] = name
80
+ if workspace is not UNSET:
81
+ field_dict["workspace"] = workspace
82
+ if environment is not UNSET:
83
+ field_dict["environment"] = environment
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
89
+ from ..models.metadata_labels import MetadataLabels
90
+
91
+ d = src_dict.copy()
92
+ created_at = d.pop("createdAt", UNSET)
93
+
94
+ updated_at = d.pop("updatedAt", UNSET)
95
+
96
+ created_by = d.pop("createdBy", UNSET)
97
+
98
+ updated_by = d.pop("updatedBy", UNSET)
99
+
100
+ display_name = d.pop("displayName", UNSET)
101
+
102
+ _labels = d.pop("labels", UNSET)
103
+ labels: Union[Unset, MetadataLabels]
104
+ if isinstance(_labels, Unset):
105
+ labels = UNSET
106
+ else:
107
+ labels = MetadataLabels.from_dict(_labels)
108
+
109
+ name = d.pop("name", UNSET)
110
+
111
+ workspace = d.pop("workspace", UNSET)
112
+
113
+ environment = d.pop("environment", UNSET)
114
+
115
+ model_metadata = cls(
116
+ created_at=created_at,
117
+ updated_at=updated_at,
118
+ created_by=created_by,
119
+ updated_by=updated_by,
120
+ display_name=display_name,
121
+ labels=labels,
122
+ name=name,
123
+ workspace=workspace,
124
+ environment=environment,
125
+ )
126
+
127
+ model_metadata.additional_properties = d
128
+ return model_metadata
129
+
130
+ @property
131
+ def additional_keys(self) -> list[str]:
132
+ return list(self.additional_properties.keys())
133
+
134
+ def __getitem__(self, key: str) -> Any:
135
+ return self.additional_properties[key]
136
+
137
+ def __setitem__(self, key: str, value: Any) -> None:
138
+ self.additional_properties[key] = value
139
+
140
+ def __delitem__(self, key: str) -> None:
141
+ del self.additional_properties[key]
142
+
143
+ def __contains__(self, key: str) -> bool:
144
+ return key in self.additional_properties
@@ -54,6 +54,8 @@ class ModelMetrics:
54
54
  from ..models.metric import Metric
55
55
  from ..models.qps import QPS
56
56
 
57
+ if not src_dict:
58
+ return None
57
59
  d = src_dict.copy()
58
60
  inference_per_second_global = []
59
61
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -110,6 +110,8 @@ class ModelProvider:
110
110
  from ..models.labels_type_0 import LabelsType0
111
111
  from ..models.provider_config import ProviderConfig
112
112
 
113
+ if not src_dict:
114
+ return None
113
115
  d = src_dict.copy()
114
116
  created_at = d.pop("created_at", UNSET)
115
117
 
@@ -38,6 +38,8 @@ class ModelProviderRef:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  kind = d.pop("kind", UNSET)
43
45
 
@@ -38,6 +38,8 @@ class ModelRelease:
38
38
 
39
39
  @classmethod
40
40
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  from_ = d.pop("from", UNSET)
43
45