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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) 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/authentication/__init__.py +4 -0
  10. beamlit/authentication/apikey.py +6 -0
  11. beamlit/authentication/authentication.py +31 -2
  12. beamlit/authentication/clientcredentials.py +20 -9
  13. beamlit/authentication/credentials.py +1 -0
  14. beamlit/authentication/device_mode.py +10 -1
  15. beamlit/common/generate.py +8 -3
  16. beamlit/common/logger.py +2 -0
  17. beamlit/common/settings.py +1 -5
  18. beamlit/models/__init__.py +28 -30
  19. beamlit/models/acl.py +2 -0
  20. beamlit/models/agent.py +2 -0
  21. beamlit/models/agent_chain.py +2 -0
  22. beamlit/models/agent_configuration.py +2 -0
  23. beamlit/models/agent_deployment.py +44 -99
  24. beamlit/models/agent_deployment_configuration.py +45 -0
  25. beamlit/models/agent_deployment_history.py +15 -46
  26. beamlit/models/agent_deployment_history_event.py +24 -78
  27. beamlit/models/agent_deployment_pod_template.py +45 -0
  28. beamlit/models/agent_history.py +165 -0
  29. beamlit/models/agent_history_event.py +131 -0
  30. beamlit/models/agent_metadata.py +144 -0
  31. beamlit/models/agent_release.py +2 -0
  32. beamlit/models/agent_spec.py +238 -0
  33. beamlit/models/agent_with_deployments.py +2 -0
  34. beamlit/models/api_key.py +2 -0
  35. beamlit/models/authentication_provider_model.py +2 -0
  36. beamlit/models/authentication_provider_organization.py +2 -0
  37. beamlit/models/configuration.py +2 -0
  38. beamlit/models/continent.py +2 -0
  39. beamlit/models/core_spec.py +179 -0
  40. beamlit/models/country.py +2 -0
  41. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  42. beamlit/models/create_workspace_service_account_body.py +2 -0
  43. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  44. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  45. beamlit/models/deployment_configuration.py +2 -0
  46. beamlit/models/deployment_configurations.py +2 -0
  47. beamlit/models/deployment_serverless_config.py +131 -0
  48. beamlit/models/environment.py +2 -0
  49. beamlit/models/environment_metrics.py +2 -0
  50. beamlit/models/environment_spec.py +61 -0
  51. beamlit/models/flavor.py +2 -0
  52. beamlit/models/function.py +2 -0
  53. beamlit/models/function_configuration.py +2 -0
  54. beamlit/models/function_deployment.py +44 -99
  55. beamlit/models/function_deployment_configuration.py +45 -0
  56. beamlit/models/function_deployment_pod_template.py +45 -0
  57. beamlit/models/function_kit.py +2 -0
  58. beamlit/models/function_metadata.py +144 -0
  59. beamlit/models/function_provider_ref.py +2 -0
  60. beamlit/models/function_release.py +2 -0
  61. beamlit/models/function_spec.py +240 -0
  62. beamlit/models/function_with_deployments.py +2 -0
  63. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  64. beamlit/models/increase_and_rate_metric.py +2 -0
  65. beamlit/models/integration.py +2 -0
  66. beamlit/models/integration_config.py +2 -0
  67. beamlit/models/integration_connection.py +2 -0
  68. beamlit/models/integration_connection_config.py +2 -0
  69. beamlit/models/integration_connection_secret.py +2 -0
  70. beamlit/models/integration_connection_spec.py +99 -0
  71. beamlit/models/integration_model.py +2 -0
  72. beamlit/models/integration_secret.py +2 -0
  73. beamlit/models/invite_workspace_user_body.py +2 -0
  74. beamlit/models/labels_type_0.py +2 -0
  75. beamlit/models/location.py +2 -0
  76. beamlit/models/location_response.py +2 -0
  77. beamlit/models/metadata.py +135 -0
  78. beamlit/models/metadata_labels.py +43 -0
  79. beamlit/models/metric.py +2 -0
  80. beamlit/models/metrics.py +2 -0
  81. beamlit/models/model.py +2 -0
  82. beamlit/models/model_deployment.py +66 -85
  83. beamlit/models/model_deployment_log.py +2 -0
  84. beamlit/models/model_deployment_metrics.py +2 -0
  85. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  86. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  87. beamlit/models/model_deployment_pod_template.py +45 -0
  88. beamlit/models/model_metadata.py +144 -0
  89. beamlit/models/model_metrics.py +2 -0
  90. beamlit/models/model_provider.py +2 -0
  91. beamlit/models/model_provider_ref.py +2 -0
  92. beamlit/models/model_release.py +2 -0
  93. beamlit/models/model_spec.py +188 -0
  94. beamlit/models/model_with_deployments.py +2 -0
  95. beamlit/models/owner_fields.py +68 -0
  96. beamlit/models/pending_invitation.py +2 -0
  97. beamlit/models/pending_invitation_accept.py +2 -0
  98. beamlit/models/pending_invitation_render.py +2 -0
  99. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  100. beamlit/models/pending_invitation_render_workspace.py +2 -0
  101. beamlit/models/pending_invitation_workspace_details.py +2 -0
  102. beamlit/models/pod_template_spec.py +43 -0
  103. beamlit/models/policy.py +36 -8
  104. beamlit/models/policy_location.py +2 -0
  105. beamlit/models/policy_spec.py +119 -0
  106. beamlit/models/provider_config.py +2 -0
  107. beamlit/models/qps.py +2 -0
  108. beamlit/models/resource_deployment_log.py +2 -0
  109. beamlit/models/resource_deployment_metrics.py +70 -155
  110. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  111. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  112. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  113. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  114. beamlit/models/resource_environment_metrics.py +172 -0
  115. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  116. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  117. beamlit/models/resource_log.py +68 -0
  118. beamlit/models/resource_metrics.py +2 -0
  119. beamlit/models/runtime.py +14 -29
  120. beamlit/models/runtime_readiness_probe.py +45 -0
  121. beamlit/models/runtime_resources.py +2 -0
  122. beamlit/models/runtime_type_0.py +111 -0
  123. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  124. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  125. beamlit/models/runtime_type_0_resources.py +59 -0
  126. beamlit/models/serverless_config.py +2 -0
  127. beamlit/models/spec_configuration.py +68 -0
  128. beamlit/models/standard_fields_dynamo_db.py +2 -0
  129. beamlit/models/store_agent.py +15 -29
  130. beamlit/models/store_agent_configuration.py +2 -0
  131. beamlit/models/store_agent_labels.py +45 -0
  132. beamlit/models/store_configuration.py +6 -15
  133. beamlit/models/store_configuration_option.py +7 -18
  134. beamlit/models/store_function.py +15 -29
  135. beamlit/models/store_function_configuration.py +2 -0
  136. beamlit/models/store_function_kit.py +2 -0
  137. beamlit/models/store_function_labels.py +45 -0
  138. beamlit/models/store_function_parameter.py +2 -0
  139. beamlit/models/time_fields.py +68 -0
  140. beamlit/models/update_workspace_service_account_body.py +2 -0
  141. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  142. beamlit/models/update_workspace_user_role_body.py +2 -0
  143. beamlit/models/websocket_channel.py +86 -0
  144. beamlit/models/workspace.py +2 -0
  145. beamlit/models/workspace_labels.py +2 -0
  146. beamlit/models/workspace_user.py +2 -0
  147. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/METADATA +1 -1
  148. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/RECORD +149 -102
  149. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,135 @@
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="Metadata")
13
+
14
+
15
+ @_attrs_define
16
+ class Metadata:
17
+ """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
+ """
29
+
30
+ created_at: Union[Unset, str] = UNSET
31
+ updated_at: Union[Unset, str] = UNSET
32
+ created_by: Union[Unset, str] = UNSET
33
+ updated_by: Union[Unset, str] = UNSET
34
+ display_name: Union[Unset, str] = UNSET
35
+ labels: Union[Unset, "MetadataLabels"] = UNSET
36
+ name: Union[Unset, str] = UNSET
37
+ workspace: Union[Unset, str] = UNSET
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ created_at = self.created_at
42
+
43
+ updated_at = self.updated_at
44
+
45
+ created_by = self.created_by
46
+
47
+ updated_by = self.updated_by
48
+
49
+ display_name = self.display_name
50
+
51
+ labels: Union[Unset, Dict[str, Any]] = UNSET
52
+ if not isinstance(self.labels, Unset):
53
+ labels = self.labels.to_dict()
54
+
55
+ name = self.name
56
+
57
+ workspace = self.workspace
58
+
59
+ field_dict: dict[str, Any] = {}
60
+ field_dict.update(self.additional_properties)
61
+ field_dict.update({})
62
+ if created_at is not UNSET:
63
+ field_dict["createdAt"] = created_at
64
+ if updated_at is not UNSET:
65
+ field_dict["updatedAt"] = updated_at
66
+ if created_by is not UNSET:
67
+ field_dict["createdBy"] = created_by
68
+ if updated_by is not UNSET:
69
+ field_dict["updatedBy"] = updated_by
70
+ if display_name is not UNSET:
71
+ field_dict["displayName"] = display_name
72
+ if labels is not UNSET:
73
+ field_dict["labels"] = labels
74
+ if name is not UNSET:
75
+ field_dict["name"] = name
76
+ if workspace is not UNSET:
77
+ field_dict["workspace"] = workspace
78
+
79
+ return field_dict
80
+
81
+ @classmethod
82
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
83
+ from ..models.metadata_labels import MetadataLabels
84
+
85
+ d = src_dict.copy()
86
+ created_at = d.pop("createdAt", UNSET)
87
+
88
+ updated_at = d.pop("updatedAt", UNSET)
89
+
90
+ created_by = d.pop("createdBy", UNSET)
91
+
92
+ updated_by = d.pop("updatedBy", UNSET)
93
+
94
+ display_name = d.pop("displayName", UNSET)
95
+
96
+ _labels = d.pop("labels", UNSET)
97
+ labels: Union[Unset, MetadataLabels]
98
+ if isinstance(_labels, Unset):
99
+ labels = UNSET
100
+ else:
101
+ labels = MetadataLabels.from_dict(_labels)
102
+
103
+ name = d.pop("name", UNSET)
104
+
105
+ workspace = d.pop("workspace", UNSET)
106
+
107
+ metadata = cls(
108
+ created_at=created_at,
109
+ updated_at=updated_at,
110
+ created_by=created_by,
111
+ updated_by=updated_by,
112
+ display_name=display_name,
113
+ labels=labels,
114
+ name=name,
115
+ workspace=workspace,
116
+ )
117
+
118
+ metadata.additional_properties = d
119
+ return metadata
120
+
121
+ @property
122
+ def additional_keys(self) -> list[str]:
123
+ return list(self.additional_properties.keys())
124
+
125
+ def __getitem__(self, key: str) -> Any:
126
+ return self.additional_properties[key]
127
+
128
+ def __setitem__(self, key: str, value: Any) -> None:
129
+ self.additional_properties[key] = value
130
+
131
+ def __delitem__(self, key: str) -> None:
132
+ del self.additional_properties[key]
133
+
134
+ def __contains__(self, key: str) -> bool:
135
+ return key in self.additional_properties
@@ -0,0 +1,43 @@
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="MetadataLabels")
7
+
8
+
9
+ @_attrs_define
10
+ class MetadataLabels:
11
+ """Labels"""
12
+
13
+ additional_properties: dict[str, str] = _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
+ d = src_dict.copy()
24
+ metadata_labels = cls()
25
+
26
+ metadata_labels.additional_properties = d
27
+ return metadata_labels
28
+
29
+ @property
30
+ def additional_keys(self) -> list[str]:
31
+ return list(self.additional_properties.keys())
32
+
33
+ def __getitem__(self, key: str) -> str:
34
+ return self.additional_properties[key]
35
+
36
+ def __setitem__(self, key: str, value: str) -> None:
37
+ self.additional_properties[key] = value
38
+
39
+ def __delitem__(self, key: str) -> None:
40
+ del self.additional_properties[key]
41
+
42
+ def __contains__(self, key: str) -> bool:
43
+ return key in self.additional_properties
beamlit/models/metric.py CHANGED
@@ -38,6 +38,8 @@ class Metric:
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
  timestamp = d.pop("timestamp", UNSET)
43
45
 
beamlit/models/metrics.py CHANGED
@@ -87,6 +87,8 @@ class Metrics:
87
87
  from ..models.increase_and_rate_metric import IncreaseAndRateMetric
88
88
  from ..models.metric import Metric
89
89
 
90
+ if not src_dict:
91
+ return None
90
92
  d = src_dict.copy()
91
93
  inference_global = d.pop("inference_global", UNSET)
92
94
 
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