beamlit 0.1.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/__init__.py +8 -0
- beamlit/api/__init__.py +1 -0
- beamlit/api/agents/__init__.py +0 -0
- beamlit/api/agents/create_agent.py +155 -0
- beamlit/api/agents/create_agent_release.py +146 -0
- beamlit/api/agents/delete_agent.py +146 -0
- beamlit/api/agents/delete_agent_deployment.py +163 -0
- beamlit/api/agents/delete_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent.py +146 -0
- beamlit/api/agents/get_agent_deployment.py +163 -0
- beamlit/api/agents/get_agent_deployment_history.py +172 -0
- beamlit/api/agents/get_agent_deployment_logs.py +164 -0
- beamlit/api/agents/get_agent_deployment_metrics.py +159 -0
- beamlit/api/agents/get_agent_metrics.py +150 -0
- beamlit/api/agents/list_agent_deployment_history.py +164 -0
- beamlit/api/agents/list_agent_deployments.py +155 -0
- beamlit/api/agents/list_agents.py +127 -0
- beamlit/api/agents/put_agent_deployment.py +185 -0
- beamlit/api/agents/put_agent_deployment_history.py +198 -0
- beamlit/api/agents/update_agent.py +168 -0
- beamlit/api/authentication_providers/__init__.py +0 -0
- beamlit/api/authentication_providers/get_model_with_repo_for_authentication_provider.py +184 -0
- beamlit/api/authentication_providers/list_models_for_authentication_provider.py +163 -0
- beamlit/api/authentication_providers/list_organizations_for_authentication_provider.py +163 -0
- beamlit/api/configurations/__init__.py +0 -0
- beamlit/api/configurations/get_configuration.py +122 -0
- beamlit/api/environments/__init__.py +0 -0
- beamlit/api/environments/create_environment.py +167 -0
- beamlit/api/environments/delete_environment.py +154 -0
- beamlit/api/environments/get_environment.py +154 -0
- beamlit/api/environments/get_environment_metrics.py +158 -0
- beamlit/api/environments/list_environments.py +139 -0
- beamlit/api/environments/update_environment.py +180 -0
- beamlit/api/functions/__init__.py +0 -0
- beamlit/api/functions/create_function.py +155 -0
- beamlit/api/functions/create_function_release.py +150 -0
- beamlit/api/functions/delete_function.py +146 -0
- beamlit/api/functions/delete_function_deployment.py +163 -0
- beamlit/api/functions/get_function.py +146 -0
- beamlit/api/functions/get_function_deployment.py +163 -0
- beamlit/api/functions/get_function_deployment_logs.py +164 -0
- beamlit/api/functions/get_function_deployment_metrics.py +159 -0
- beamlit/api/functions/get_function_metrics.py +150 -0
- beamlit/api/functions/list_function_deployments.py +155 -0
- beamlit/api/functions/list_functions.py +131 -0
- beamlit/api/functions/put_function_deployment.py +185 -0
- beamlit/api/functions/update_function.py +168 -0
- beamlit/api/history/__init__.py +0 -0
- beamlit/api/history/get_agents_history.py +155 -0
- beamlit/api/history/list_agents_history.py +131 -0
- beamlit/api/invitations/__init__.py +0 -0
- beamlit/api/invitations/list_all_pending_invitations.py +142 -0
- beamlit/api/locations/__init__.py +0 -0
- beamlit/api/locations/list_locations.py +139 -0
- beamlit/api/metrics/__init__.py +0 -0
- beamlit/api/metrics/get_metrics.py +130 -0
- beamlit/api/model_providers/__init__.py +0 -0
- beamlit/api/model_providers/create_model_provider.py +163 -0
- beamlit/api/model_providers/delete_model_provider.py +154 -0
- beamlit/api/model_providers/get_model_provider.py +154 -0
- beamlit/api/model_providers/list_model_providers.py +139 -0
- beamlit/api/model_providers/update_model_provider.py +176 -0
- beamlit/api/models/__init__.py +0 -0
- beamlit/api/models/create_model.py +168 -0
- beamlit/api/models/delete_model.py +154 -0
- beamlit/api/models/delete_model_deployment.py +171 -0
- beamlit/api/models/get_model.py +154 -0
- beamlit/api/models/get_model_deployment.py +171 -0
- beamlit/api/models/get_model_deployment_logs.py +168 -0
- beamlit/api/models/get_model_deployment_metrics.py +163 -0
- beamlit/api/models/get_model_metrics.py +154 -0
- beamlit/api/models/list_model_deployments.py +163 -0
- beamlit/api/models/list_models.py +135 -0
- beamlit/api/models/put_model_deployment.py +193 -0
- beamlit/api/models/release_model.py +154 -0
- beamlit/api/models/update_model.py +181 -0
- beamlit/api/policies/__init__.py +0 -0
- beamlit/api/policies/create_policy.py +167 -0
- beamlit/api/policies/delete_policy.py +154 -0
- beamlit/api/policies/get_policy.py +154 -0
- beamlit/api/policies/list_policies.py +139 -0
- beamlit/api/policies/update_policy.py +180 -0
- beamlit/api/service_accounts/__init__.py +0 -0
- beamlit/api/service_accounts/create_api_key_for_service_account.py +177 -0
- beamlit/api/service_accounts/create_workspace_service_account.py +168 -0
- beamlit/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- beamlit/api/service_accounts/delete_workspace_service_account.py +158 -0
- beamlit/api/service_accounts/get_workspace_service_accounts.py +139 -0
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- beamlit/api/service_accounts/update_workspace_service_account.py +181 -0
- beamlit/api/store/__init__.py +0 -0
- beamlit/api/store/get_store_agent.py +146 -0
- beamlit/api/store/get_store_function.py +146 -0
- beamlit/api/store/list_store_agents.py +131 -0
- beamlit/api/store/list_store_functions.py +131 -0
- beamlit/api/workspaces/__init__.py +0 -0
- beamlit/api/workspaces/accept_workspace_invitation.py +161 -0
- beamlit/api/workspaces/create_worspace.py +163 -0
- beamlit/api/workspaces/decline_workspace_invitation.py +158 -0
- beamlit/api/workspaces/delete_workspace.py +154 -0
- beamlit/api/workspaces/get_workspace.py +154 -0
- beamlit/api/workspaces/invite_workspace_user.py +174 -0
- beamlit/api/workspaces/leave_workspace.py +161 -0
- beamlit/api/workspaces/list_workspace_users.py +139 -0
- beamlit/api/workspaces/list_workspaces.py +139 -0
- beamlit/api/workspaces/remove_workspace_user.py +101 -0
- beamlit/api/workspaces/update_workspace.py +176 -0
- beamlit/api/workspaces/update_workspace_user_role.py +187 -0
- beamlit/authentication/__init__.py +24 -0
- beamlit/authentication/apikey.py +14 -0
- beamlit/authentication/authentication.py +35 -0
- beamlit/authentication/credentials.py +165 -0
- beamlit/authentication/device_mode.py +115 -0
- beamlit/client.py +270 -0
- beamlit/errors.py +16 -0
- beamlit/models/__init__.py +189 -0
- beamlit/models/acl.py +149 -0
- beamlit/models/agent.py +151 -0
- beamlit/models/agent_chain.py +77 -0
- beamlit/models/agent_configuration.py +68 -0
- beamlit/models/agent_deployment.py +327 -0
- beamlit/models/agent_deployment_configuration.py +43 -0
- beamlit/models/agent_deployment_history.py +183 -0
- beamlit/models/agent_deployment_history_event.py +131 -0
- beamlit/models/agent_deployment_pod_template.py +43 -0
- beamlit/models/agent_release.py +68 -0
- beamlit/models/api_key.py +140 -0
- beamlit/models/authentication_provider_model.py +142 -0
- beamlit/models/authentication_provider_organization.py +86 -0
- beamlit/models/configuration.py +72 -0
- beamlit/models/continent.py +68 -0
- beamlit/models/country.py +68 -0
- beamlit/models/create_api_key_for_service_account_body.py +67 -0
- beamlit/models/create_workspace_service_account_body.py +69 -0
- beamlit/models/create_workspace_service_account_response_200.py +103 -0
- beamlit/models/delete_workspace_service_account_response_200.py +94 -0
- beamlit/models/deployment_configuration.py +68 -0
- beamlit/models/deployment_configurations.py +43 -0
- beamlit/models/deployment_serverless_config.py +129 -0
- beamlit/models/environment.py +162 -0
- beamlit/models/environment_metrics.py +75 -0
- beamlit/models/flavor.py +68 -0
- beamlit/models/function.py +151 -0
- beamlit/models/function_configuration.py +68 -0
- beamlit/models/function_deployment.py +327 -0
- beamlit/models/function_deployment_configuration.py +43 -0
- beamlit/models/function_deployment_pod_template.py +43 -0
- beamlit/models/function_kit.py +95 -0
- beamlit/models/function_provider_ref.py +68 -0
- beamlit/models/function_release.py +68 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +94 -0
- beamlit/models/invite_workspace_user_body.py +58 -0
- beamlit/models/labels.py +43 -0
- beamlit/models/labels_type_0.py +43 -0
- beamlit/models/location.py +120 -0
- beamlit/models/location_response.py +111 -0
- beamlit/models/metric.py +68 -0
- beamlit/models/metrics.py +111 -0
- beamlit/models/model.py +151 -0
- beamlit/models/model_deployment.py +283 -0
- beamlit/models/model_deployment_log.py +68 -0
- beamlit/models/model_deployment_metrics.py +170 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/model_deployment_pod_template.py +43 -0
- beamlit/models/model_metrics.py +94 -0
- beamlit/models/model_provider.py +187 -0
- beamlit/models/model_provider_ref.py +68 -0
- beamlit/models/model_release.py +68 -0
- beamlit/models/model_with_deployments.py +174 -0
- beamlit/models/pending_invitation.py +122 -0
- beamlit/models/pending_invitation_accept.py +81 -0
- beamlit/models/pending_invitation_render.py +135 -0
- beamlit/models/pending_invitation_render_invited_by.py +86 -0
- beamlit/models/pending_invitation_render_workspace.py +68 -0
- beamlit/models/pending_invitation_workspace_details.py +70 -0
- beamlit/models/policy.py +216 -0
- beamlit/models/policy_location.py +68 -0
- beamlit/models/provider_config.py +101 -0
- beamlit/models/qps.py +59 -0
- beamlit/models/resource_deployment_log.py +68 -0
- beamlit/models/resource_deployment_metrics.py +172 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_metrics.py +94 -0
- beamlit/models/runtime.py +152 -0
- beamlit/models/runtime_readiness_probe.py +43 -0
- beamlit/models/runtime_resources.py +43 -0
- beamlit/models/serverless_config.py +122 -0
- beamlit/models/standard_fields_dynamo_db.py +86 -0
- beamlit/models/store_agent.py +165 -0
- beamlit/models/store_agent_configuration.py +95 -0
- beamlit/models/store_agent_labels.py +43 -0
- beamlit/models/store_configuration.py +149 -0
- beamlit/models/store_configuration_option.py +77 -0
- beamlit/models/store_function.py +207 -0
- beamlit/models/store_function_configuration.py +95 -0
- beamlit/models/store_function_kit.py +95 -0
- beamlit/models/store_function_labels.py +43 -0
- beamlit/models/store_function_parameter.py +86 -0
- beamlit/models/update_workspace_service_account_body.py +67 -0
- beamlit/models/update_workspace_service_account_response_200.py +94 -0
- beamlit/models/update_workspace_user_role_body.py +58 -0
- beamlit/models/workspace.py +126 -0
- beamlit/models/workspace_labels.py +43 -0
- beamlit/models/workspace_user.py +113 -0
- beamlit/py.typed +1 -0
- beamlit/types.py +46 -0
- beamlit-0.1.0.dist-info/METADATA +59 -0
- beamlit-0.1.0.dist-info/RECORD +211 -0
- beamlit-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="DeploymentConfigurations")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class DeploymentConfigurations:
|
11
|
+
"""Deployment configurations key value and also a boolean secret to specify if it should be stored in secret manager"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
d = src_dict.copy()
|
24
|
+
deployment_configurations = cls()
|
25
|
+
|
26
|
+
deployment_configurations.additional_properties = d
|
27
|
+
return deployment_configurations
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> str:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: str) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -0,0 +1,129 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="DeploymentServerlessConfig")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class DeploymentServerlessConfig:
|
13
|
+
"""Configuration for a serverless deployment
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
last_pod_retention_period (Union[Unset, str]): The minimum amount of time that the last replica will remain
|
17
|
+
active AFTER a scale-to-zero decision is made
|
18
|
+
max_num_replicas (Union[Unset, int]): The maximum number of replicas for the deployment.
|
19
|
+
metric (Union[Unset, str]): Metric watched to make scaling decisions. Can be "cpu" or "memory" or "rps" or
|
20
|
+
"concurrency"
|
21
|
+
min_num_replicas (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which
|
22
|
+
case the deployment is always running in at least one location).
|
23
|
+
scale_down_delay (Union[Unset, str]): The time window which must pass at reduced concurrency before a scale-down
|
24
|
+
decision is applied. This can be useful, for example, to keep containers around for a configurable duration to
|
25
|
+
avoid a cold start penalty if new requests come in.
|
26
|
+
scale_up_minimum (Union[Unset, int]): The minimum number of replicas that will be created when the deployment
|
27
|
+
scales up from zero.
|
28
|
+
stable_window (Union[Unset, str]): The sliding time window over which metrics are averaged to provide the input
|
29
|
+
for scaling decisions
|
30
|
+
target (Union[Unset, str]): Target value for the watched metric
|
31
|
+
"""
|
32
|
+
|
33
|
+
last_pod_retention_period: Union[Unset, str] = UNSET
|
34
|
+
max_num_replicas: Union[Unset, int] = UNSET
|
35
|
+
metric: Union[Unset, str] = UNSET
|
36
|
+
min_num_replicas: Union[Unset, int] = UNSET
|
37
|
+
scale_down_delay: Union[Unset, str] = UNSET
|
38
|
+
scale_up_minimum: Union[Unset, int] = UNSET
|
39
|
+
stable_window: Union[Unset, str] = UNSET
|
40
|
+
target: Union[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 = self.last_pod_retention_period
|
45
|
+
|
46
|
+
max_num_replicas = self.max_num_replicas
|
47
|
+
|
48
|
+
metric = self.metric
|
49
|
+
|
50
|
+
min_num_replicas = self.min_num_replicas
|
51
|
+
|
52
|
+
scale_down_delay = self.scale_down_delay
|
53
|
+
|
54
|
+
scale_up_minimum = self.scale_up_minimum
|
55
|
+
|
56
|
+
stable_window = self.stable_window
|
57
|
+
|
58
|
+
target = self.target
|
59
|
+
|
60
|
+
field_dict: dict[str, Any] = {}
|
61
|
+
field_dict.update(self.additional_properties)
|
62
|
+
field_dict.update({})
|
63
|
+
if last_pod_retention_period is not UNSET:
|
64
|
+
field_dict["last_pod_retention_period"] = last_pod_retention_period
|
65
|
+
if max_num_replicas is not UNSET:
|
66
|
+
field_dict["max_num_replicas"] = max_num_replicas
|
67
|
+
if metric is not UNSET:
|
68
|
+
field_dict["metric"] = metric
|
69
|
+
if min_num_replicas is not UNSET:
|
70
|
+
field_dict["min_num_replicas"] = min_num_replicas
|
71
|
+
if scale_down_delay is not UNSET:
|
72
|
+
field_dict["scale_down_delay"] = scale_down_delay
|
73
|
+
if scale_up_minimum is not UNSET:
|
74
|
+
field_dict["scale_up_minimum"] = scale_up_minimum
|
75
|
+
if stable_window is not UNSET:
|
76
|
+
field_dict["stable_window"] = stable_window
|
77
|
+
if target is not UNSET:
|
78
|
+
field_dict["target"] = target
|
79
|
+
|
80
|
+
return field_dict
|
81
|
+
|
82
|
+
@classmethod
|
83
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
84
|
+
d = src_dict.copy()
|
85
|
+
last_pod_retention_period = d.pop("last_pod_retention_period", UNSET)
|
86
|
+
|
87
|
+
max_num_replicas = d.pop("max_num_replicas", UNSET)
|
88
|
+
|
89
|
+
metric = d.pop("metric", UNSET)
|
90
|
+
|
91
|
+
min_num_replicas = d.pop("min_num_replicas", UNSET)
|
92
|
+
|
93
|
+
scale_down_delay = d.pop("scale_down_delay", UNSET)
|
94
|
+
|
95
|
+
scale_up_minimum = d.pop("scale_up_minimum", UNSET)
|
96
|
+
|
97
|
+
stable_window = d.pop("stable_window", UNSET)
|
98
|
+
|
99
|
+
target = d.pop("target", UNSET)
|
100
|
+
|
101
|
+
deployment_serverless_config = cls(
|
102
|
+
last_pod_retention_period=last_pod_retention_period,
|
103
|
+
max_num_replicas=max_num_replicas,
|
104
|
+
metric=metric,
|
105
|
+
min_num_replicas=min_num_replicas,
|
106
|
+
scale_down_delay=scale_down_delay,
|
107
|
+
scale_up_minimum=scale_up_minimum,
|
108
|
+
stable_window=stable_window,
|
109
|
+
target=target,
|
110
|
+
)
|
111
|
+
|
112
|
+
deployment_serverless_config.additional_properties = d
|
113
|
+
return deployment_serverless_config
|
114
|
+
|
115
|
+
@property
|
116
|
+
def additional_keys(self) -> list[str]:
|
117
|
+
return list(self.additional_properties.keys())
|
118
|
+
|
119
|
+
def __getitem__(self, key: str) -> Any:
|
120
|
+
return self.additional_properties[key]
|
121
|
+
|
122
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
123
|
+
self.additional_properties[key] = value
|
124
|
+
|
125
|
+
def __delitem__(self, key: str) -> None:
|
126
|
+
del self.additional_properties[key]
|
127
|
+
|
128
|
+
def __contains__(self, key: str) -> bool:
|
129
|
+
return key in self.additional_properties
|
@@ -0,0 +1,162 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, 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
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.labels_type_0 import LabelsType0
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="Environment")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class Environment:
|
17
|
+
"""Environment on which deployments will be made (e.g. development, production), enforcing multiple policies at once.
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
21
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
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]): The display name of the environment
|
25
|
+
labels (Union['LabelsType0', None, Unset]): Labels
|
26
|
+
name (Union[Unset, str]): The name of the environment
|
27
|
+
policies (Union[Unset, List[Any]]): The policies attached to the environment
|
28
|
+
workspace (Union[Unset, str]): The workspace the environment belongs to
|
29
|
+
"""
|
30
|
+
|
31
|
+
created_at: Union[Unset, str] = UNSET
|
32
|
+
created_by: Union[Unset, str] = UNSET
|
33
|
+
updated_at: Union[Unset, str] = UNSET
|
34
|
+
updated_by: Union[Unset, str] = UNSET
|
35
|
+
display_name: Union[Unset, str] = UNSET
|
36
|
+
labels: Union["LabelsType0", None, Unset] = UNSET
|
37
|
+
name: Union[Unset, str] = UNSET
|
38
|
+
policies: Union[Unset, List[Any]] = UNSET
|
39
|
+
workspace: Union[Unset, str] = UNSET
|
40
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
41
|
+
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
43
|
+
from ..models.labels_type_0 import LabelsType0
|
44
|
+
|
45
|
+
created_at = self.created_at
|
46
|
+
|
47
|
+
created_by = self.created_by
|
48
|
+
|
49
|
+
updated_at = self.updated_at
|
50
|
+
|
51
|
+
updated_by = self.updated_by
|
52
|
+
|
53
|
+
display_name = self.display_name
|
54
|
+
|
55
|
+
labels: Union[Dict[str, Any], None, Unset]
|
56
|
+
if isinstance(self.labels, Unset):
|
57
|
+
labels = UNSET
|
58
|
+
elif isinstance(self.labels, LabelsType0):
|
59
|
+
labels = self.labels.to_dict()
|
60
|
+
else:
|
61
|
+
labels = self.labels
|
62
|
+
|
63
|
+
name = self.name
|
64
|
+
|
65
|
+
policies: Union[Unset, List[Any]] = UNSET
|
66
|
+
if not isinstance(self.policies, Unset):
|
67
|
+
policies = self.policies
|
68
|
+
|
69
|
+
workspace = self.workspace
|
70
|
+
|
71
|
+
field_dict: dict[str, Any] = {}
|
72
|
+
field_dict.update(self.additional_properties)
|
73
|
+
field_dict.update({})
|
74
|
+
if created_at is not UNSET:
|
75
|
+
field_dict["created_at"] = created_at
|
76
|
+
if created_by is not UNSET:
|
77
|
+
field_dict["created_by"] = created_by
|
78
|
+
if updated_at is not UNSET:
|
79
|
+
field_dict["updated_at"] = updated_at
|
80
|
+
if updated_by is not UNSET:
|
81
|
+
field_dict["updated_by"] = updated_by
|
82
|
+
if display_name is not UNSET:
|
83
|
+
field_dict["display_name"] = display_name
|
84
|
+
if labels is not UNSET:
|
85
|
+
field_dict["labels"] = labels
|
86
|
+
if name is not UNSET:
|
87
|
+
field_dict["name"] = name
|
88
|
+
if policies is not UNSET:
|
89
|
+
field_dict["policies"] = policies
|
90
|
+
if workspace is not UNSET:
|
91
|
+
field_dict["workspace"] = workspace
|
92
|
+
|
93
|
+
return field_dict
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
97
|
+
from ..models.labels_type_0 import LabelsType0
|
98
|
+
|
99
|
+
d = src_dict.copy()
|
100
|
+
created_at = d.pop("created_at", UNSET)
|
101
|
+
|
102
|
+
created_by = d.pop("created_by", UNSET)
|
103
|
+
|
104
|
+
updated_at = d.pop("updated_at", UNSET)
|
105
|
+
|
106
|
+
updated_by = d.pop("updated_by", UNSET)
|
107
|
+
|
108
|
+
display_name = d.pop("display_name", UNSET)
|
109
|
+
|
110
|
+
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
111
|
+
if data is None:
|
112
|
+
return data
|
113
|
+
if isinstance(data, Unset):
|
114
|
+
return data
|
115
|
+
try:
|
116
|
+
if not isinstance(data, dict):
|
117
|
+
raise TypeError()
|
118
|
+
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
119
|
+
|
120
|
+
return componentsschemas_labels_type_0
|
121
|
+
except: # noqa: E722
|
122
|
+
pass
|
123
|
+
return cast(Union["LabelsType0", None, Unset], data)
|
124
|
+
|
125
|
+
labels = _parse_labels(d.pop("labels", UNSET))
|
126
|
+
|
127
|
+
name = d.pop("name", UNSET)
|
128
|
+
|
129
|
+
policies = cast(List[Any], d.pop("policies", UNSET))
|
130
|
+
|
131
|
+
workspace = d.pop("workspace", UNSET)
|
132
|
+
|
133
|
+
environment = cls(
|
134
|
+
created_at=created_at,
|
135
|
+
created_by=created_by,
|
136
|
+
updated_at=updated_at,
|
137
|
+
updated_by=updated_by,
|
138
|
+
display_name=display_name,
|
139
|
+
labels=labels,
|
140
|
+
name=name,
|
141
|
+
policies=policies,
|
142
|
+
workspace=workspace,
|
143
|
+
)
|
144
|
+
|
145
|
+
environment.additional_properties = d
|
146
|
+
return environment
|
147
|
+
|
148
|
+
@property
|
149
|
+
def additional_keys(self) -> list[str]:
|
150
|
+
return list(self.additional_properties.keys())
|
151
|
+
|
152
|
+
def __getitem__(self, key: str) -> Any:
|
153
|
+
return self.additional_properties[key]
|
154
|
+
|
155
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
156
|
+
self.additional_properties[key] = value
|
157
|
+
|
158
|
+
def __delitem__(self, key: str) -> None:
|
159
|
+
del self.additional_properties[key]
|
160
|
+
|
161
|
+
def __contains__(self, key: str) -> bool:
|
162
|
+
return key in self.additional_properties
|
@@ -0,0 +1,75 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.metric import Metric
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="EnvironmentMetrics")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class EnvironmentMetrics:
|
17
|
+
"""Metrics for the environment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
21
|
+
"""
|
22
|
+
|
23
|
+
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
28
|
+
if not isinstance(self.inference_per_second_global, Unset):
|
29
|
+
inference_per_second_global = []
|
30
|
+
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
31
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
32
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
33
|
+
|
34
|
+
field_dict: dict[str, Any] = {}
|
35
|
+
field_dict.update(self.additional_properties)
|
36
|
+
field_dict.update({})
|
37
|
+
if inference_per_second_global is not UNSET:
|
38
|
+
field_dict["inference_per_second_global"] = inference_per_second_global
|
39
|
+
|
40
|
+
return field_dict
|
41
|
+
|
42
|
+
@classmethod
|
43
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
44
|
+
from ..models.metric import Metric
|
45
|
+
|
46
|
+
d = src_dict.copy()
|
47
|
+
inference_per_second_global = []
|
48
|
+
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
49
|
+
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
50
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
51
|
+
|
52
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
53
|
+
|
54
|
+
environment_metrics = cls(
|
55
|
+
inference_per_second_global=inference_per_second_global,
|
56
|
+
)
|
57
|
+
|
58
|
+
environment_metrics.additional_properties = d
|
59
|
+
return environment_metrics
|
60
|
+
|
61
|
+
@property
|
62
|
+
def additional_keys(self) -> list[str]:
|
63
|
+
return list(self.additional_properties.keys())
|
64
|
+
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
66
|
+
return self.additional_properties[key]
|
67
|
+
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
69
|
+
self.additional_properties[key] = value
|
70
|
+
|
71
|
+
def __delitem__(self, key: str) -> None:
|
72
|
+
del self.additional_properties[key]
|
73
|
+
|
74
|
+
def __contains__(self, key: str) -> bool:
|
75
|
+
return key in self.additional_properties
|
beamlit/models/flavor.py
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="Flavor")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class Flavor:
|
13
|
+
"""A type of hardware available for deployments
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
name (Union[Unset, str]): Flavor name (e.g. t4)
|
17
|
+
type (Union[Unset, str]): Flavor type (e.g. cpu, gpu)
|
18
|
+
"""
|
19
|
+
|
20
|
+
name: Union[Unset, str] = UNSET
|
21
|
+
type: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
name = self.name
|
26
|
+
|
27
|
+
type = self.type
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if name is not UNSET:
|
33
|
+
field_dict["name"] = name
|
34
|
+
if type is not UNSET:
|
35
|
+
field_dict["type"] = type
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
name = d.pop("name", UNSET)
|
43
|
+
|
44
|
+
type = d.pop("type", UNSET)
|
45
|
+
|
46
|
+
flavor = cls(
|
47
|
+
name=name,
|
48
|
+
type=type,
|
49
|
+
)
|
50
|
+
|
51
|
+
flavor.additional_properties = d
|
52
|
+
return flavor
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
@@ -0,0 +1,151 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, 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
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.labels_type_0 import LabelsType0
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="Function")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class Function:
|
17
|
+
"""Function parent of FunctionDeployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
21
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
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]): Function display name
|
25
|
+
labels (Union['LabelsType0', None, Unset]): Labels
|
26
|
+
name (Union[Unset, str]): Function name
|
27
|
+
workspace (Union[Unset, str]): Workspace name
|
28
|
+
"""
|
29
|
+
|
30
|
+
created_at: Union[Unset, str] = UNSET
|
31
|
+
created_by: Union[Unset, str] = UNSET
|
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
|
38
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
|
+
|
40
|
+
def to_dict(self) -> dict[str, Any]:
|
41
|
+
from ..models.labels_type_0 import LabelsType0
|
42
|
+
|
43
|
+
created_at = self.created_at
|
44
|
+
|
45
|
+
created_by = self.created_by
|
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[Dict[str, Any], None, Unset]
|
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
|
64
|
+
|
65
|
+
field_dict: dict[str, Any] = {}
|
66
|
+
field_dict.update(self.additional_properties)
|
67
|
+
field_dict.update({})
|
68
|
+
if created_at is not UNSET:
|
69
|
+
field_dict["created_at"] = created_at
|
70
|
+
if created_by is not UNSET:
|
71
|
+
field_dict["created_by"] = created_by
|
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
|
84
|
+
|
85
|
+
return field_dict
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
89
|
+
from ..models.labels_type_0 import LabelsType0
|
90
|
+
|
91
|
+
d = src_dict.copy()
|
92
|
+
created_at = d.pop("created_at", UNSET)
|
93
|
+
|
94
|
+
created_by = d.pop("created_by", UNSET)
|
95
|
+
|
96
|
+
updated_at = d.pop("updated_at", UNSET)
|
97
|
+
|
98
|
+
updated_by = d.pop("updated_by", UNSET)
|
99
|
+
|
100
|
+
display_name = d.pop("display_name", UNSET)
|
101
|
+
|
102
|
+
def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
|
103
|
+
if data is None:
|
104
|
+
return data
|
105
|
+
if isinstance(data, Unset):
|
106
|
+
return data
|
107
|
+
try:
|
108
|
+
if not isinstance(data, dict):
|
109
|
+
raise TypeError()
|
110
|
+
componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
|
111
|
+
|
112
|
+
return componentsschemas_labels_type_0
|
113
|
+
except: # noqa: E722
|
114
|
+
pass
|
115
|
+
return cast(Union["LabelsType0", None, Unset], data)
|
116
|
+
|
117
|
+
labels = _parse_labels(d.pop("labels", UNSET))
|
118
|
+
|
119
|
+
name = d.pop("name", UNSET)
|
120
|
+
|
121
|
+
workspace = d.pop("workspace", UNSET)
|
122
|
+
|
123
|
+
function = cls(
|
124
|
+
created_at=created_at,
|
125
|
+
created_by=created_by,
|
126
|
+
updated_at=updated_at,
|
127
|
+
updated_by=updated_by,
|
128
|
+
display_name=display_name,
|
129
|
+
labels=labels,
|
130
|
+
name=name,
|
131
|
+
workspace=workspace,
|
132
|
+
)
|
133
|
+
|
134
|
+
function.additional_properties = d
|
135
|
+
return function
|
136
|
+
|
137
|
+
@property
|
138
|
+
def additional_keys(self) -> list[str]:
|
139
|
+
return list(self.additional_properties.keys())
|
140
|
+
|
141
|
+
def __getitem__(self, key: str) -> Any:
|
142
|
+
return self.additional_properties[key]
|
143
|
+
|
144
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
145
|
+
self.additional_properties[key] = value
|
146
|
+
|
147
|
+
def __delitem__(self, key: str) -> None:
|
148
|
+
del self.additional_properties[key]
|
149
|
+
|
150
|
+
def __contains__(self, key: str) -> bool:
|
151
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="FunctionConfiguration")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class FunctionConfiguration:
|
13
|
+
"""Function configuration, this is a key value storage. In your function you can retrieve the value with config[key]
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
secret (Union[Unset, bool]): Function configuration secret
|
17
|
+
value (Union[Unset, str]): Function configuration value
|
18
|
+
"""
|
19
|
+
|
20
|
+
secret: Union[Unset, bool] = UNSET
|
21
|
+
value: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
secret = self.secret
|
26
|
+
|
27
|
+
value = self.value
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if secret is not UNSET:
|
33
|
+
field_dict["secret"] = secret
|
34
|
+
if value is not UNSET:
|
35
|
+
field_dict["value"] = value
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
secret = d.pop("secret", UNSET)
|
43
|
+
|
44
|
+
value = d.pop("value", UNSET)
|
45
|
+
|
46
|
+
function_configuration = cls(
|
47
|
+
secret=secret,
|
48
|
+
value=value,
|
49
|
+
)
|
50
|
+
|
51
|
+
function_configuration.additional_properties = d
|
52
|
+
return function_configuration
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|