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.
- beamlit/agents/chat.py +37 -11
- beamlit/agents/decorator.py +97 -65
- beamlit/api/agents/create_agent.py +9 -14
- beamlit/api/agents/delete_agent.py +22 -1
- beamlit/api/agents/delete_agent_history.py +2 -6
- beamlit/api/agents/get_agent.py +22 -1
- beamlit/api/agents/get_agent_environment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +2 -6
- beamlit/api/agents/get_agent_metrics.py +22 -1
- beamlit/api/agents/list_agent_history.py +11 -11
- beamlit/api/agents/list_agents.py +36 -4
- beamlit/api/agents/put_agent_history.py +2 -6
- beamlit/api/agents/update_agent.py +9 -14
- beamlit/api/functions/create_function.py +9 -14
- beamlit/api/functions/delete_function.py +22 -1
- beamlit/api/functions/get_function.py +22 -1
- beamlit/api/functions/get_function_environment_logs.py +11 -11
- beamlit/api/functions/get_function_metrics.py +22 -1
- beamlit/api/functions/list_functions.py +36 -4
- beamlit/api/functions/update_function.py +9 -14
- beamlit/api/history/get_agents_history.py +12 -12
- beamlit/api/history/list_agents_history.py +12 -12
- beamlit/api/integrations/get_integration_connection.py +16 -12
- beamlit/api/integrations/get_integration_connection_model.py +8 -1
- beamlit/api/integrations/get_integration_model.py +8 -1
- beamlit/api/locations/list_locations.py +12 -12
- beamlit/api/models/create_model.py +13 -14
- beamlit/api/models/delete_model.py +22 -1
- beamlit/api/models/get_model.py +22 -1
- beamlit/api/models/get_model_environment_logs.py +11 -11
- beamlit/api/models/get_model_metrics.py +38 -13
- beamlit/api/models/list_models.py +36 -4
- beamlit/api/models/update_model.py +13 -14
- beamlit/api/privateclusters/__init__.py +0 -0
- beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
- beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
- beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
- beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
- beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
- beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
- beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
- beamlit/authentication/device_mode.py +3 -9
- beamlit/common/generate.py +47 -34
- beamlit/common/settings.py +29 -27
- beamlit/deploy/deploy.py +101 -342
- beamlit/deploy/format.py +70 -0
- beamlit/deploy/parser.py +175 -0
- beamlit/functions/decorator.py +17 -14
- beamlit/models/__init__.py +64 -78
- beamlit/models/acl.py +4 -22
- beamlit/models/agent.py +34 -95
- beamlit/models/agent_history.py +7 -5
- beamlit/models/agent_history_event.py +11 -9
- beamlit/models/agent_metadata.py +5 -3
- beamlit/models/agent_spec.py +54 -45
- beamlit/models/api_key.py +14 -14
- beamlit/models/configuration.py +11 -0
- beamlit/models/core_spec.py +45 -32
- beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
- beamlit/models/environment.py +33 -105
- beamlit/models/environment_metadata.py +146 -0
- beamlit/models/environment_spec.py +8 -6
- beamlit/models/function.py +34 -95
- beamlit/models/function_metadata.py +5 -3
- beamlit/models/function_spec.py +53 -40
- beamlit/models/integration_connection.py +31 -137
- beamlit/models/integration_connection_spec.py +6 -4
- beamlit/models/metadata.py +5 -3
- beamlit/models/metadata_labels.py +4 -2
- beamlit/models/model.py +33 -94
- beamlit/models/model_metadata.py +5 -3
- beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
- beamlit/models/model_provider.py +27 -43
- beamlit/models/model_spec.py +45 -32
- beamlit/models/owner_fields.py +4 -2
- beamlit/models/pending_invitation.py +14 -14
- beamlit/models/pod_template_spec.py +4 -2
- beamlit/models/policy.py +33 -159
- beamlit/models/policy_spec.py +24 -28
- beamlit/models/private_cluster.py +183 -0
- beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
- beamlit/models/resource_deployment_metrics.py +0 -108
- beamlit/models/resource_environment_metrics.py +143 -71
- beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
- beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_log.py +4 -2
- beamlit/models/runtime.py +20 -2
- beamlit/models/serverless_config.py +28 -21
- beamlit/models/spec_configuration.py +7 -5
- beamlit/models/store_agent.py +14 -14
- beamlit/models/store_function.py +14 -14
- beamlit/models/time_fields.py +4 -2
- beamlit/models/websocket_channel.py +4 -2
- beamlit/models/workspace.py +23 -14
- beamlit/run.py +0 -1
- beamlit/serve/app.py +1 -0
- beamlit/serve/middlewares/accesslog.py +3 -1
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
- beamlit-0.0.24rc21.dist-info/RECORD +243 -0
- beamlit/api/agents/delete_agent_deployment.py +0 -163
- beamlit/api/agents/delete_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_history.py +0 -172
- beamlit/api/agents/get_agent_deployment_logs.py +0 -164
- beamlit/api/agents/list_agent_deployment_history.py +0 -164
- beamlit/api/agents/put_agent_deployment.py +0 -185
- beamlit/api/agents/put_agent_deployment_history.py +0 -198
- beamlit/api/functions/delete_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment.py +0 -163
- beamlit/api/functions/get_function_deployment_logs.py +0 -164
- beamlit/api/functions/get_function_deployment_metrics.py +0 -159
- beamlit/api/functions/put_function_deployment.py +0 -185
- beamlit/api/models/delete_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment.py +0 -171
- beamlit/api/models/get_model_deployment_logs.py +0 -168
- beamlit/api/models/get_model_deployment_metrics.py +0 -163
- beamlit/api/models/put_model_deployment.py +0 -193
- beamlit/models/agent_configuration.py +0 -70
- beamlit/models/agent_deployment.py +0 -340
- beamlit/models/agent_deployment_configuration.py +0 -45
- beamlit/models/agent_deployment_configuration_type_0.py +0 -43
- beamlit/models/agent_deployment_history.py +0 -185
- beamlit/models/agent_deployment_history_event.py +0 -133
- beamlit/models/agent_deployment_pod_template.py +0 -45
- beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
- beamlit/models/agent_with_deployments.py +0 -176
- beamlit/models/authentication_provider_model.py +0 -144
- beamlit/models/authentication_provider_organization.py +0 -88
- beamlit/models/deployment_configuration.py +0 -70
- beamlit/models/deployment_configurations.py +0 -58
- beamlit/models/deployment_serverless_config.py +0 -131
- beamlit/models/deployment_serverless_config_type_0.py +0 -220
- beamlit/models/function_configuration.py +0 -70
- beamlit/models/function_deployment.py +0 -340
- beamlit/models/function_deployment_configuration.py +0 -45
- beamlit/models/function_deployment_configuration_type_0.py +0 -43
- beamlit/models/function_deployment_pod_template.py +0 -45
- beamlit/models/function_deployment_pod_template_type_0.py +0 -43
- beamlit/models/function_with_deployments.py +0 -176
- beamlit/models/integration.py +0 -198
- beamlit/models/integration_config.py +0 -45
- beamlit/models/integration_secret.py +0 -61
- beamlit/models/labels_type_0.py +0 -45
- beamlit/models/location.py +0 -122
- beamlit/models/model_deployment.py +0 -296
- beamlit/models/model_deployment_log.py +0 -70
- beamlit/models/model_deployment_metrics.py +0 -172
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/model_deployment_pod_template.py +0 -45
- beamlit/models/model_deployment_pod_template_type_0.py +0 -43
- beamlit/models/model_metrics.py +0 -96
- beamlit/models/model_with_deployments.py +0 -176
- beamlit/models/resource_deployment_log.py +0 -70
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
- beamlit/models/runtime_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0.py +0 -111
- beamlit/models/runtime_type_0_readiness_probe.py +0 -43
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
- beamlit/models/runtime_type_0_resources.py +0 -59
- beamlit/models/standard_fields_dynamo_db.py +0 -88
- beamlit/models/store_agent_configuration.py +0 -97
- beamlit/models/store_agent_labels_type_0.py +0 -43
- beamlit/models/store_function_configuration.py +0 -97
- beamlit/models/store_function_labels_type_0.py +0 -43
- beamlit-0.0.24rc19.dist-info/RECORD +0 -303
- {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
beamlit/models/metadata.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -48,7 +48,7 @@ class Metadata:
|
|
48
48
|
|
49
49
|
display_name = self.display_name
|
50
50
|
|
51
|
-
labels: Union[Unset,
|
51
|
+
labels: Union[Unset, dict[str, Any]] = UNSET
|
52
52
|
if not isinstance(self.labels, Unset):
|
53
53
|
labels = self.labels.to_dict()
|
54
54
|
|
@@ -79,9 +79,11 @@ class Metadata:
|
|
79
79
|
return field_dict
|
80
80
|
|
81
81
|
@classmethod
|
82
|
-
def from_dict(cls:
|
82
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
83
83
|
from ..models.metadata_labels import MetadataLabels
|
84
84
|
|
85
|
+
if not src_dict:
|
86
|
+
return None
|
85
87
|
d = src_dict.copy()
|
86
88
|
created_at = d.pop("createdAt", UNSET)
|
87
89
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,9 @@ class MetadataLabels:
|
|
19
19
|
return field_dict
|
20
20
|
|
21
21
|
@classmethod
|
22
|
-
def from_dict(cls:
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
23
25
|
d = src_dict.copy()
|
24
26
|
metadata_labels = cls()
|
25
27
|
|
beamlit/models/model.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,7 +6,8 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
9
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
10
|
+
from ..models.model_spec import ModelSpec
|
10
11
|
|
11
12
|
|
12
13
|
T = TypeVar("T", bound="Model")
|
@@ -17,120 +18,58 @@ class Model:
|
|
17
18
|
"""Logical object representing a model, that can be instantiated in multiple environments as model deployments
|
18
19
|
|
19
20
|
Attributes:
|
20
|
-
|
21
|
-
|
22
|
-
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
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['LabelsType0', None, Unset]): Labels
|
26
|
-
name (Union[Unset, str]): Model name
|
27
|
-
workspace (Union[Unset, str]): The workspace the model belongs to
|
21
|
+
metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
|
22
|
+
spec (Union[Unset, ModelSpec]): Model specification
|
28
23
|
"""
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
updated_at: Union[Unset, str] = UNSET
|
33
|
-
updated_by: Union[Unset, str] = UNSET
|
34
|
-
display_name: Union[Unset, str] = UNSET
|
35
|
-
labels: Union["LabelsType0", None, Unset] = UNSET
|
36
|
-
name: Union[Unset, str] = UNSET
|
37
|
-
workspace: Union[Unset, str] = UNSET
|
25
|
+
metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
|
26
|
+
spec: Union[Unset, "ModelSpec"] = UNSET
|
38
27
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
28
|
|
40
29
|
def to_dict(self) -> dict[str, Any]:
|
41
|
-
|
30
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
+
if not isinstance(self.metadata, Unset):
|
32
|
+
metadata = self.metadata.to_dict()
|
42
33
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
updated_at = self.updated_at
|
48
|
-
|
49
|
-
updated_by = self.updated_by
|
50
|
-
|
51
|
-
display_name = self.display_name
|
52
|
-
|
53
|
-
labels: Union[None, Unset, dict[str, Any]]
|
54
|
-
if isinstance(self.labels, Unset):
|
55
|
-
labels = UNSET
|
56
|
-
elif isinstance(self.labels, LabelsType0):
|
57
|
-
labels = self.labels.to_dict()
|
58
|
-
else:
|
59
|
-
labels = self.labels
|
60
|
-
|
61
|
-
name = self.name
|
62
|
-
|
63
|
-
workspace = self.workspace
|
34
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
35
|
+
if not isinstance(self.spec, Unset):
|
36
|
+
spec = self.spec.to_dict()
|
64
37
|
|
65
38
|
field_dict: dict[str, Any] = {}
|
66
39
|
field_dict.update(self.additional_properties)
|
67
40
|
field_dict.update({})
|
68
|
-
if
|
69
|
-
field_dict["
|
70
|
-
if
|
71
|
-
field_dict["
|
72
|
-
if updated_at is not UNSET:
|
73
|
-
field_dict["updated_at"] = updated_at
|
74
|
-
if updated_by is not UNSET:
|
75
|
-
field_dict["updated_by"] = updated_by
|
76
|
-
if display_name is not UNSET:
|
77
|
-
field_dict["display_name"] = display_name
|
78
|
-
if labels is not UNSET:
|
79
|
-
field_dict["labels"] = labels
|
80
|
-
if name is not UNSET:
|
81
|
-
field_dict["name"] = name
|
82
|
-
if workspace is not UNSET:
|
83
|
-
field_dict["workspace"] = workspace
|
41
|
+
if metadata is not UNSET:
|
42
|
+
field_dict["metadata"] = metadata
|
43
|
+
if spec is not UNSET:
|
44
|
+
field_dict["spec"] = spec
|
84
45
|
|
85
46
|
return field_dict
|
86
47
|
|
87
48
|
@classmethod
|
88
49
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
|
-
from ..models.
|
50
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
51
|
+
from ..models.model_spec import ModelSpec
|
90
52
|
|
91
53
|
if not src_dict:
|
92
54
|
return None
|
93
55
|
d = src_dict.copy()
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
updated_by = d.pop("updated_by", UNSET)
|
101
|
-
|
102
|
-
display_name = d.pop("display_name", UNSET)
|
103
|
-
|
104
|
-
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
105
|
-
if data is None:
|
106
|
-
return data
|
107
|
-
if isinstance(data, Unset):
|
108
|
-
return data
|
109
|
-
try:
|
110
|
-
if not isinstance(data, dict):
|
111
|
-
raise TypeError()
|
112
|
-
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
113
|
-
|
114
|
-
return componentsschemas_labels_type_0
|
115
|
-
except: # noqa: E722
|
116
|
-
pass
|
117
|
-
return cast(Union["LabelsType0", None, Unset], data)
|
118
|
-
|
119
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
120
|
-
|
121
|
-
name = d.pop("name", UNSET)
|
56
|
+
_metadata = d.pop("metadata", UNSET)
|
57
|
+
metadata: Union[Unset, EnvironmentMetadata]
|
58
|
+
if isinstance(_metadata, Unset):
|
59
|
+
metadata = UNSET
|
60
|
+
else:
|
61
|
+
metadata = EnvironmentMetadata.from_dict(_metadata)
|
122
62
|
|
123
|
-
|
63
|
+
_spec = d.pop("spec", UNSET)
|
64
|
+
spec: Union[Unset, ModelSpec]
|
65
|
+
if isinstance(_spec, Unset):
|
66
|
+
spec = UNSET
|
67
|
+
else:
|
68
|
+
spec = ModelSpec.from_dict(_spec)
|
124
69
|
|
125
70
|
model = cls(
|
126
|
-
|
127
|
-
|
128
|
-
updated_at=updated_at,
|
129
|
-
updated_by=updated_by,
|
130
|
-
display_name=display_name,
|
131
|
-
labels=labels,
|
132
|
-
name=name,
|
133
|
-
workspace=workspace,
|
71
|
+
metadata=metadata,
|
72
|
+
spec=spec,
|
134
73
|
)
|
135
74
|
|
136
75
|
model.additional_properties = d
|
beamlit/models/model_metadata.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -50,7 +50,7 @@ class ModelMetadata:
|
|
50
50
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
|
-
labels: Union[Unset,
|
53
|
+
labels: Union[Unset, dict[str, Any]] = UNSET
|
54
54
|
if not isinstance(self.labels, Unset):
|
55
55
|
labels = self.labels.to_dict()
|
56
56
|
|
@@ -85,9 +85,11 @@ class ModelMetadata:
|
|
85
85
|
return field_dict
|
86
86
|
|
87
87
|
@classmethod
|
88
|
-
def from_dict(cls:
|
88
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
89
|
from ..models.metadata_labels import MetadataLabels
|
90
90
|
|
91
|
+
if not src_dict:
|
92
|
+
return None
|
91
93
|
d = src_dict.copy()
|
92
94
|
created_at = d.pop("createdAt", UNSET)
|
93
95
|
|
@@ -5,32 +5,38 @@ from attrs import field as _attrs_field
|
|
5
5
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
|
-
T = TypeVar("T", bound="
|
8
|
+
T = TypeVar("T", bound="ModelPrivateCluster")
|
9
9
|
|
10
10
|
|
11
11
|
@_attrs_define
|
12
|
-
class
|
13
|
-
"""
|
12
|
+
class ModelPrivateCluster:
|
13
|
+
"""Private cluster where the model deployment is deployed
|
14
14
|
|
15
15
|
Attributes:
|
16
|
-
|
17
|
-
|
16
|
+
base_url (Union[Unset, str]): The base url of the model in the private cluster
|
17
|
+
enabled (Union[Unset, bool]): If true, the private cluster is available
|
18
|
+
name (Union[Unset, str]): The name of the private cluster
|
18
19
|
"""
|
19
20
|
|
20
|
-
|
21
|
+
base_url: Union[Unset, str] = UNSET
|
22
|
+
enabled: Union[Unset, bool] = UNSET
|
21
23
|
name: Union[Unset, str] = UNSET
|
22
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
25
|
|
24
26
|
def to_dict(self) -> dict[str, Any]:
|
25
|
-
|
27
|
+
base_url = self.base_url
|
28
|
+
|
29
|
+
enabled = self.enabled
|
26
30
|
|
27
31
|
name = self.name
|
28
32
|
|
29
33
|
field_dict: dict[str, Any] = {}
|
30
34
|
field_dict.update(self.additional_properties)
|
31
35
|
field_dict.update({})
|
32
|
-
if
|
33
|
-
field_dict["
|
36
|
+
if base_url is not UNSET:
|
37
|
+
field_dict["baseUrl"] = base_url
|
38
|
+
if enabled is not UNSET:
|
39
|
+
field_dict["enabled"] = enabled
|
34
40
|
if name is not UNSET:
|
35
41
|
field_dict["name"] = name
|
36
42
|
|
@@ -41,17 +47,20 @@ class FunctionProviderRef:
|
|
41
47
|
if not src_dict:
|
42
48
|
return None
|
43
49
|
d = src_dict.copy()
|
44
|
-
|
50
|
+
base_url = d.pop("baseUrl", UNSET)
|
51
|
+
|
52
|
+
enabled = d.pop("enabled", UNSET)
|
45
53
|
|
46
54
|
name = d.pop("name", UNSET)
|
47
55
|
|
48
|
-
|
49
|
-
|
56
|
+
model_private_cluster = cls(
|
57
|
+
base_url=base_url,
|
58
|
+
enabled=enabled,
|
50
59
|
name=name,
|
51
60
|
)
|
52
61
|
|
53
|
-
|
54
|
-
return
|
62
|
+
model_private_cluster.additional_properties = d
|
63
|
+
return model_private_cluster
|
55
64
|
|
56
65
|
@property
|
57
66
|
def additional_keys(self) -> list[str]:
|
beamlit/models/model_provider.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,7 +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.
|
9
|
+
from ..models.metadata_labels import MetadataLabels
|
10
10
|
from ..models.provider_config import ProviderConfig
|
11
11
|
|
12
12
|
|
@@ -19,40 +19,38 @@ class ModelProvider:
|
|
19
19
|
|
20
20
|
Attributes:
|
21
21
|
created_at (Union[Unset, str]): The date and time when the resource was created
|
22
|
-
created_by (Union[Unset, str]): The user or service account who created the resource
|
23
22
|
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
23
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
24
24
|
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
25
25
|
comment (Union[Unset, str]): Model provider description
|
26
26
|
config (Union[Unset, ProviderConfig]): Model provider config
|
27
27
|
display_name (Union[Unset, str]): Model provider display name
|
28
|
-
labels (Union[
|
28
|
+
labels (Union[Unset, MetadataLabels]): Labels
|
29
29
|
name (Union[Unset, str]): Model provider name
|
30
30
|
type_ (Union[Unset, str]): Model provider type
|
31
31
|
workspace (Union[Unset, str]): Workspace name
|
32
32
|
"""
|
33
33
|
|
34
34
|
created_at: Union[Unset, str] = UNSET
|
35
|
-
created_by: Union[Unset, str] = UNSET
|
36
35
|
updated_at: Union[Unset, str] = UNSET
|
36
|
+
created_by: Union[Unset, str] = UNSET
|
37
37
|
updated_by: Union[Unset, str] = UNSET
|
38
38
|
comment: Union[Unset, str] = UNSET
|
39
39
|
config: Union[Unset, "ProviderConfig"] = UNSET
|
40
40
|
display_name: Union[Unset, str] = UNSET
|
41
|
-
labels: Union["
|
41
|
+
labels: Union[Unset, "MetadataLabels"] = UNSET
|
42
42
|
name: Union[Unset, str] = UNSET
|
43
43
|
type_: Union[Unset, str] = UNSET
|
44
44
|
workspace: Union[Unset, str] = UNSET
|
45
45
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
46
|
|
47
47
|
def to_dict(self) -> dict[str, Any]:
|
48
|
-
from ..models.labels_type_0 import LabelsType0
|
49
|
-
|
50
48
|
created_at = self.created_at
|
51
49
|
|
52
|
-
created_by = self.created_by
|
53
|
-
|
54
50
|
updated_at = self.updated_at
|
55
51
|
|
52
|
+
created_by = self.created_by
|
53
|
+
|
56
54
|
updated_by = self.updated_by
|
57
55
|
|
58
56
|
comment = self.comment
|
@@ -63,13 +61,9 @@ class ModelProvider:
|
|
63
61
|
|
64
62
|
display_name = self.display_name
|
65
63
|
|
66
|
-
labels: Union[
|
67
|
-
if isinstance(self.labels, Unset):
|
68
|
-
labels = UNSET
|
69
|
-
elif isinstance(self.labels, LabelsType0):
|
64
|
+
labels: Union[Unset, dict[str, Any]] = UNSET
|
65
|
+
if not isinstance(self.labels, Unset):
|
70
66
|
labels = self.labels.to_dict()
|
71
|
-
else:
|
72
|
-
labels = self.labels
|
73
67
|
|
74
68
|
name = self.name
|
75
69
|
|
@@ -81,13 +75,13 @@ class ModelProvider:
|
|
81
75
|
field_dict.update(self.additional_properties)
|
82
76
|
field_dict.update({})
|
83
77
|
if created_at is not UNSET:
|
84
|
-
field_dict["
|
85
|
-
if created_by is not UNSET:
|
86
|
-
field_dict["created_by"] = created_by
|
78
|
+
field_dict["createdAt"] = created_at
|
87
79
|
if updated_at is not UNSET:
|
88
|
-
field_dict["
|
80
|
+
field_dict["updatedAt"] = updated_at
|
81
|
+
if created_by is not UNSET:
|
82
|
+
field_dict["createdBy"] = created_by
|
89
83
|
if updated_by is not UNSET:
|
90
|
-
field_dict["
|
84
|
+
field_dict["updatedBy"] = updated_by
|
91
85
|
if comment is not UNSET:
|
92
86
|
field_dict["comment"] = comment
|
93
87
|
if config is not UNSET:
|
@@ -107,19 +101,19 @@ class ModelProvider:
|
|
107
101
|
|
108
102
|
@classmethod
|
109
103
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
110
|
-
from ..models.
|
104
|
+
from ..models.metadata_labels import MetadataLabels
|
111
105
|
from ..models.provider_config import ProviderConfig
|
112
106
|
|
113
107
|
if not src_dict:
|
114
108
|
return None
|
115
109
|
d = src_dict.copy()
|
116
|
-
created_at = d.pop("
|
110
|
+
created_at = d.pop("createdAt", UNSET)
|
117
111
|
|
118
|
-
|
112
|
+
updated_at = d.pop("updatedAt", UNSET)
|
119
113
|
|
120
|
-
|
114
|
+
created_by = d.pop("createdBy", UNSET)
|
121
115
|
|
122
|
-
updated_by = d.pop("
|
116
|
+
updated_by = d.pop("updatedBy", UNSET)
|
123
117
|
|
124
118
|
comment = d.pop("comment", UNSET)
|
125
119
|
|
@@ -132,22 +126,12 @@ class ModelProvider:
|
|
132
126
|
|
133
127
|
display_name = d.pop("display_name", UNSET)
|
134
128
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
if not isinstance(data, dict):
|
142
|
-
raise TypeError()
|
143
|
-
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
144
|
-
|
145
|
-
return componentsschemas_labels_type_0
|
146
|
-
except: # noqa: E722
|
147
|
-
pass
|
148
|
-
return cast(Union["LabelsType0", None, Unset], data)
|
149
|
-
|
150
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
129
|
+
_labels = d.pop("labels", UNSET)
|
130
|
+
labels: Union[Unset, MetadataLabels]
|
131
|
+
if isinstance(_labels, Unset):
|
132
|
+
labels = UNSET
|
133
|
+
else:
|
134
|
+
labels = MetadataLabels.from_dict(_labels)
|
151
135
|
|
152
136
|
name = d.pop("name", UNSET)
|
153
137
|
|
@@ -157,8 +141,8 @@ class ModelProvider:
|
|
157
141
|
|
158
142
|
model_provider = cls(
|
159
143
|
created_at=created_at,
|
160
|
-
created_by=created_by,
|
161
144
|
updated_at=updated_at,
|
145
|
+
created_by=created_by,
|
162
146
|
updated_by=updated_by,
|
163
147
|
comment=comment,
|
164
148
|
config=config,
|
beamlit/models/model_spec.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -6,11 +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.core_spec_configurations import CoreSpecConfigurations
|
9
10
|
from ..models.flavor import Flavor
|
11
|
+
from ..models.model_private_cluster import ModelPrivateCluster
|
10
12
|
from ..models.pod_template_spec import PodTemplateSpec
|
11
13
|
from ..models.runtime import Runtime
|
12
14
|
from ..models.serverless_config import ServerlessConfig
|
13
|
-
from ..models.spec_configuration import SpecConfiguration
|
14
15
|
|
15
16
|
|
16
17
|
T = TypeVar("T", bound="ModelSpec")
|
@@ -21,62 +22,65 @@ class ModelSpec:
|
|
21
22
|
"""Model specification
|
22
23
|
|
23
24
|
Attributes:
|
24
|
-
configurations (Union[Unset,
|
25
|
-
agent you can retrieve the value with config[key]
|
25
|
+
configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
|
26
26
|
enabled (Union[Unset, bool]): Enable or disable the agent
|
27
|
-
flavors (Union[Unset,
|
28
|
-
integration_connections (Union[Unset,
|
27
|
+
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
28
|
+
integration_connections (Union[Unset, list[str]]):
|
29
29
|
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
30
|
-
policies (Union[Unset,
|
30
|
+
policies (Union[Unset, list[str]]):
|
31
|
+
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
31
32
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
32
33
|
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
33
34
|
model_provider (Union[Unset, str]): Model provider name
|
34
35
|
"""
|
35
36
|
|
36
|
-
configurations: Union[Unset, "
|
37
|
+
configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
|
37
38
|
enabled: Union[Unset, bool] = UNSET
|
38
|
-
flavors: Union[Unset,
|
39
|
-
integration_connections: Union[Unset,
|
39
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
40
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
40
41
|
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
41
|
-
policies: Union[Unset,
|
42
|
+
policies: Union[Unset, list[str]] = UNSET
|
43
|
+
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
42
44
|
runtime: Union[Unset, "Runtime"] = UNSET
|
43
45
|
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
44
46
|
model_provider: Union[Unset, str] = UNSET
|
45
47
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
48
|
|
47
49
|
def to_dict(self) -> dict[str, Any]:
|
48
|
-
configurations: Union[Unset,
|
50
|
+
configurations: Union[Unset, dict[str, Any]] = UNSET
|
49
51
|
if not isinstance(self.configurations, Unset):
|
50
52
|
configurations = self.configurations.to_dict()
|
51
53
|
|
52
54
|
enabled = self.enabled
|
53
55
|
|
54
|
-
flavors: Union[Unset,
|
56
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
55
57
|
if not isinstance(self.flavors, Unset):
|
56
58
|
flavors = []
|
57
59
|
for componentsschemas_flavors_item_data in self.flavors:
|
58
|
-
componentsschemas_flavors_item = (
|
59
|
-
componentsschemas_flavors_item_data.to_dict()
|
60
|
-
)
|
60
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
61
61
|
flavors.append(componentsschemas_flavors_item)
|
62
62
|
|
63
|
-
integration_connections: Union[Unset,
|
63
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
64
64
|
if not isinstance(self.integration_connections, Unset):
|
65
65
|
integration_connections = self.integration_connections
|
66
66
|
|
67
|
-
pod_template: Union[Unset,
|
67
|
+
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
68
68
|
if not isinstance(self.pod_template, Unset):
|
69
69
|
pod_template = self.pod_template.to_dict()
|
70
70
|
|
71
|
-
policies: Union[Unset,
|
71
|
+
policies: Union[Unset, list[str]] = UNSET
|
72
72
|
if not isinstance(self.policies, Unset):
|
73
73
|
policies = self.policies
|
74
74
|
|
75
|
-
|
75
|
+
private_clusters: Union[Unset, dict[str, Any]] = UNSET
|
76
|
+
if not isinstance(self.private_clusters, Unset):
|
77
|
+
private_clusters = self.private_clusters.to_dict()
|
78
|
+
|
79
|
+
runtime: Union[Unset, dict[str, Any]] = UNSET
|
76
80
|
if not isinstance(self.runtime, Unset):
|
77
81
|
runtime = self.runtime.to_dict()
|
78
82
|
|
79
|
-
serverless_config: Union[Unset,
|
83
|
+
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
80
84
|
if not isinstance(self.serverless_config, Unset):
|
81
85
|
serverless_config = self.serverless_config.to_dict()
|
82
86
|
|
@@ -97,6 +101,8 @@ class ModelSpec:
|
|
97
101
|
field_dict["podTemplate"] = pod_template
|
98
102
|
if policies is not UNSET:
|
99
103
|
field_dict["policies"] = policies
|
104
|
+
if private_clusters is not UNSET:
|
105
|
+
field_dict["privateClusters"] = private_clusters
|
100
106
|
if runtime is not UNSET:
|
101
107
|
field_dict["runtime"] = runtime
|
102
108
|
if serverless_config is not UNSET:
|
@@ -107,35 +113,34 @@ class ModelSpec:
|
|
107
113
|
return field_dict
|
108
114
|
|
109
115
|
@classmethod
|
110
|
-
def from_dict(cls:
|
116
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
117
|
+
from ..models.core_spec_configurations import CoreSpecConfigurations
|
111
118
|
from ..models.flavor import Flavor
|
119
|
+
from ..models.model_private_cluster import ModelPrivateCluster
|
112
120
|
from ..models.pod_template_spec import PodTemplateSpec
|
113
121
|
from ..models.runtime import Runtime
|
114
122
|
from ..models.serverless_config import ServerlessConfig
|
115
|
-
from ..models.spec_configuration import SpecConfiguration
|
116
123
|
|
124
|
+
if not src_dict:
|
125
|
+
return None
|
117
126
|
d = src_dict.copy()
|
118
127
|
_configurations = d.pop("configurations", UNSET)
|
119
|
-
configurations: Union[Unset,
|
128
|
+
configurations: Union[Unset, CoreSpecConfigurations]
|
120
129
|
if isinstance(_configurations, Unset):
|
121
130
|
configurations = UNSET
|
122
131
|
else:
|
123
|
-
configurations =
|
132
|
+
configurations = CoreSpecConfigurations.from_dict(_configurations)
|
124
133
|
|
125
134
|
enabled = d.pop("enabled", UNSET)
|
126
135
|
|
127
136
|
flavors = []
|
128
137
|
_flavors = d.pop("flavors", UNSET)
|
129
138
|
for componentsschemas_flavors_item_data in _flavors or []:
|
130
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
131
|
-
componentsschemas_flavors_item_data
|
132
|
-
)
|
139
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
133
140
|
|
134
141
|
flavors.append(componentsschemas_flavors_item)
|
135
142
|
|
136
|
-
integration_connections = cast(
|
137
|
-
List[str], d.pop("integrationConnections", UNSET)
|
138
|
-
)
|
143
|
+
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
139
144
|
|
140
145
|
_pod_template = d.pop("podTemplate", UNSET)
|
141
146
|
pod_template: Union[Unset, PodTemplateSpec]
|
@@ -144,7 +149,14 @@ class ModelSpec:
|
|
144
149
|
else:
|
145
150
|
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
146
151
|
|
147
|
-
policies = cast(
|
152
|
+
policies = cast(list[str], d.pop("policies", UNSET))
|
153
|
+
|
154
|
+
_private_clusters = d.pop("privateClusters", UNSET)
|
155
|
+
private_clusters: Union[Unset, ModelPrivateCluster]
|
156
|
+
if isinstance(_private_clusters, Unset):
|
157
|
+
private_clusters = UNSET
|
158
|
+
else:
|
159
|
+
private_clusters = ModelPrivateCluster.from_dict(_private_clusters)
|
148
160
|
|
149
161
|
_runtime = d.pop("runtime", UNSET)
|
150
162
|
runtime: Union[Unset, Runtime]
|
@@ -169,6 +181,7 @@ class ModelSpec:
|
|
169
181
|
integration_connections=integration_connections,
|
170
182
|
pod_template=pod_template,
|
171
183
|
policies=policies,
|
184
|
+
private_clusters=private_clusters,
|
172
185
|
runtime=runtime,
|
173
186
|
serverless_config=serverless_config,
|
174
187
|
model_provider=model_provider,
|
beamlit/models/owner_fields.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,9 @@ class OwnerFields:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
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
|
created_by = d.pop("createdBy", UNSET)
|
43
45
|
|