beamlit 0.0.18__py3-none-any.whl → 0.0.20__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/create_agent.py +14 -9
- beamlit/api/agents/delete_agent_history.py +159 -0
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
- beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +185 -0
- beamlit/api/agents/update_agent.py +14 -9
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/create_function.py +14 -9
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/functions/update_function.py +14 -9
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/create_integration_connection.py +167 -0
- beamlit/api/integrations/delete_integration_connection.py +158 -0
- beamlit/api/integrations/get_integration.py +97 -0
- beamlit/api/integrations/get_integration_connection.py +154 -0
- beamlit/api/integrations/get_integration_connection_model.py +97 -0
- beamlit/api/integrations/get_integration_model.py +97 -0
- beamlit/api/integrations/list_integration_connection_models.py +97 -0
- beamlit/api/integrations/list_integration_connections.py +139 -0
- beamlit/api/integrations/list_integration_models.py +97 -0
- beamlit/api/integrations/update_integration_connection.py +180 -0
- 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/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
- 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 +29 -8
- beamlit/authentication/apikey.py +8 -2
- beamlit/authentication/authentication.py +66 -3
- beamlit/authentication/clientcredentials.py +108 -0
- beamlit/authentication/credentials.py +22 -8
- beamlit/authentication/device_mode.py +23 -13
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +183 -0
- beamlit/common/logger.py +29 -0
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +156 -0
- beamlit/common/utils.py +15 -0
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/functions/github/__init__.py +3 -0
- beamlit/functions/github/github.py +21 -0
- beamlit/functions/github/kit/__init__.py +7 -0
- beamlit/functions/github/kit/pull_request.py +51 -0
- beamlit/functions/math/__init__.py +3 -0
- beamlit/functions/math/math.py +40 -0
- beamlit/functions/search/__init__.py +3 -0
- beamlit/functions/search/search.py +15 -0
- beamlit/models/__init__.py +24 -0
- beamlit/models/acl.py +4 -2
- beamlit/models/agent.py +5 -3
- beamlit/models/agent_chain.py +4 -2
- beamlit/models/agent_configuration.py +4 -2
- beamlit/models/agent_deployment.py +41 -28
- beamlit/models/agent_deployment_configuration.py +4 -2
- beamlit/models/agent_deployment_configuration_type_0.py +43 -0
- beamlit/models/agent_deployment_history.py +7 -5
- beamlit/models/agent_deployment_history_event.py +11 -9
- beamlit/models/agent_deployment_pod_template.py +4 -2
- beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +4 -2
- beamlit/models/agent_spec.py +248 -0
- beamlit/models/agent_with_deployments.py +176 -0
- beamlit/models/api_key.py +4 -2
- beamlit/models/authentication_provider_model.py +8 -6
- beamlit/models/authentication_provider_organization.py +4 -2
- beamlit/models/configuration.py +12 -10
- beamlit/models/continent.py +4 -2
- beamlit/models/core_spec.py +185 -0
- beamlit/models/country.py +4 -2
- beamlit/models/create_api_key_for_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_response_200.py +4 -2
- beamlit/models/delete_workspace_service_account_response_200.py +4 -2
- beamlit/models/deployment_configuration.py +4 -2
- beamlit/models/deployment_configurations.py +22 -7
- beamlit/models/deployment_serverless_config.py +4 -2
- beamlit/models/deployment_serverless_config_type_0.py +220 -0
- beamlit/models/environment.py +9 -7
- beamlit/models/environment_metrics.py +26 -5
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +11 -9
- beamlit/models/function.py +5 -3
- beamlit/models/function_configuration.py +4 -2
- beamlit/models/function_deployment.py +33 -20
- beamlit/models/function_deployment_configuration.py +4 -2
- beamlit/models/function_deployment_configuration_type_0.py +43 -0
- beamlit/models/function_deployment_pod_template.py +4 -2
- beamlit/models/function_deployment_pod_template_type_0.py +43 -0
- beamlit/models/function_kit.py +7 -5
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +4 -2
- beamlit/models/function_release.py +4 -2
- beamlit/models/function_spec.py +246 -0
- beamlit/models/function_with_deployments.py +176 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
- beamlit/models/increase_and_rate_metric.py +104 -0
- beamlit/models/integration.py +198 -0
- beamlit/models/integration_config.py +45 -0
- beamlit/models/integration_connection.py +198 -0
- beamlit/models/integration_connection_config.py +45 -0
- beamlit/models/integration_connection_secret.py +61 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +144 -0
- beamlit/models/integration_secret.py +61 -0
- beamlit/models/invite_workspace_user_body.py +4 -2
- beamlit/models/labels_type_0.py +4 -2
- beamlit/models/location.py +7 -5
- beamlit/models/location_response.py +7 -5
- beamlit/models/metadata.py +135 -0
- beamlit/models/{labels.py → metadata_labels.py} +5 -5
- beamlit/models/metric.py +4 -2
- beamlit/models/metrics.py +68 -25
- beamlit/models/model.py +5 -3
- beamlit/models/model_deployment.py +27 -14
- beamlit/models/model_deployment_log.py +4 -2
- beamlit/models/model_deployment_metrics.py +11 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/model_deployment_pod_template.py +4 -2
- beamlit/models/model_deployment_pod_template_type_0.py +43 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +8 -6
- beamlit/models/model_provider.py +13 -11
- beamlit/models/model_provider_ref.py +4 -2
- beamlit/models/model_release.py +4 -2
- beamlit/models/model_spec.py +194 -0
- beamlit/models/model_with_deployments.py +8 -6
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +4 -2
- beamlit/models/pending_invitation_accept.py +5 -3
- beamlit/models/pending_invitation_render.py +7 -5
- beamlit/models/pending_invitation_render_invited_by.py +4 -2
- beamlit/models/pending_invitation_render_workspace.py +4 -2
- beamlit/models/pending_invitation_workspace_details.py +8 -6
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +22 -20
- beamlit/models/policy_location.py +11 -9
- beamlit/models/policy_spec.py +125 -0
- beamlit/models/provider_config.py +9 -16
- beamlit/models/qps.py +4 -2
- beamlit/models/resource_deployment_log.py +4 -2
- beamlit/models/resource_deployment_metrics.py +119 -9
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_environment_metrics.py +210 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +44 -6
- beamlit/models/runtime.py +25 -23
- beamlit/models/runtime_readiness_probe.py +4 -2
- beamlit/models/runtime_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_resources.py +4 -2
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +4 -2
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +4 -2
- beamlit/models/store_agent.py +8 -6
- beamlit/models/store_agent_configuration.py +4 -2
- beamlit/models/store_agent_labels.py +4 -2
- beamlit/models/store_agent_labels_type_0.py +43 -0
- beamlit/models/store_configuration.py +18 -16
- beamlit/models/store_configuration_option.py +4 -2
- beamlit/models/store_function.py +14 -12
- beamlit/models/store_function_configuration.py +4 -2
- beamlit/models/store_function_kit.py +7 -5
- beamlit/models/store_function_labels.py +4 -2
- beamlit/models/store_function_labels_type_0.py +43 -0
- beamlit/models/store_function_parameter.py +11 -9
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +4 -2
- beamlit/models/update_workspace_service_account_response_200.py +4 -2
- beamlit/models/update_workspace_user_role_body.py +4 -2
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +5 -3
- beamlit/models/workspace_labels.py +4 -2
- beamlit/models/workspace_user.py +4 -2
- beamlit/run.py +49 -0
- beamlit/serve/app.py +78 -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.18.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
- beamlit-0.0.20.dist-info/RECORD +301 -0
- beamlit-0.0.18.dist-info/RECORD +0 -211
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -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,9 @@ 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
|
+
if not src_dict:
|
85
|
+
return None
|
84
86
|
d = src_dict.copy()
|
85
87
|
last_pod_retention_period = d.pop("last_pod_retention_period", UNSET)
|
86
88
|
|
@@ -0,0 +1,220 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union, cast
|
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="DeploymentServerlessConfigType0")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class DeploymentServerlessConfigType0:
|
13
|
+
"""Configuration for a serverless deployment
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
last_pod_retention_period (Union[None, Unset, str]): The minimum amount of time that the last replica will
|
17
|
+
remain active AFTER a scale-to-zero decision is made
|
18
|
+
max_num_replicas (Union[None, Unset, int]): The maximum number of replicas for the deployment.
|
19
|
+
metric (Union[None, Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
|
20
|
+
"concurrency"
|
21
|
+
min_num_replicas (Union[None, Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in
|
22
|
+
which case the deployment is always running in at least one location).
|
23
|
+
scale_down_delay (Union[None, Unset, str]): The time window which must pass at reduced concurrency before a
|
24
|
+
scale-down decision is applied. This can be useful, for example, to keep containers around for a configurable
|
25
|
+
duration to avoid a cold start penalty if new requests come in.
|
26
|
+
scale_up_minimum (Union[None, Unset, int]): The minimum number of replicas that will be created when the
|
27
|
+
deployment scales up from zero.
|
28
|
+
stable_window (Union[None, Unset, str]): The sliding time window over which metrics are averaged to provide the
|
29
|
+
input for scaling decisions
|
30
|
+
target (Union[None, Unset, str]): Target value for the watched metric
|
31
|
+
"""
|
32
|
+
|
33
|
+
last_pod_retention_period: Union[None, Unset, str] = UNSET
|
34
|
+
max_num_replicas: Union[None, Unset, int] = UNSET
|
35
|
+
metric: Union[None, Unset, str] = UNSET
|
36
|
+
min_num_replicas: Union[None, Unset, int] = UNSET
|
37
|
+
scale_down_delay: Union[None, Unset, str] = UNSET
|
38
|
+
scale_up_minimum: Union[None, Unset, int] = UNSET
|
39
|
+
stable_window: Union[None, Unset, str] = UNSET
|
40
|
+
target: Union[None, Unset, str] = UNSET
|
41
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
|
+
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
44
|
+
last_pod_retention_period: Union[None, Unset, str]
|
45
|
+
if isinstance(self.last_pod_retention_period, Unset):
|
46
|
+
last_pod_retention_period = UNSET
|
47
|
+
else:
|
48
|
+
last_pod_retention_period = self.last_pod_retention_period
|
49
|
+
|
50
|
+
max_num_replicas: Union[None, Unset, int]
|
51
|
+
if isinstance(self.max_num_replicas, Unset):
|
52
|
+
max_num_replicas = UNSET
|
53
|
+
else:
|
54
|
+
max_num_replicas = self.max_num_replicas
|
55
|
+
|
56
|
+
metric: Union[None, Unset, str]
|
57
|
+
if isinstance(self.metric, Unset):
|
58
|
+
metric = UNSET
|
59
|
+
else:
|
60
|
+
metric = self.metric
|
61
|
+
|
62
|
+
min_num_replicas: Union[None, Unset, int]
|
63
|
+
if isinstance(self.min_num_replicas, Unset):
|
64
|
+
min_num_replicas = UNSET
|
65
|
+
else:
|
66
|
+
min_num_replicas = self.min_num_replicas
|
67
|
+
|
68
|
+
scale_down_delay: Union[None, Unset, str]
|
69
|
+
if isinstance(self.scale_down_delay, Unset):
|
70
|
+
scale_down_delay = UNSET
|
71
|
+
else:
|
72
|
+
scale_down_delay = self.scale_down_delay
|
73
|
+
|
74
|
+
scale_up_minimum: Union[None, Unset, int]
|
75
|
+
if isinstance(self.scale_up_minimum, Unset):
|
76
|
+
scale_up_minimum = UNSET
|
77
|
+
else:
|
78
|
+
scale_up_minimum = self.scale_up_minimum
|
79
|
+
|
80
|
+
stable_window: Union[None, Unset, str]
|
81
|
+
if isinstance(self.stable_window, Unset):
|
82
|
+
stable_window = UNSET
|
83
|
+
else:
|
84
|
+
stable_window = self.stable_window
|
85
|
+
|
86
|
+
target: Union[None, Unset, str]
|
87
|
+
if isinstance(self.target, Unset):
|
88
|
+
target = UNSET
|
89
|
+
else:
|
90
|
+
target = self.target
|
91
|
+
|
92
|
+
field_dict: dict[str, Any] = {}
|
93
|
+
field_dict.update(self.additional_properties)
|
94
|
+
field_dict.update({})
|
95
|
+
if last_pod_retention_period is not UNSET:
|
96
|
+
field_dict["last_pod_retention_period"] = last_pod_retention_period
|
97
|
+
if max_num_replicas is not UNSET:
|
98
|
+
field_dict["max_num_replicas"] = max_num_replicas
|
99
|
+
if metric is not UNSET:
|
100
|
+
field_dict["metric"] = metric
|
101
|
+
if min_num_replicas is not UNSET:
|
102
|
+
field_dict["min_num_replicas"] = min_num_replicas
|
103
|
+
if scale_down_delay is not UNSET:
|
104
|
+
field_dict["scale_down_delay"] = scale_down_delay
|
105
|
+
if scale_up_minimum is not UNSET:
|
106
|
+
field_dict["scale_up_minimum"] = scale_up_minimum
|
107
|
+
if stable_window is not UNSET:
|
108
|
+
field_dict["stable_window"] = stable_window
|
109
|
+
if target is not UNSET:
|
110
|
+
field_dict["target"] = target
|
111
|
+
|
112
|
+
return field_dict
|
113
|
+
|
114
|
+
@classmethod
|
115
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
116
|
+
d = src_dict.copy()
|
117
|
+
|
118
|
+
def _parse_last_pod_retention_period(data: object) -> Union[None, Unset, str]:
|
119
|
+
if data is None:
|
120
|
+
return data
|
121
|
+
if isinstance(data, Unset):
|
122
|
+
return data
|
123
|
+
return cast(Union[None, Unset, str], data)
|
124
|
+
|
125
|
+
last_pod_retention_period = _parse_last_pod_retention_period(
|
126
|
+
d.pop("last_pod_retention_period", UNSET)
|
127
|
+
)
|
128
|
+
|
129
|
+
def _parse_max_num_replicas(data: object) -> Union[None, Unset, int]:
|
130
|
+
if data is None:
|
131
|
+
return data
|
132
|
+
if isinstance(data, Unset):
|
133
|
+
return data
|
134
|
+
return cast(Union[None, Unset, int], data)
|
135
|
+
|
136
|
+
max_num_replicas = _parse_max_num_replicas(d.pop("max_num_replicas", UNSET))
|
137
|
+
|
138
|
+
def _parse_metric(data: object) -> Union[None, Unset, str]:
|
139
|
+
if data is None:
|
140
|
+
return data
|
141
|
+
if isinstance(data, Unset):
|
142
|
+
return data
|
143
|
+
return cast(Union[None, Unset, str], data)
|
144
|
+
|
145
|
+
metric = _parse_metric(d.pop("metric", UNSET))
|
146
|
+
|
147
|
+
def _parse_min_num_replicas(data: object) -> Union[None, Unset, int]:
|
148
|
+
if data is None:
|
149
|
+
return data
|
150
|
+
if isinstance(data, Unset):
|
151
|
+
return data
|
152
|
+
return cast(Union[None, Unset, int], data)
|
153
|
+
|
154
|
+
min_num_replicas = _parse_min_num_replicas(d.pop("min_num_replicas", UNSET))
|
155
|
+
|
156
|
+
def _parse_scale_down_delay(data: object) -> Union[None, Unset, str]:
|
157
|
+
if data is None:
|
158
|
+
return data
|
159
|
+
if isinstance(data, Unset):
|
160
|
+
return data
|
161
|
+
return cast(Union[None, Unset, str], data)
|
162
|
+
|
163
|
+
scale_down_delay = _parse_scale_down_delay(d.pop("scale_down_delay", UNSET))
|
164
|
+
|
165
|
+
def _parse_scale_up_minimum(data: object) -> Union[None, Unset, int]:
|
166
|
+
if data is None:
|
167
|
+
return data
|
168
|
+
if isinstance(data, Unset):
|
169
|
+
return data
|
170
|
+
return cast(Union[None, Unset, int], data)
|
171
|
+
|
172
|
+
scale_up_minimum = _parse_scale_up_minimum(d.pop("scale_up_minimum", UNSET))
|
173
|
+
|
174
|
+
def _parse_stable_window(data: object) -> Union[None, Unset, str]:
|
175
|
+
if data is None:
|
176
|
+
return data
|
177
|
+
if isinstance(data, Unset):
|
178
|
+
return data
|
179
|
+
return cast(Union[None, Unset, str], data)
|
180
|
+
|
181
|
+
stable_window = _parse_stable_window(d.pop("stable_window", UNSET))
|
182
|
+
|
183
|
+
def _parse_target(data: object) -> Union[None, Unset, str]:
|
184
|
+
if data is None:
|
185
|
+
return data
|
186
|
+
if isinstance(data, Unset):
|
187
|
+
return data
|
188
|
+
return cast(Union[None, Unset, str], data)
|
189
|
+
|
190
|
+
target = _parse_target(d.pop("target", UNSET))
|
191
|
+
|
192
|
+
deployment_serverless_config_type_0 = cls(
|
193
|
+
last_pod_retention_period=last_pod_retention_period,
|
194
|
+
max_num_replicas=max_num_replicas,
|
195
|
+
metric=metric,
|
196
|
+
min_num_replicas=min_num_replicas,
|
197
|
+
scale_down_delay=scale_down_delay,
|
198
|
+
scale_up_minimum=scale_up_minimum,
|
199
|
+
stable_window=stable_window,
|
200
|
+
target=target,
|
201
|
+
)
|
202
|
+
|
203
|
+
deployment_serverless_config_type_0.additional_properties = d
|
204
|
+
return deployment_serverless_config_type_0
|
205
|
+
|
206
|
+
@property
|
207
|
+
def additional_keys(self) -> list[str]:
|
208
|
+
return list(self.additional_properties.keys())
|
209
|
+
|
210
|
+
def __getitem__(self, key: str) -> Any:
|
211
|
+
return self.additional_properties[key]
|
212
|
+
|
213
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
214
|
+
self.additional_properties[key] = value
|
215
|
+
|
216
|
+
def __delitem__(self, key: str) -> None:
|
217
|
+
del self.additional_properties[key]
|
218
|
+
|
219
|
+
def __contains__(self, key: str) -> bool:
|
220
|
+
return key in self.additional_properties
|
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,9 +93,11 @@ 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
|
+
if not src_dict:
|
100
|
+
return None
|
99
101
|
d = src_dict.copy()
|
100
102
|
created_at = d.pop("created_at", UNSET)
|
101
103
|
|
@@ -126,7 +128,7 @@ class Environment:
|
|
126
128
|
|
127
129
|
name = d.pop("name", UNSET)
|
128
130
|
|
129
|
-
policies = cast(
|
131
|
+
policies = cast(list[Any], d.pop("policies", UNSET))
|
130
132
|
|
131
133
|
workspace = d.pop("workspace", UNSET)
|
132
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,14 +17,23 @@ class EnvironmentMetrics:
|
|
17
17
|
"""Metrics for the environment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
|
20
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
21
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
21
22
|
"""
|
22
23
|
|
23
|
-
|
24
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
25
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
24
26
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
27
|
|
26
28
|
def to_dict(self) -> dict[str, Any]:
|
27
|
-
|
29
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
30
|
+
if not isinstance(self.inference_global, Unset):
|
31
|
+
inference_global = []
|
32
|
+
for componentsschemas_array_metric_item_data in self.inference_global:
|
33
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
34
|
+
inference_global.append(componentsschemas_array_metric_item)
|
35
|
+
|
36
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
37
|
if not isinstance(self.inference_per_second_global, Unset):
|
29
38
|
inference_per_second_global = []
|
30
39
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
@@ -34,16 +43,27 @@ class EnvironmentMetrics:
|
|
34
43
|
field_dict: dict[str, Any] = {}
|
35
44
|
field_dict.update(self.additional_properties)
|
36
45
|
field_dict.update({})
|
46
|
+
if inference_global is not UNSET:
|
47
|
+
field_dict["inference_global"] = inference_global
|
37
48
|
if inference_per_second_global is not UNSET:
|
38
49
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
39
50
|
|
40
51
|
return field_dict
|
41
52
|
|
42
53
|
@classmethod
|
43
|
-
def from_dict(cls:
|
54
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
44
55
|
from ..models.metric import Metric
|
45
56
|
|
57
|
+
if not src_dict:
|
58
|
+
return None
|
46
59
|
d = src_dict.copy()
|
60
|
+
inference_global = []
|
61
|
+
_inference_global = d.pop("inference_global", UNSET)
|
62
|
+
for componentsschemas_array_metric_item_data in _inference_global or []:
|
63
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
64
|
+
|
65
|
+
inference_global.append(componentsschemas_array_metric_item)
|
66
|
+
|
47
67
|
inference_per_second_global = []
|
48
68
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
49
69
|
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
@@ -52,6 +72,7 @@ class EnvironmentMetrics:
|
|
52
72
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
53
73
|
|
54
74
|
environment_metrics = cls(
|
75
|
+
inference_global=inference_global,
|
55
76
|
inference_per_second_global=inference_per_second_global,
|
56
77
|
)
|
57
78
|
|
@@ -0,0 +1,61 @@
|
|
1
|
+
from typing import Any, List, Type, TypeVar, Union, cast
|
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="EnvironmentSpec")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class EnvironmentSpec:
|
13
|
+
"""Environment specification
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
policies (Union[Unset, List[str]]):
|
17
|
+
"""
|
18
|
+
|
19
|
+
policies: Union[Unset, List[str]] = UNSET
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
policies: Union[Unset, List[str]] = UNSET
|
24
|
+
if not isinstance(self.policies, Unset):
|
25
|
+
policies = self.policies
|
26
|
+
|
27
|
+
field_dict: dict[str, Any] = {}
|
28
|
+
field_dict.update(self.additional_properties)
|
29
|
+
field_dict.update({})
|
30
|
+
if policies is not UNSET:
|
31
|
+
field_dict["policies"] = policies
|
32
|
+
|
33
|
+
return field_dict
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
37
|
+
d = src_dict.copy()
|
38
|
+
policies = cast(List[str], d.pop("policies", UNSET))
|
39
|
+
|
40
|
+
environment_spec = cls(
|
41
|
+
policies=policies,
|
42
|
+
)
|
43
|
+
|
44
|
+
environment_spec.additional_properties = d
|
45
|
+
return environment_spec
|
46
|
+
|
47
|
+
@property
|
48
|
+
def additional_keys(self) -> list[str]:
|
49
|
+
return list(self.additional_properties.keys())
|
50
|
+
|
51
|
+
def __getitem__(self, key: str) -> Any:
|
52
|
+
return self.additional_properties[key]
|
53
|
+
|
54
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
55
|
+
self.additional_properties[key] = value
|
56
|
+
|
57
|
+
def __delitem__(self, key: str) -> None:
|
58
|
+
del self.additional_properties[key]
|
59
|
+
|
60
|
+
def __contains__(self, key: str) -> bool:
|
61
|
+
return key in self.additional_properties
|
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,38 +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
|
+
if not src_dict:
|
42
|
+
return None
|
41
43
|
d = src_dict.copy()
|
42
44
|
name = d.pop("name", UNSET)
|
43
45
|
|
44
|
-
|
46
|
+
type_ = d.pop("type", UNSET)
|
45
47
|
|
46
48
|
flavor = cls(
|
47
49
|
name=name,
|
48
|
-
|
50
|
+
type_=type_,
|
49
51
|
)
|
50
52
|
|
51
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,9 +85,11 @@ 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
|
+
if not src_dict:
|
92
|
+
return None
|
91
93
|
d = src_dict.copy()
|
92
94
|
created_at = d.pop("created_at", UNSET)
|
93
95
|
|
@@ -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 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
|
+
if not src_dict:
|
42
|
+
return None
|
41
43
|
d = src_dict.copy()
|
42
44
|
secret = d.pop("secret", UNSET)
|
43
45
|
|