beamlit 0.0.19__py3-none-any.whl → 0.0.20rc2__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.20rc2.dist-info}/METADATA +5 -2
  68. {beamlit-0.0.19.dist-info → beamlit-0.0.20rc2.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.20rc2.dist-info}/WHEEL +0 -0
@@ -0,0 +1,59 @@
1
+ from typing import Any, 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
+ T = TypeVar("T", bound="IntegrationSecret")
9
+
10
+
11
+ @_attrs_define
12
+ class IntegrationSecret:
13
+ """Integration secret
14
+
15
+ Attributes:
16
+ api_key (Union[Unset, str]): The API key to use for the integration
17
+ """
18
+
19
+ api_key: Union[Unset, str] = UNSET
20
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
+
22
+ def to_dict(self) -> dict[str, Any]:
23
+ api_key = self.api_key
24
+
25
+ field_dict: dict[str, Any] = {}
26
+ field_dict.update(self.additional_properties)
27
+ field_dict.update({})
28
+ if api_key is not UNSET:
29
+ field_dict["api_key"] = api_key
30
+
31
+ return field_dict
32
+
33
+ @classmethod
34
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
35
+ d = src_dict.copy()
36
+ api_key = d.pop("api_key", UNSET)
37
+
38
+ integration_secret = cls(
39
+ api_key=api_key,
40
+ )
41
+
42
+ integration_secret.additional_properties = d
43
+ return integration_secret
44
+
45
+ @property
46
+ def additional_keys(self) -> list[str]:
47
+ return list(self.additional_properties.keys())
48
+
49
+ def __getitem__(self, key: str) -> Any:
50
+ return self.additional_properties[key]
51
+
52
+ def __setitem__(self, key: str, value: Any) -> None:
53
+ self.additional_properties[key] = value
54
+
55
+ def __delitem__(self, key: str) -> None:
56
+ del self.additional_properties[key]
57
+
58
+ def __contains__(self, key: str) -> bool:
59
+ return key in self.additional_properties
beamlit/models/metrics.py CHANGED
@@ -6,6 +6,7 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
+ from ..models.increase_and_rate_metric import IncreaseAndRateMetric
9
10
  from ..models.metric import Metric
10
11
 
11
12
 
@@ -17,24 +18,26 @@ class Metrics:
17
18
  """Metrics for resources
18
19
 
19
20
  Attributes:
20
- agents (Union[Unset, Any]): Metrics for agents
21
- functions (Union[Unset, Any]): Metrics for functions
21
+ inference_global (Union[Unset, Any]): Historical requests for all resources globally
22
22
  inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
23
- models (Union[Unset, Any]): Metrics for models
23
+ query (Union[Unset, Any]): Number of requests for all resources globally
24
24
  query_per_second (Union[Unset, float]): RPS value (in last 24 hours) per location, for all resources globally
25
+ agents (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
26
+ functions (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
27
+ models (Union[Unset, IncreaseAndRateMetric]): Metrics for resources
25
28
  """
26
29
 
27
- agents: Union[Unset, Any] = UNSET
28
- functions: Union[Unset, Any] = UNSET
30
+ inference_global: Union[Unset, Any] = UNSET
29
31
  inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
30
- models: Union[Unset, Any] = UNSET
32
+ query: Union[Unset, Any] = UNSET
31
33
  query_per_second: Union[Unset, float] = UNSET
34
+ agents: Union[Unset, "IncreaseAndRateMetric"] = UNSET
35
+ functions: Union[Unset, "IncreaseAndRateMetric"] = UNSET
36
+ models: Union[Unset, "IncreaseAndRateMetric"] = UNSET
32
37
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
38
 
34
39
  def to_dict(self) -> dict[str, Any]:
35
- agents = self.agents
36
-
37
- functions = self.functions
40
+ inference_global = self.inference_global
38
41
 
39
42
  inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
40
43
  if not isinstance(self.inference_per_second_global, Unset):
@@ -43,34 +46,49 @@ class Metrics:
43
46
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
44
47
  inference_per_second_global.append(componentsschemas_array_metric_item)
45
48
 
46
- models = self.models
49
+ query = self.query
47
50
 
48
51
  query_per_second = self.query_per_second
49
52
 
53
+ agents: Union[Unset, Dict[str, Any]] = UNSET
54
+ if not isinstance(self.agents, Unset):
55
+ agents = self.agents.to_dict()
56
+
57
+ functions: Union[Unset, Dict[str, Any]] = UNSET
58
+ if not isinstance(self.functions, Unset):
59
+ functions = self.functions.to_dict()
60
+
61
+ models: Union[Unset, Dict[str, Any]] = UNSET
62
+ if not isinstance(self.models, Unset):
63
+ models = self.models.to_dict()
64
+
50
65
  field_dict: dict[str, Any] = {}
51
66
  field_dict.update(self.additional_properties)
52
67
  field_dict.update({})
68
+ if inference_global is not UNSET:
69
+ field_dict["inference_global"] = inference_global
70
+ if inference_per_second_global is not UNSET:
71
+ field_dict["inference_per_second_global"] = inference_per_second_global
72
+ if query is not UNSET:
73
+ field_dict["query"] = query
74
+ if query_per_second is not UNSET:
75
+ field_dict["query_per_second"] = query_per_second
53
76
  if agents is not UNSET:
54
77
  field_dict["agents"] = agents
55
78
  if functions is not UNSET:
56
79
  field_dict["functions"] = functions
57
- if inference_per_second_global is not UNSET:
58
- field_dict["inference_per_second_global"] = inference_per_second_global
59
80
  if models is not UNSET:
60
81
  field_dict["models"] = models
61
- if query_per_second is not UNSET:
62
- field_dict["query_per_second"] = query_per_second
63
82
 
64
83
  return field_dict
65
84
 
66
85
  @classmethod
67
86
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
87
+ from ..models.increase_and_rate_metric import IncreaseAndRateMetric
68
88
  from ..models.metric import Metric
69
89
 
70
90
  d = src_dict.copy()
71
- agents = d.pop("agents", UNSET)
72
-
73
- functions = d.pop("functions", UNSET)
91
+ inference_global = d.pop("inference_global", UNSET)
74
92
 
75
93
  inference_per_second_global = []
76
94
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -79,16 +97,39 @@ class Metrics:
79
97
 
80
98
  inference_per_second_global.append(componentsschemas_array_metric_item)
81
99
 
82
- models = d.pop("models", UNSET)
100
+ query = d.pop("query", UNSET)
83
101
 
84
102
  query_per_second = d.pop("query_per_second", UNSET)
85
103
 
104
+ _agents = d.pop("agents", UNSET)
105
+ agents: Union[Unset, IncreaseAndRateMetric]
106
+ if isinstance(_agents, Unset):
107
+ agents = UNSET
108
+ else:
109
+ agents = IncreaseAndRateMetric.from_dict(_agents)
110
+
111
+ _functions = d.pop("functions", UNSET)
112
+ functions: Union[Unset, IncreaseAndRateMetric]
113
+ if isinstance(_functions, Unset):
114
+ functions = UNSET
115
+ else:
116
+ functions = IncreaseAndRateMetric.from_dict(_functions)
117
+
118
+ _models = d.pop("models", UNSET)
119
+ models: Union[Unset, IncreaseAndRateMetric]
120
+ if isinstance(_models, Unset):
121
+ models = UNSET
122
+ else:
123
+ models = IncreaseAndRateMetric.from_dict(_models)
124
+
86
125
  metrics = cls(
126
+ inference_global=inference_global,
127
+ inference_per_second_global=inference_per_second_global,
128
+ query=query,
129
+ query_per_second=query_per_second,
87
130
  agents=agents,
88
131
  functions=functions,
89
- inference_per_second_global=inference_per_second_global,
90
132
  models=models,
91
- query_per_second=query_per_second,
92
133
  )
93
134
 
94
135
  metrics.additional_properties = d
@@ -6,12 +6,9 @@ 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
10
9
  from ..models.flavor import Flavor
11
10
  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
11
+ from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
15
12
 
16
13
 
17
14
  T = TypeVar("T", bound="ModelDeployment")
@@ -26,19 +23,20 @@ class ModelDeployment:
26
23
  created_by (Union[Unset, str]): The user or service account who created the resource
27
24
  updated_at (Union[Unset, str]): The date and time when the resource was updated
28
25
  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
26
+ enabled (Union[None, Unset, bool]): If false, the model deployment will not be active nor serve requests
30
27
  environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
31
28
  flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
29
+ integration_connections (Union[Unset, List[str]]):
32
30
  labels (Union['LabelsType0', None, Unset]): Labels
33
- metric_port (Union[Unset, int]): The port to serve the metrics on
31
+ metric_port (Union[None, Unset, int]): The port to serve the metrics on
34
32
  model (Union[Unset, str]): The name of the parent model
35
- model_provider_ref (Union[Unset, ModelProviderRef]): Reference to a model provider
36
- pod_template (Union[Unset, ModelDeploymentPodTemplate]): The pod template for the deployment. Should be a
37
- Kubernetes PodTemplateSpec
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
38
36
  policies (Union[Unset, List[str]]):
39
- runtime (Union[Unset, Runtime]): Set of configurations for a deployment
40
- serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
41
- serving_port (Union[Unset, int]): The port to serve the model on
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
42
40
  workspace (Union[Unset, str]): The workspace the model deployment belongs to
43
41
  """
44
42
 
@@ -46,23 +44,25 @@ class ModelDeployment:
46
44
  created_by: Union[Unset, str] = UNSET
47
45
  updated_at: Union[Unset, str] = UNSET
48
46
  updated_by: Union[Unset, str] = UNSET
49
- enabled: Union[Unset, bool] = UNSET
47
+ enabled: Union[None, Unset, bool] = UNSET
50
48
  environment: Union[Unset, str] = UNSET
51
49
  flavors: Union[Unset, List["Flavor"]] = UNSET
50
+ integration_connections: Union[Unset, List[str]] = UNSET
52
51
  labels: Union["LabelsType0", None, Unset] = UNSET
53
- metric_port: Union[Unset, int] = UNSET
52
+ metric_port: Union[None, Unset, int] = UNSET
54
53
  model: Union[Unset, str] = UNSET
55
- model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
56
- pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
54
+ model_provider_ref: Union[Unset, Any] = UNSET
55
+ pod_template: Union["ModelDeploymentPodTemplateType0", None, Unset] = UNSET
57
56
  policies: Union[Unset, List[str]] = UNSET
58
- runtime: Union[Unset, "Runtime"] = UNSET
59
- serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
60
- serving_port: Union[Unset, int] = UNSET
57
+ runtime: Union[Unset, Any] = UNSET
58
+ serverless_config: Union[Unset, Any] = UNSET
59
+ serving_port: Union[None, Unset, int] = UNSET
61
60
  workspace: Union[Unset, str] = UNSET
62
61
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
63
62
 
64
63
  def to_dict(self) -> dict[str, Any]:
65
64
  from ..models.labels_type_0 import LabelsType0
65
+ from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
66
66
 
67
67
  created_at = self.created_at
68
68
 
@@ -72,7 +72,11 @@ class ModelDeployment:
72
72
 
73
73
  updated_by = self.updated_by
74
74
 
75
- enabled = self.enabled
75
+ enabled: Union[None, Unset, bool]
76
+ if isinstance(self.enabled, Unset):
77
+ enabled = UNSET
78
+ else:
79
+ enabled = self.enabled
76
80
 
77
81
  environment = self.environment
78
82
 
@@ -83,6 +87,10 @@ class ModelDeployment:
83
87
  componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
84
88
  flavors.append(componentsschemas_flavors_item)
85
89
 
90
+ integration_connections: Union[Unset, List[str]] = UNSET
91
+ if not isinstance(self.integration_connections, Unset):
92
+ integration_connections = self.integration_connections
93
+
86
94
  labels: Union[Dict[str, Any], None, Unset]
87
95
  if isinstance(self.labels, Unset):
88
96
  labels = UNSET
@@ -91,31 +99,37 @@ class ModelDeployment:
91
99
  else:
92
100
  labels = self.labels
93
101
 
94
- metric_port = self.metric_port
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
95
107
 
96
108
  model = self.model
97
109
 
98
- model_provider_ref: Union[Unset, Dict[str, Any]] = UNSET
99
- if not isinstance(self.model_provider_ref, Unset):
100
- model_provider_ref = self.model_provider_ref.to_dict()
110
+ model_provider_ref = self.model_provider_ref
101
111
 
102
- pod_template: Union[Unset, Dict[str, Any]] = UNSET
103
- if not isinstance(self.pod_template, Unset):
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):
104
116
  pod_template = self.pod_template.to_dict()
117
+ else:
118
+ pod_template = self.pod_template
105
119
 
106
120
  policies: Union[Unset, List[str]] = UNSET
107
121
  if not isinstance(self.policies, Unset):
108
122
  policies = self.policies
109
123
 
110
- runtime: Union[Unset, Dict[str, Any]] = UNSET
111
- if not isinstance(self.runtime, Unset):
112
- runtime = self.runtime.to_dict()
124
+ runtime = self.runtime
113
125
 
114
- serverless_config: Union[Unset, Dict[str, Any]] = UNSET
115
- if not isinstance(self.serverless_config, Unset):
116
- serverless_config = self.serverless_config.to_dict()
126
+ serverless_config = self.serverless_config
117
127
 
118
- serving_port = self.serving_port
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
119
133
 
120
134
  workspace = self.workspace
121
135
 
@@ -136,6 +150,8 @@ class ModelDeployment:
136
150
  field_dict["environment"] = environment
137
151
  if flavors is not UNSET:
138
152
  field_dict["flavors"] = flavors
153
+ if integration_connections is not UNSET:
154
+ field_dict["integration_connections"] = integration_connections
139
155
  if labels is not UNSET:
140
156
  field_dict["labels"] = labels
141
157
  if metric_port is not UNSET:
@@ -161,12 +177,9 @@ class ModelDeployment:
161
177
 
162
178
  @classmethod
163
179
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
164
- from ..models.deployment_serverless_config import DeploymentServerlessConfig
165
180
  from ..models.flavor import Flavor
166
181
  from ..models.labels_type_0 import LabelsType0
167
- from ..models.model_deployment_pod_template import ModelDeploymentPodTemplate
168
- from ..models.model_provider_ref import ModelProviderRef
169
- from ..models.runtime import Runtime
182
+ from ..models.model_deployment_pod_template_type_0 import ModelDeploymentPodTemplateType0
170
183
 
171
184
  d = src_dict.copy()
172
185
  created_at = d.pop("created_at", UNSET)
@@ -177,7 +190,14 @@ class ModelDeployment:
177
190
 
178
191
  updated_by = d.pop("updated_by", UNSET)
179
192
 
180
- enabled = d.pop("enabled", UNSET)
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))
181
201
 
182
202
  environment = d.pop("environment", UNSET)
183
203
 
@@ -188,6 +208,8 @@ class ModelDeployment:
188
208
 
189
209
  flavors.append(componentsschemas_flavors_item)
190
210
 
211
+ integration_connections = cast(List[str], d.pop("integration_connections", UNSET))
212
+
191
213
  def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
192
214
  if data is None:
193
215
  return data
@@ -205,41 +227,50 @@ class ModelDeployment:
205
227
 
206
228
  labels = _parse_labels(d.pop("labels", UNSET))
207
229
 
208
- metric_port = d.pop("metric_port", UNSET)
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))
209
238
 
210
239
  model = d.pop("model", UNSET)
211
240
 
212
- _model_provider_ref = d.pop("model_provider_ref", UNSET)
213
- model_provider_ref: Union[Unset, ModelProviderRef]
214
- if isinstance(_model_provider_ref, Unset):
215
- model_provider_ref = UNSET
216
- else:
217
- model_provider_ref = ModelProviderRef.from_dict(_model_provider_ref)
241
+ model_provider_ref = d.pop("model_provider_ref", UNSET)
218
242
 
219
- _pod_template = d.pop("pod_template", UNSET)
220
- pod_template: Union[Unset, ModelDeploymentPodTemplate]
221
- if isinstance(_pod_template, Unset):
222
- pod_template = UNSET
223
- else:
224
- pod_template = ModelDeploymentPodTemplate.from_dict(_pod_template)
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)
257
+
258
+ pod_template = _parse_pod_template(d.pop("pod_template", UNSET))
225
259
 
226
260
  policies = cast(List[str], d.pop("policies", UNSET))
227
261
 
228
- _runtime = d.pop("runtime", UNSET)
229
- runtime: Union[Unset, Runtime]
230
- if isinstance(_runtime, Unset):
231
- runtime = UNSET
232
- else:
233
- runtime = Runtime.from_dict(_runtime)
262
+ runtime = d.pop("runtime", UNSET)
234
263
 
235
- _serverless_config = d.pop("serverless_config", UNSET)
236
- serverless_config: Union[Unset, DeploymentServerlessConfig]
237
- if isinstance(_serverless_config, Unset):
238
- serverless_config = UNSET
239
- else:
240
- serverless_config = DeploymentServerlessConfig.from_dict(_serverless_config)
264
+ serverless_config = d.pop("serverless_config", UNSET)
265
+
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)
241
272
 
242
- serving_port = d.pop("serving_port", UNSET)
273
+ serving_port = _parse_serving_port(d.pop("serving_port", UNSET))
243
274
 
244
275
  workspace = d.pop("workspace", UNSET)
245
276
 
@@ -251,6 +282,7 @@ class ModelDeployment:
251
282
  enabled=enabled,
252
283
  environment=environment,
253
284
  flavors=flavors,
285
+ integration_connections=integration_connections,
254
286
  labels=labels,
255
287
  metric_port=metric_port,
256
288
  model=model,
@@ -3,11 +3,11 @@ from typing import Any, Type, TypeVar
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- T = TypeVar("T", bound="ModelDeploymentPodTemplate")
6
+ T = TypeVar("T", bound="ModelDeploymentPodTemplateType0")
7
7
 
8
8
 
9
9
  @_attrs_define
10
- class ModelDeploymentPodTemplate:
10
+ class ModelDeploymentPodTemplateType0:
11
11
  """The pod template for the deployment. Should be a Kubernetes PodTemplateSpec"""
12
12
 
13
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -21,10 +21,10 @@ class ModelDeploymentPodTemplate:
21
21
  @classmethod
22
22
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
23
  d = src_dict.copy()
24
- model_deployment_pod_template = cls()
24
+ model_deployment_pod_template_type_0 = cls()
25
25
 
26
- model_deployment_pod_template.additional_properties = d
27
- return model_deployment_pod_template
26
+ model_deployment_pod_template_type_0.additional_properties = d
27
+ return model_deployment_pod_template_type_0
28
28
 
29
29
  @property
30
30
  def additional_keys(self) -> list[str]:
beamlit/models/policy.py CHANGED
@@ -6,9 +6,7 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
- from ..models.flavor import Flavor
10
9
  from ..models.labels_type_0 import LabelsType0
11
- from ..models.policy_location import PolicyLocation
12
10
 
13
11
 
14
12
  T = TypeVar("T", bound="Policy")
@@ -24,9 +22,9 @@ class Policy:
24
22
  updated_at (Union[Unset, str]): The date and time when the resource was updated
25
23
  updated_by (Union[Unset, str]): The user or service account who updated the resource
26
24
  display_name (Union[Unset, str]): Policy display name
27
- flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
25
+ flavors (Union[Unset, Any]): Flavors allowed by the policy. If not set, all flavors are allowed.
28
26
  labels (Union['LabelsType0', None, Unset]): Labels
29
- locations (Union[Unset, List['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
27
+ locations (Union[Unset, Any]): Locations allowed by the policy. If not set, all locations are allowed.
30
28
  name (Union[Unset, str]): Policy name
31
29
  resource_types (Union[Unset, List[str]]): PolicyResourceTypes is a local type that wraps a slice of
32
30
  PolicyResourceType
@@ -39,9 +37,9 @@ class Policy:
39
37
  updated_at: Union[Unset, str] = UNSET
40
38
  updated_by: Union[Unset, str] = UNSET
41
39
  display_name: Union[Unset, str] = UNSET
42
- flavors: Union[Unset, List["Flavor"]] = UNSET
40
+ flavors: Union[Unset, Any] = UNSET
43
41
  labels: Union["LabelsType0", None, Unset] = UNSET
44
- locations: Union[Unset, List["PolicyLocation"]] = UNSET
42
+ locations: Union[Unset, Any] = UNSET
45
43
  name: Union[Unset, str] = UNSET
46
44
  resource_types: Union[Unset, List[str]] = UNSET
47
45
  type: Union[Unset, str] = UNSET
@@ -61,12 +59,7 @@ class Policy:
61
59
 
62
60
  display_name = self.display_name
63
61
 
64
- flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
65
- if not isinstance(self.flavors, Unset):
66
- flavors = []
67
- for componentsschemas_flavors_item_data in self.flavors:
68
- componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
69
- flavors.append(componentsschemas_flavors_item)
62
+ flavors = self.flavors
70
63
 
71
64
  labels: Union[Dict[str, Any], None, Unset]
72
65
  if isinstance(self.labels, Unset):
@@ -76,12 +69,7 @@ class Policy:
76
69
  else:
77
70
  labels = self.labels
78
71
 
79
- locations: Union[Unset, List[Dict[str, Any]]] = UNSET
80
- if not isinstance(self.locations, Unset):
81
- locations = []
82
- for componentsschemas_policy_locations_item_data in self.locations:
83
- componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
84
- locations.append(componentsschemas_policy_locations_item)
72
+ locations = self.locations
85
73
 
86
74
  name = self.name
87
75
 
@@ -125,9 +113,7 @@ class Policy:
125
113
 
126
114
  @classmethod
127
115
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
128
- from ..models.flavor import Flavor
129
116
  from ..models.labels_type_0 import LabelsType0
130
- from ..models.policy_location import PolicyLocation
131
117
 
132
118
  d = src_dict.copy()
133
119
  created_at = d.pop("created_at", UNSET)
@@ -140,12 +126,7 @@ class Policy:
140
126
 
141
127
  display_name = d.pop("display_name", UNSET)
142
128
 
143
- flavors = []
144
- _flavors = d.pop("flavors", UNSET)
145
- for componentsschemas_flavors_item_data in _flavors or []:
146
- componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
147
-
148
- flavors.append(componentsschemas_flavors_item)
129
+ flavors = d.pop("flavors", UNSET)
149
130
 
150
131
  def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
151
132
  if data is None:
@@ -164,14 +145,7 @@ class Policy:
164
145
 
165
146
  labels = _parse_labels(d.pop("labels", UNSET))
166
147
 
167
- locations = []
168
- _locations = d.pop("locations", UNSET)
169
- for componentsschemas_policy_locations_item_data in _locations or []:
170
- componentsschemas_policy_locations_item = PolicyLocation.from_dict(
171
- componentsschemas_policy_locations_item_data
172
- )
173
-
174
- locations.append(componentsschemas_policy_locations_item)
148
+ locations = d.pop("locations", UNSET)
175
149
 
176
150
  name = d.pop("name", UNSET)
177
151
 
@@ -17,21 +17,17 @@ class ProviderConfig:
17
17
  """Model provider config
18
18
 
19
19
  Attributes:
20
- access_token (Union[Unset, str]): The access token to use for the provider
21
20
  filename (Union[Unset, str]): The file name to use for the model
22
21
  presigned_url (Union[Unset, List[Any]]): The presigned URLs to upload the model to
23
22
  runtime (Union[Unset, Runtime]): Set of configurations for a deployment
24
23
  """
25
24
 
26
- access_token: Union[Unset, str] = UNSET
27
25
  filename: Union[Unset, str] = UNSET
28
26
  presigned_url: Union[Unset, List[Any]] = UNSET
29
27
  runtime: Union[Unset, "Runtime"] = UNSET
30
28
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
29
 
32
30
  def to_dict(self) -> dict[str, Any]:
33
- access_token = self.access_token
34
-
35
31
  filename = self.filename
36
32
 
37
33
  presigned_url: Union[Unset, List[Any]] = UNSET
@@ -45,8 +41,6 @@ class ProviderConfig:
45
41
  field_dict: dict[str, Any] = {}
46
42
  field_dict.update(self.additional_properties)
47
43
  field_dict.update({})
48
- if access_token is not UNSET:
49
- field_dict["access_token"] = access_token
50
44
  if filename is not UNSET:
51
45
  field_dict["filename"] = filename
52
46
  if presigned_url is not UNSET:
@@ -61,8 +55,6 @@ class ProviderConfig:
61
55
  from ..models.runtime import Runtime
62
56
 
63
57
  d = src_dict.copy()
64
- access_token = d.pop("access_token", UNSET)
65
-
66
58
  filename = d.pop("filename", UNSET)
67
59
 
68
60
  presigned_url = cast(List[Any], d.pop("presigned_url", UNSET))
@@ -75,7 +67,6 @@ class ProviderConfig:
75
67
  runtime = Runtime.from_dict(_runtime)
76
68
 
77
69
  provider_config = cls(
78
- access_token=access_token,
79
70
  filename=filename,
80
71
  presigned_url=presigned_url,
81
72
  runtime=runtime,