beamlit 0.0.20rc5__py3-none-any.whl → 0.0.20rc7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/delete_agent_history.py +6 -2
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +6 -2
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +6 -2
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/list_integration_connections.py +11 -11
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +26 -10
- beamlit/authentication/apikey.py +4 -4
- beamlit/authentication/authentication.py +36 -5
- beamlit/authentication/clientcredentials.py +18 -20
- beamlit/authentication/credentials.py +18 -11
- beamlit/authentication/device_mode.py +15 -12
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +31 -19
- beamlit/common/logger.py +9 -12
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +78 -30
- beamlit/common/utils.py +4 -2
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/models/acl.py +2 -2
- beamlit/models/agent.py +3 -3
- beamlit/models/agent_chain.py +2 -2
- beamlit/models/agent_configuration.py +2 -2
- beamlit/models/agent_deployment.py +25 -25
- beamlit/models/agent_deployment_configuration.py +2 -2
- beamlit/models/agent_deployment_history.py +5 -5
- beamlit/models/agent_deployment_history_event.py +9 -9
- beamlit/models/agent_deployment_pod_template.py +2 -2
- beamlit/models/agent_release.py +2 -2
- beamlit/models/agent_spec.py +15 -5
- beamlit/models/agent_with_deployments.py +6 -6
- beamlit/models/api_key.py +2 -2
- beamlit/models/authentication_provider_model.py +6 -6
- beamlit/models/authentication_provider_organization.py +2 -2
- beamlit/models/configuration.py +10 -10
- beamlit/models/continent.py +2 -2
- beamlit/models/core_spec.py +9 -3
- beamlit/models/country.py +2 -2
- beamlit/models/create_api_key_for_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_response_200.py +2 -2
- beamlit/models/delete_workspace_service_account_response_200.py +2 -2
- beamlit/models/deployment_configuration.py +2 -2
- beamlit/models/deployment_configurations.py +2 -2
- beamlit/models/deployment_serverless_config.py +2 -2
- beamlit/models/deployment_serverless_config_type_0.py +3 -1
- beamlit/models/environment.py +7 -7
- beamlit/models/environment_metrics.py +8 -8
- beamlit/models/flavor.py +9 -9
- beamlit/models/function.py +3 -3
- beamlit/models/function_configuration.py +2 -2
- beamlit/models/function_deployment.py +24 -24
- beamlit/models/function_deployment_configuration.py +2 -2
- beamlit/models/function_deployment_pod_template.py +2 -2
- beamlit/models/function_kit.py +5 -5
- beamlit/models/function_provider_ref.py +2 -2
- beamlit/models/function_release.py +2 -2
- beamlit/models/function_spec.py +9 -3
- beamlit/models/function_with_deployments.py +6 -6
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
- beamlit/models/increase_and_rate_metric.py +5 -5
- beamlit/models/integration.py +12 -12
- beamlit/models/integration_config.py +2 -2
- beamlit/models/integration_connection.py +5 -5
- beamlit/models/integration_connection_config.py +2 -2
- beamlit/models/integration_connection_secret.py +2 -2
- beamlit/models/integration_model.py +6 -6
- beamlit/models/integration_secret.py +2 -2
- beamlit/models/invite_workspace_user_body.py +2 -2
- beamlit/models/labels_type_0.py +2 -2
- beamlit/models/location.py +5 -5
- beamlit/models/location_response.py +5 -5
- beamlit/models/metric.py +2 -2
- beamlit/models/metrics.py +8 -8
- beamlit/models/model.py +3 -3
- beamlit/models/model_deployment.py +18 -18
- beamlit/models/model_deployment_log.py +2 -2
- beamlit/models/model_deployment_metrics.py +9 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/model_deployment_pod_template.py +2 -2
- beamlit/models/model_metrics.py +6 -6
- beamlit/models/model_provider.py +11 -11
- beamlit/models/model_provider_ref.py +2 -2
- beamlit/models/model_release.py +2 -2
- beamlit/models/model_spec.py +9 -3
- beamlit/models/model_with_deployments.py +6 -6
- beamlit/models/pending_invitation.py +2 -2
- beamlit/models/pending_invitation_accept.py +3 -3
- beamlit/models/pending_invitation_render.py +5 -5
- beamlit/models/pending_invitation_render_invited_by.py +2 -2
- beamlit/models/pending_invitation_render_workspace.py +2 -2
- beamlit/models/pending_invitation_workspace_details.py +6 -6
- beamlit/models/policy.py +20 -20
- beamlit/models/policy_location.py +9 -9
- beamlit/models/policy_spec.py +9 -3
- beamlit/models/provider_config.py +7 -7
- beamlit/models/qps.py +2 -2
- beamlit/models/resource_deployment_log.py +2 -2
- beamlit/models/resource_deployment_metrics.py +16 -16
- beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/resource_environment_metrics.py +62 -24
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
- beamlit/models/resource_metrics.py +10 -10
- beamlit/models/runtime.py +23 -23
- beamlit/models/runtime_readiness_probe.py +2 -2
- beamlit/models/runtime_resources.py +2 -2
- beamlit/models/serverless_config.py +2 -2
- beamlit/models/standard_fields_dynamo_db.py +2 -2
- beamlit/models/store_agent.py +6 -6
- beamlit/models/store_agent_configuration.py +2 -2
- beamlit/models/store_agent_labels.py +2 -2
- beamlit/models/store_configuration.py +16 -16
- beamlit/models/store_configuration_option.py +2 -2
- beamlit/models/store_function.py +12 -12
- beamlit/models/store_function_configuration.py +2 -2
- beamlit/models/store_function_kit.py +5 -5
- beamlit/models/store_function_labels.py +2 -2
- beamlit/models/store_function_parameter.py +9 -9
- beamlit/models/update_workspace_service_account_body.py +2 -2
- beamlit/models/update_workspace_service_account_response_200.py +2 -2
- beamlit/models/update_workspace_user_role_body.py +2 -2
- beamlit/models/workspace.py +3 -3
- beamlit/models/workspace_labels.py +2 -2
- beamlit/models/workspace_user.py +2 -2
- beamlit/run.py +6 -6
- beamlit/serve/app.py +73 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/METADATA +7 -1
- beamlit-0.0.20rc7.dist-info/RECORD +293 -0
- beamlit-0.0.20rc5.dist-info/RECORD +0 -282
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/WHEEL +0 -0
beamlit/models/agent_spec.py
CHANGED
@@ -64,7 +64,9 @@ class AgentSpec:
|
|
64
64
|
if not isinstance(self.flavors, Unset):
|
65
65
|
flavors = []
|
66
66
|
for componentsschemas_flavors_item_data in self.flavors:
|
67
|
-
componentsschemas_flavors_item =
|
67
|
+
componentsschemas_flavors_item = (
|
68
|
+
componentsschemas_flavors_item_data.to_dict()
|
69
|
+
)
|
68
70
|
flavors.append(componentsschemas_flavors_item)
|
69
71
|
|
70
72
|
integration_connections: Union[Unset, List[str]] = UNSET
|
@@ -91,7 +93,9 @@ class AgentSpec:
|
|
91
93
|
if not isinstance(self.agent_chain, Unset):
|
92
94
|
agent_chain = []
|
93
95
|
for componentsschemas_agent_chains_item_data in self.agent_chain:
|
94
|
-
componentsschemas_agent_chains_item =
|
96
|
+
componentsschemas_agent_chains_item = (
|
97
|
+
componentsschemas_agent_chains_item_data.to_dict()
|
98
|
+
)
|
95
99
|
agent_chain.append(componentsschemas_agent_chains_item)
|
96
100
|
|
97
101
|
description = self.description
|
@@ -158,11 +162,15 @@ class AgentSpec:
|
|
158
162
|
flavors = []
|
159
163
|
_flavors = d.pop("flavors", UNSET)
|
160
164
|
for componentsschemas_flavors_item_data in _flavors or []:
|
161
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
165
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
166
|
+
componentsschemas_flavors_item_data
|
167
|
+
)
|
162
168
|
|
163
169
|
flavors.append(componentsschemas_flavors_item)
|
164
170
|
|
165
|
-
integration_connections = cast(
|
171
|
+
integration_connections = cast(
|
172
|
+
List[str], d.pop("integrationConnections", UNSET)
|
173
|
+
)
|
166
174
|
|
167
175
|
_pod_template = d.pop("podTemplate", UNSET)
|
168
176
|
pod_template: Union[Unset, PodTemplateSpec]
|
@@ -190,7 +198,9 @@ class AgentSpec:
|
|
190
198
|
agent_chain = []
|
191
199
|
_agent_chain = d.pop("agentChain", UNSET)
|
192
200
|
for componentsschemas_agent_chains_item_data in _agent_chain or []:
|
193
|
-
componentsschemas_agent_chains_item = AgentChain.from_dict(
|
201
|
+
componentsschemas_agent_chains_item = AgentChain.from_dict(
|
202
|
+
componentsschemas_agent_chains_item_data
|
203
|
+
)
|
194
204
|
|
195
205
|
agent_chain.append(componentsschemas_agent_chains_item)
|
196
206
|
|
@@ -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
|
@@ -26,7 +26,7 @@ class AgentWithDeployments:
|
|
26
26
|
labels (Union['LabelsType0', None, Unset]): Labels
|
27
27
|
name (Union[Unset, str]): Agent name
|
28
28
|
workspace (Union[Unset, str]): Workspace name
|
29
|
-
deployments (Union[Unset,
|
29
|
+
deployments (Union[Unset, list['AgentDeployment']]):
|
30
30
|
"""
|
31
31
|
|
32
32
|
created_at: Union[Unset, str] = UNSET
|
@@ -37,7 +37,7 @@ class AgentWithDeployments:
|
|
37
37
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
38
38
|
name: Union[Unset, str] = UNSET
|
39
39
|
workspace: Union[Unset, str] = UNSET
|
40
|
-
deployments: Union[Unset,
|
40
|
+
deployments: Union[Unset, list["AgentDeployment"]] = UNSET
|
41
41
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
42
|
|
43
43
|
def to_dict(self) -> dict[str, Any]:
|
@@ -53,7 +53,7 @@ class AgentWithDeployments:
|
|
53
53
|
|
54
54
|
display_name = self.display_name
|
55
55
|
|
56
|
-
labels: Union[
|
56
|
+
labels: Union[None, Unset, dict[str, Any]]
|
57
57
|
if isinstance(self.labels, Unset):
|
58
58
|
labels = UNSET
|
59
59
|
elif isinstance(self.labels, LabelsType0):
|
@@ -65,7 +65,7 @@ class AgentWithDeployments:
|
|
65
65
|
|
66
66
|
workspace = self.workspace
|
67
67
|
|
68
|
-
deployments: Union[Unset,
|
68
|
+
deployments: Union[Unset, list[dict[str, Any]]] = UNSET
|
69
69
|
if not isinstance(self.deployments, Unset):
|
70
70
|
deployments = []
|
71
71
|
for componentsschemas_agent_deployments_item_data in self.deployments:
|
@@ -97,7 +97,7 @@ class AgentWithDeployments:
|
|
97
97
|
return field_dict
|
98
98
|
|
99
99
|
@classmethod
|
100
|
-
def from_dict(cls:
|
100
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
101
101
|
from ..models.agent_deployment import AgentDeployment
|
102
102
|
from ..models.labels_type_0 import LabelsType0
|
103
103
|
|
beamlit/models/api_key.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
|
@@ -85,7 +85,7 @@ class ApiKey:
|
|
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
|
if not src_dict:
|
90
90
|
return None
|
91
91
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -21,7 +21,7 @@ class AuthenticationProviderModel:
|
|
21
21
|
name (Union[Unset, str]): Provider model name
|
22
22
|
pipeline_tag (Union[Unset, str]): Provider model pipeline tag
|
23
23
|
private (Union[Unset, bool]): Provider model private
|
24
|
-
tags (Union[Unset,
|
24
|
+
tags (Union[Unset, list[str]]): Provider model tags
|
25
25
|
trending_score (Union[Unset, int]): Provider model trending score
|
26
26
|
"""
|
27
27
|
|
@@ -33,7 +33,7 @@ class AuthenticationProviderModel:
|
|
33
33
|
name: Union[Unset, str] = UNSET
|
34
34
|
pipeline_tag: Union[Unset, str] = UNSET
|
35
35
|
private: Union[Unset, bool] = UNSET
|
36
|
-
tags: Union[Unset,
|
36
|
+
tags: Union[Unset, list[str]] = UNSET
|
37
37
|
trending_score: Union[Unset, int] = UNSET
|
38
38
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
39
|
|
@@ -54,7 +54,7 @@ class AuthenticationProviderModel:
|
|
54
54
|
|
55
55
|
private = self.private
|
56
56
|
|
57
|
-
tags: Union[Unset,
|
57
|
+
tags: Union[Unset, list[str]] = UNSET
|
58
58
|
if not isinstance(self.tags, Unset):
|
59
59
|
tags = self.tags
|
60
60
|
|
@@ -87,7 +87,7 @@ class AuthenticationProviderModel:
|
|
87
87
|
return field_dict
|
88
88
|
|
89
89
|
@classmethod
|
90
|
-
def from_dict(cls:
|
90
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
91
91
|
if not src_dict:
|
92
92
|
return None
|
93
93
|
d = src_dict.copy()
|
@@ -107,7 +107,7 @@ class AuthenticationProviderModel:
|
|
107
107
|
|
108
108
|
private = d.pop("private", UNSET)
|
109
109
|
|
110
|
-
tags = cast(
|
110
|
+
tags = cast(list[str], d.pop("tags", UNSET))
|
111
111
|
|
112
112
|
trending_score = d.pop("trending_score", UNSET)
|
113
113
|
|
@@ -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
|
@@ -49,7 +49,7 @@ class AuthenticationProviderOrganization:
|
|
49
49
|
return field_dict
|
50
50
|
|
51
51
|
@classmethod
|
52
|
-
def from_dict(cls:
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
53
|
if not src_dict:
|
54
54
|
return None
|
55
55
|
d = src_dict.copy()
|
beamlit/models/configuration.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -13,20 +13,20 @@ class Configuration:
|
|
13
13
|
"""Configuration
|
14
14
|
|
15
15
|
Attributes:
|
16
|
-
continents (Union[Unset,
|
17
|
-
countries (Union[Unset,
|
16
|
+
continents (Union[Unset, list[Any]]): Continents
|
17
|
+
countries (Union[Unset, list[Any]]): Countries
|
18
18
|
"""
|
19
19
|
|
20
|
-
continents: Union[Unset,
|
21
|
-
countries: Union[Unset,
|
20
|
+
continents: Union[Unset, list[Any]] = UNSET
|
21
|
+
countries: Union[Unset, list[Any]] = UNSET
|
22
22
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
23
|
|
24
24
|
def to_dict(self) -> dict[str, Any]:
|
25
|
-
continents: Union[Unset,
|
25
|
+
continents: Union[Unset, list[Any]] = UNSET
|
26
26
|
if not isinstance(self.continents, Unset):
|
27
27
|
continents = self.continents
|
28
28
|
|
29
|
-
countries: Union[Unset,
|
29
|
+
countries: Union[Unset, list[Any]] = UNSET
|
30
30
|
if not isinstance(self.countries, Unset):
|
31
31
|
countries = self.countries
|
32
32
|
|
@@ -41,13 +41,13 @@ class Configuration:
|
|
41
41
|
return field_dict
|
42
42
|
|
43
43
|
@classmethod
|
44
|
-
def from_dict(cls:
|
44
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
45
45
|
if not src_dict:
|
46
46
|
return None
|
47
47
|
d = src_dict.copy()
|
48
|
-
continents = cast(
|
48
|
+
continents = cast(list[Any], d.pop("continents", UNSET))
|
49
49
|
|
50
|
-
countries = cast(
|
50
|
+
countries = cast(list[Any], d.pop("countries", UNSET))
|
51
51
|
|
52
52
|
configuration = cls(
|
53
53
|
continents=continents,
|
beamlit/models/continent.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,7 @@ class Continent:
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
beamlit/models/core_spec.py
CHANGED
@@ -53,7 +53,9 @@ class CoreSpec:
|
|
53
53
|
if not isinstance(self.flavors, Unset):
|
54
54
|
flavors = []
|
55
55
|
for componentsschemas_flavors_item_data in self.flavors:
|
56
|
-
componentsschemas_flavors_item =
|
56
|
+
componentsschemas_flavors_item = (
|
57
|
+
componentsschemas_flavors_item_data.to_dict()
|
58
|
+
)
|
57
59
|
flavors.append(componentsschemas_flavors_item)
|
58
60
|
|
59
61
|
integration_connections: Union[Unset, List[str]] = UNSET
|
@@ -119,11 +121,15 @@ class CoreSpec:
|
|
119
121
|
flavors = []
|
120
122
|
_flavors = d.pop("flavors", UNSET)
|
121
123
|
for componentsschemas_flavors_item_data in _flavors or []:
|
122
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
124
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
125
|
+
componentsschemas_flavors_item_data
|
126
|
+
)
|
123
127
|
|
124
128
|
flavors.append(componentsschemas_flavors_item)
|
125
129
|
|
126
|
-
integration_connections = cast(
|
130
|
+
integration_connections = cast(
|
131
|
+
List[str], d.pop("integrationConnections", UNSET)
|
132
|
+
)
|
127
133
|
|
128
134
|
_pod_template = d.pop("podTemplate", UNSET)
|
129
135
|
pod_template: Union[Unset, PodTemplateSpec]
|
beamlit/models/country.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,7 @@ class Country:
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
@@ -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
|
@@ -36,7 +36,7 @@ class CreateApiKeyForServiceAccountBody:
|
|
36
36
|
return field_dict
|
37
37
|
|
38
38
|
@classmethod
|
39
|
-
def from_dict(cls:
|
39
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
40
40
|
if not src_dict:
|
41
41
|
return None
|
42
42
|
d = src_dict.copy()
|
@@ -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
|
@@ -38,7 +38,7 @@ class CreateWorkspaceServiceAccountBody:
|
|
38
38
|
return field_dict
|
39
39
|
|
40
40
|
@classmethod
|
41
|
-
def from_dict(cls:
|
41
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
42
42
|
if not src_dict:
|
43
43
|
return None
|
44
44
|
d = src_dict.copy()
|
@@ -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
|
@@ -60,7 +60,7 @@ class CreateWorkspaceServiceAccountResponse200:
|
|
60
60
|
return field_dict
|
61
61
|
|
62
62
|
@classmethod
|
63
|
-
def from_dict(cls:
|
63
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
64
64
|
if not src_dict:
|
65
65
|
return None
|
66
66
|
d = src_dict.copy()
|
@@ -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
|
@@ -54,7 +54,7 @@ class DeleteWorkspaceServiceAccountResponse200:
|
|
54
54
|
return field_dict
|
55
55
|
|
56
56
|
@classmethod
|
57
|
-
def from_dict(cls:
|
57
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
58
58
|
if not src_dict:
|
59
59
|
return None
|
60
60
|
d = src_dict.copy()
|
@@ -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,7 @@ class DeploymentConfiguration:
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -24,7 +24,7 @@ class DeploymentConfigurations:
|
|
24
24
|
return field_dict
|
25
25
|
|
26
26
|
@classmethod
|
27
|
-
def from_dict(cls:
|
27
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
28
28
|
from ..models.deployment_configuration import DeploymentConfiguration
|
29
29
|
|
30
30
|
if not src_dict:
|
@@ -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
|
@@ -80,7 +80,7 @@ class DeploymentServerlessConfig:
|
|
80
80
|
return field_dict
|
81
81
|
|
82
82
|
@classmethod
|
83
|
-
def from_dict(cls:
|
83
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
84
84
|
if not src_dict:
|
85
85
|
return None
|
86
86
|
d = src_dict.copy()
|
@@ -122,7 +122,9 @@ class DeploymentServerlessConfigType0:
|
|
122
122
|
return data
|
123
123
|
return cast(Union[None, Unset, str], data)
|
124
124
|
|
125
|
-
last_pod_retention_period = _parse_last_pod_retention_period(
|
125
|
+
last_pod_retention_period = _parse_last_pod_retention_period(
|
126
|
+
d.pop("last_pod_retention_period", UNSET)
|
127
|
+
)
|
126
128
|
|
127
129
|
def _parse_max_num_replicas(data: object) -> Union[None, Unset, int]:
|
128
130
|
if data is None:
|
beamlit/models/environment.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
|
@@ -24,7 +24,7 @@ class Environment:
|
|
24
24
|
display_name (Union[Unset, str]): The display name of the environment
|
25
25
|
labels (Union['LabelsType0', None, Unset]): Labels
|
26
26
|
name (Union[Unset, str]): The name of the environment
|
27
|
-
policies (Union[Unset,
|
27
|
+
policies (Union[Unset, list[Any]]): The policies attached to the environment
|
28
28
|
workspace (Union[Unset, str]): The workspace the environment belongs to
|
29
29
|
"""
|
30
30
|
|
@@ -35,7 +35,7 @@ class Environment:
|
|
35
35
|
display_name: Union[Unset, str] = UNSET
|
36
36
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
37
37
|
name: Union[Unset, str] = UNSET
|
38
|
-
policies: Union[Unset,
|
38
|
+
policies: Union[Unset, list[Any]] = UNSET
|
39
39
|
workspace: Union[Unset, str] = UNSET
|
40
40
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
41
41
|
|
@@ -52,7 +52,7 @@ class Environment:
|
|
52
52
|
|
53
53
|
display_name = self.display_name
|
54
54
|
|
55
|
-
labels: Union[
|
55
|
+
labels: Union[None, Unset, dict[str, Any]]
|
56
56
|
if isinstance(self.labels, Unset):
|
57
57
|
labels = UNSET
|
58
58
|
elif isinstance(self.labels, LabelsType0):
|
@@ -62,7 +62,7 @@ class Environment:
|
|
62
62
|
|
63
63
|
name = self.name
|
64
64
|
|
65
|
-
policies: Union[Unset,
|
65
|
+
policies: Union[Unset, list[Any]] = UNSET
|
66
66
|
if not isinstance(self.policies, Unset):
|
67
67
|
policies = self.policies
|
68
68
|
|
@@ -93,7 +93,7 @@ class Environment:
|
|
93
93
|
return field_dict
|
94
94
|
|
95
95
|
@classmethod
|
96
|
-
def from_dict(cls:
|
96
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
97
97
|
from ..models.labels_type_0 import LabelsType0
|
98
98
|
|
99
99
|
if not src_dict:
|
@@ -128,7 +128,7 @@ class Environment:
|
|
128
128
|
|
129
129
|
name = d.pop("name", UNSET)
|
130
130
|
|
131
|
-
policies = cast(
|
131
|
+
policies = cast(list[Any], d.pop("policies", UNSET))
|
132
132
|
|
133
133
|
workspace = d.pop("workspace", UNSET)
|
134
134
|
|
@@ -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
|
@@ -17,23 +17,23 @@ class EnvironmentMetrics:
|
|
17
17
|
"""Metrics for the environment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
inference_global (Union[Unset,
|
21
|
-
inference_per_second_global (Union[Unset,
|
20
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
21
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
22
22
|
"""
|
23
23
|
|
24
|
-
inference_global: Union[Unset,
|
25
|
-
inference_per_second_global: Union[Unset,
|
24
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
25
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
26
26
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
27
|
|
28
28
|
def to_dict(self) -> dict[str, Any]:
|
29
|
-
inference_global: Union[Unset,
|
29
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
30
30
|
if not isinstance(self.inference_global, Unset):
|
31
31
|
inference_global = []
|
32
32
|
for componentsschemas_array_metric_item_data in self.inference_global:
|
33
33
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
34
34
|
inference_global.append(componentsschemas_array_metric_item)
|
35
35
|
|
36
|
-
inference_per_second_global: Union[Unset,
|
36
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
37
37
|
if not isinstance(self.inference_per_second_global, Unset):
|
38
38
|
inference_per_second_global = []
|
39
39
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
@@ -51,7 +51,7 @@ class EnvironmentMetrics:
|
|
51
51
|
return field_dict
|
52
52
|
|
53
53
|
@classmethod
|
54
|
-
def from_dict(cls:
|
54
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
55
55
|
from ..models.metric import Metric
|
56
56
|
|
57
57
|
if not src_dict:
|
beamlit/models/flavor.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
|
@@ -14,40 +14,40 @@ class Flavor:
|
|
14
14
|
|
15
15
|
Attributes:
|
16
16
|
name (Union[Unset, str]): Flavor name (e.g. t4)
|
17
|
-
|
17
|
+
type_ (Union[Unset, str]): Flavor type (e.g. cpu, gpu)
|
18
18
|
"""
|
19
19
|
|
20
20
|
name: Union[Unset, str] = UNSET
|
21
|
-
|
21
|
+
type_: Union[Unset, str] = UNSET
|
22
22
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
23
|
|
24
24
|
def to_dict(self) -> dict[str, Any]:
|
25
25
|
name = self.name
|
26
26
|
|
27
|
-
|
27
|
+
type_ = self.type_
|
28
28
|
|
29
29
|
field_dict: dict[str, Any] = {}
|
30
30
|
field_dict.update(self.additional_properties)
|
31
31
|
field_dict.update({})
|
32
32
|
if name is not UNSET:
|
33
33
|
field_dict["name"] = name
|
34
|
-
if
|
35
|
-
field_dict["type"] =
|
34
|
+
if type_ is not UNSET:
|
35
|
+
field_dict["type"] = type_
|
36
36
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
44
44
|
name = d.pop("name", UNSET)
|
45
45
|
|
46
|
-
|
46
|
+
type_ = d.pop("type", UNSET)
|
47
47
|
|
48
48
|
flavor = cls(
|
49
49
|
name=name,
|
50
|
-
|
50
|
+
type_=type_,
|
51
51
|
)
|
52
52
|
|
53
53
|
flavor.additional_properties = d
|
beamlit/models/function.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
|
@@ -50,7 +50,7 @@ class Function:
|
|
50
50
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
|
-
labels: Union[
|
53
|
+
labels: Union[None, Unset, dict[str, Any]]
|
54
54
|
if isinstance(self.labels, Unset):
|
55
55
|
labels = UNSET
|
56
56
|
elif isinstance(self.labels, LabelsType0):
|
@@ -85,7 +85,7 @@ class Function:
|
|
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.labels_type_0 import LabelsType0
|
90
90
|
|
91
91
|
if not src_dict:
|
@@ -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,7 @@ class FunctionConfiguration:
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|