beamlit 0.0.20rc2__py3-none-any.whl → 0.0.20rc4__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/api/agents/delete_agent_history.py +155 -0
- beamlit/api/agents/get_agent_deployment.py +1 -22
- beamlit/api/agents/get_agent_environment_logs.py +151 -0
- beamlit/api/agents/get_agent_history.py +155 -0
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/put_agent_history.py +181 -0
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/models/get_model_environment_logs.py +155 -0
- beamlit/common/generate.py +8 -3
- beamlit/common/settings.py +1 -6
- beamlit/models/__init__.py +28 -30
- beamlit/models/acl.py +2 -0
- beamlit/models/agent.py +2 -0
- beamlit/models/agent_chain.py +2 -0
- beamlit/models/agent_configuration.py +2 -0
- beamlit/models/agent_deployment.py +44 -99
- beamlit/models/agent_deployment_configuration.py +45 -0
- beamlit/models/agent_deployment_history.py +15 -46
- beamlit/models/agent_deployment_history_event.py +24 -78
- beamlit/models/agent_deployment_pod_template.py +45 -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 +2 -0
- beamlit/models/agent_spec.py +238 -0
- beamlit/models/agent_with_deployments.py +2 -0
- beamlit/models/api_key.py +2 -0
- beamlit/models/authentication_provider_model.py +2 -0
- beamlit/models/authentication_provider_organization.py +2 -0
- beamlit/models/configuration.py +2 -0
- beamlit/models/continent.py +2 -0
- beamlit/models/core_spec.py +179 -0
- beamlit/models/country.py +2 -0
- beamlit/models/create_api_key_for_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_response_200.py +2 -0
- beamlit/models/delete_workspace_service_account_response_200.py +2 -0
- beamlit/models/deployment_configuration.py +2 -0
- beamlit/models/deployment_configurations.py +2 -0
- beamlit/models/deployment_serverless_config.py +131 -0
- beamlit/models/environment.py +2 -0
- beamlit/models/environment_metrics.py +2 -0
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +2 -0
- beamlit/models/function.py +2 -0
- beamlit/models/function_configuration.py +2 -0
- beamlit/models/function_deployment.py +44 -99
- beamlit/models/function_deployment_configuration.py +45 -0
- beamlit/models/function_deployment_pod_template.py +45 -0
- beamlit/models/function_kit.py +2 -0
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +2 -0
- beamlit/models/function_release.py +2 -0
- beamlit/models/function_spec.py +240 -0
- beamlit/models/function_with_deployments.py +2 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
- beamlit/models/increase_and_rate_metric.py +2 -0
- beamlit/models/integration.py +2 -0
- beamlit/models/integration_config.py +2 -0
- beamlit/models/integration_connection.py +2 -0
- beamlit/models/integration_connection_config.py +2 -0
- beamlit/models/integration_connection_secret.py +2 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +2 -0
- beamlit/models/integration_secret.py +2 -0
- beamlit/models/invite_workspace_user_body.py +2 -0
- beamlit/models/labels_type_0.py +2 -0
- beamlit/models/location.py +2 -0
- beamlit/models/location_response.py +2 -0
- beamlit/models/metadata.py +135 -0
- beamlit/models/metadata_labels.py +43 -0
- beamlit/models/metric.py +2 -0
- beamlit/models/metrics.py +2 -0
- beamlit/models/model.py +2 -0
- beamlit/models/model_deployment.py +66 -85
- beamlit/models/model_deployment_log.py +2 -0
- beamlit/models/model_deployment_metrics.py +2 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
- beamlit/models/model_deployment_pod_template.py +45 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +2 -0
- beamlit/models/model_provider.py +2 -0
- beamlit/models/model_provider_ref.py +2 -0
- beamlit/models/model_release.py +2 -0
- beamlit/models/model_spec.py +188 -0
- beamlit/models/model_with_deployments.py +2 -0
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +2 -0
- beamlit/models/pending_invitation_accept.py +2 -0
- beamlit/models/pending_invitation_render.py +2 -0
- beamlit/models/pending_invitation_render_invited_by.py +2 -0
- beamlit/models/pending_invitation_render_workspace.py +2 -0
- beamlit/models/pending_invitation_workspace_details.py +2 -0
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +36 -8
- beamlit/models/policy_location.py +2 -0
- beamlit/models/policy_spec.py +119 -0
- beamlit/models/provider_config.py +2 -0
- beamlit/models/qps.py +2 -0
- beamlit/models/resource_deployment_log.py +2 -0
- beamlit/models/resource_deployment_metrics.py +70 -155
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
- beamlit/models/resource_environment_metrics.py +172 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -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 +2 -0
- beamlit/models/runtime.py +14 -29
- beamlit/models/runtime_readiness_probe.py +45 -0
- beamlit/models/runtime_resources.py +2 -0
- 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 +2 -0
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +2 -0
- beamlit/models/store_agent.py +15 -29
- beamlit/models/store_agent_configuration.py +2 -0
- beamlit/models/store_agent_labels.py +45 -0
- beamlit/models/store_configuration.py +6 -15
- beamlit/models/store_configuration_option.py +7 -18
- beamlit/models/store_function.py +15 -29
- beamlit/models/store_function_configuration.py +2 -0
- beamlit/models/store_function_kit.py +2 -0
- beamlit/models/store_function_labels.py +45 -0
- beamlit/models/store_function_parameter.py +2 -0
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +2 -0
- beamlit/models/update_workspace_service_account_response_200.py +2 -0
- beamlit/models/update_workspace_user_role_body.py +2 -0
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +2 -0
- beamlit/models/workspace_labels.py +2 -0
- beamlit/models/workspace_user.py +2 -0
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
- {beamlit-0.0.20rc2.dist-info → beamlit-0.0.20rc4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,238 @@
|
|
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.agent_chain import AgentChain
|
10
|
+
from ..models.flavor import Flavor
|
11
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
12
|
+
from ..models.runtime import Runtime
|
13
|
+
from ..models.serverless_config import ServerlessConfig
|
14
|
+
from ..models.spec_configuration import SpecConfiguration
|
15
|
+
|
16
|
+
|
17
|
+
T = TypeVar("T", bound="AgentSpec")
|
18
|
+
|
19
|
+
|
20
|
+
@_attrs_define
|
21
|
+
class AgentSpec:
|
22
|
+
"""Agent specification
|
23
|
+
|
24
|
+
Attributes:
|
25
|
+
configurations (Union[Unset, SpecConfiguration]): Agent configuration, this is a key value storage. In your
|
26
|
+
agent you can retrieve the value with config[key]
|
27
|
+
enabled (Union[Unset, bool]): Enable or disable the agent
|
28
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
29
|
+
integration_connections (Union[Unset, List[str]]):
|
30
|
+
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
31
|
+
policies (Union[Unset, List[str]]):
|
32
|
+
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
33
|
+
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
34
|
+
agent_chain (Union[Unset, List['AgentChain']]): Agent chain
|
35
|
+
description (Union[Unset, str]): Agent description
|
36
|
+
functions (Union[Unset, List[str]]):
|
37
|
+
model (Union[Unset, str]): Model name
|
38
|
+
store_id (Union[Unset, str]): Store id
|
39
|
+
"""
|
40
|
+
|
41
|
+
configurations: Union[Unset, "SpecConfiguration"] = UNSET
|
42
|
+
enabled: Union[Unset, bool] = UNSET
|
43
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
44
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
45
|
+
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
46
|
+
policies: Union[Unset, List[str]] = UNSET
|
47
|
+
runtime: Union[Unset, "Runtime"] = UNSET
|
48
|
+
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
49
|
+
agent_chain: Union[Unset, List["AgentChain"]] = UNSET
|
50
|
+
description: Union[Unset, str] = UNSET
|
51
|
+
functions: Union[Unset, List[str]] = UNSET
|
52
|
+
model: Union[Unset, str] = UNSET
|
53
|
+
store_id: Union[Unset, str] = UNSET
|
54
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
55
|
+
|
56
|
+
def to_dict(self) -> dict[str, Any]:
|
57
|
+
configurations: Union[Unset, Dict[str, Any]] = UNSET
|
58
|
+
if not isinstance(self.configurations, Unset):
|
59
|
+
configurations = self.configurations.to_dict()
|
60
|
+
|
61
|
+
enabled = self.enabled
|
62
|
+
|
63
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
64
|
+
if not isinstance(self.flavors, Unset):
|
65
|
+
flavors = []
|
66
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
67
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
68
|
+
flavors.append(componentsschemas_flavors_item)
|
69
|
+
|
70
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
71
|
+
if not isinstance(self.integration_connections, Unset):
|
72
|
+
integration_connections = self.integration_connections
|
73
|
+
|
74
|
+
pod_template: Union[Unset, Dict[str, Any]] = UNSET
|
75
|
+
if not isinstance(self.pod_template, Unset):
|
76
|
+
pod_template = self.pod_template.to_dict()
|
77
|
+
|
78
|
+
policies: Union[Unset, List[str]] = UNSET
|
79
|
+
if not isinstance(self.policies, Unset):
|
80
|
+
policies = self.policies
|
81
|
+
|
82
|
+
runtime: Union[Unset, Dict[str, Any]] = UNSET
|
83
|
+
if not isinstance(self.runtime, Unset):
|
84
|
+
runtime = self.runtime.to_dict()
|
85
|
+
|
86
|
+
serverless_config: Union[Unset, Dict[str, Any]] = UNSET
|
87
|
+
if not isinstance(self.serverless_config, Unset):
|
88
|
+
serverless_config = self.serverless_config.to_dict()
|
89
|
+
|
90
|
+
agent_chain: Union[Unset, List[Dict[str, Any]]] = UNSET
|
91
|
+
if not isinstance(self.agent_chain, Unset):
|
92
|
+
agent_chain = []
|
93
|
+
for componentsschemas_agent_chains_item_data in self.agent_chain:
|
94
|
+
componentsschemas_agent_chains_item = componentsschemas_agent_chains_item_data.to_dict()
|
95
|
+
agent_chain.append(componentsschemas_agent_chains_item)
|
96
|
+
|
97
|
+
description = self.description
|
98
|
+
|
99
|
+
functions: Union[Unset, List[str]] = UNSET
|
100
|
+
if not isinstance(self.functions, Unset):
|
101
|
+
functions = self.functions
|
102
|
+
|
103
|
+
model = self.model
|
104
|
+
|
105
|
+
store_id = self.store_id
|
106
|
+
|
107
|
+
field_dict: dict[str, Any] = {}
|
108
|
+
field_dict.update(self.additional_properties)
|
109
|
+
field_dict.update({})
|
110
|
+
if configurations is not UNSET:
|
111
|
+
field_dict["configurations"] = configurations
|
112
|
+
if enabled is not UNSET:
|
113
|
+
field_dict["enabled"] = enabled
|
114
|
+
if flavors is not UNSET:
|
115
|
+
field_dict["flavors"] = flavors
|
116
|
+
if integration_connections is not UNSET:
|
117
|
+
field_dict["integrationConnections"] = integration_connections
|
118
|
+
if pod_template is not UNSET:
|
119
|
+
field_dict["podTemplate"] = pod_template
|
120
|
+
if policies is not UNSET:
|
121
|
+
field_dict["policies"] = policies
|
122
|
+
if runtime is not UNSET:
|
123
|
+
field_dict["runtime"] = runtime
|
124
|
+
if serverless_config is not UNSET:
|
125
|
+
field_dict["serverlessConfig"] = serverless_config
|
126
|
+
if agent_chain is not UNSET:
|
127
|
+
field_dict["agentChain"] = agent_chain
|
128
|
+
if description is not UNSET:
|
129
|
+
field_dict["description"] = description
|
130
|
+
if functions is not UNSET:
|
131
|
+
field_dict["functions"] = functions
|
132
|
+
if model is not UNSET:
|
133
|
+
field_dict["model"] = model
|
134
|
+
if store_id is not UNSET:
|
135
|
+
field_dict["storeId"] = store_id
|
136
|
+
|
137
|
+
return field_dict
|
138
|
+
|
139
|
+
@classmethod
|
140
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
141
|
+
from ..models.agent_chain import AgentChain
|
142
|
+
from ..models.flavor import Flavor
|
143
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
144
|
+
from ..models.runtime import Runtime
|
145
|
+
from ..models.serverless_config import ServerlessConfig
|
146
|
+
from ..models.spec_configuration import SpecConfiguration
|
147
|
+
|
148
|
+
d = src_dict.copy()
|
149
|
+
_configurations = d.pop("configurations", UNSET)
|
150
|
+
configurations: Union[Unset, SpecConfiguration]
|
151
|
+
if isinstance(_configurations, Unset):
|
152
|
+
configurations = UNSET
|
153
|
+
else:
|
154
|
+
configurations = SpecConfiguration.from_dict(_configurations)
|
155
|
+
|
156
|
+
enabled = d.pop("enabled", UNSET)
|
157
|
+
|
158
|
+
flavors = []
|
159
|
+
_flavors = d.pop("flavors", UNSET)
|
160
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
161
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
162
|
+
|
163
|
+
flavors.append(componentsschemas_flavors_item)
|
164
|
+
|
165
|
+
integration_connections = cast(List[str], d.pop("integrationConnections", UNSET))
|
166
|
+
|
167
|
+
_pod_template = d.pop("podTemplate", UNSET)
|
168
|
+
pod_template: Union[Unset, PodTemplateSpec]
|
169
|
+
if isinstance(_pod_template, Unset):
|
170
|
+
pod_template = UNSET
|
171
|
+
else:
|
172
|
+
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
173
|
+
|
174
|
+
policies = cast(List[str], d.pop("policies", UNSET))
|
175
|
+
|
176
|
+
_runtime = d.pop("runtime", UNSET)
|
177
|
+
runtime: Union[Unset, Runtime]
|
178
|
+
if isinstance(_runtime, Unset):
|
179
|
+
runtime = UNSET
|
180
|
+
else:
|
181
|
+
runtime = Runtime.from_dict(_runtime)
|
182
|
+
|
183
|
+
_serverless_config = d.pop("serverlessConfig", UNSET)
|
184
|
+
serverless_config: Union[Unset, ServerlessConfig]
|
185
|
+
if isinstance(_serverless_config, Unset):
|
186
|
+
serverless_config = UNSET
|
187
|
+
else:
|
188
|
+
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
189
|
+
|
190
|
+
agent_chain = []
|
191
|
+
_agent_chain = d.pop("agentChain", UNSET)
|
192
|
+
for componentsschemas_agent_chains_item_data in _agent_chain or []:
|
193
|
+
componentsschemas_agent_chains_item = AgentChain.from_dict(componentsschemas_agent_chains_item_data)
|
194
|
+
|
195
|
+
agent_chain.append(componentsschemas_agent_chains_item)
|
196
|
+
|
197
|
+
description = d.pop("description", UNSET)
|
198
|
+
|
199
|
+
functions = cast(List[str], d.pop("functions", UNSET))
|
200
|
+
|
201
|
+
model = d.pop("model", UNSET)
|
202
|
+
|
203
|
+
store_id = d.pop("storeId", UNSET)
|
204
|
+
|
205
|
+
agent_spec = cls(
|
206
|
+
configurations=configurations,
|
207
|
+
enabled=enabled,
|
208
|
+
flavors=flavors,
|
209
|
+
integration_connections=integration_connections,
|
210
|
+
pod_template=pod_template,
|
211
|
+
policies=policies,
|
212
|
+
runtime=runtime,
|
213
|
+
serverless_config=serverless_config,
|
214
|
+
agent_chain=agent_chain,
|
215
|
+
description=description,
|
216
|
+
functions=functions,
|
217
|
+
model=model,
|
218
|
+
store_id=store_id,
|
219
|
+
)
|
220
|
+
|
221
|
+
agent_spec.additional_properties = d
|
222
|
+
return agent_spec
|
223
|
+
|
224
|
+
@property
|
225
|
+
def additional_keys(self) -> list[str]:
|
226
|
+
return list(self.additional_properties.keys())
|
227
|
+
|
228
|
+
def __getitem__(self, key: str) -> Any:
|
229
|
+
return self.additional_properties[key]
|
230
|
+
|
231
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
232
|
+
self.additional_properties[key] = value
|
233
|
+
|
234
|
+
def __delitem__(self, key: str) -> None:
|
235
|
+
del self.additional_properties[key]
|
236
|
+
|
237
|
+
def __contains__(self, key: str) -> bool:
|
238
|
+
return key in self.additional_properties
|
beamlit/models/api_key.py
CHANGED
beamlit/models/configuration.py
CHANGED
beamlit/models/continent.py
CHANGED
@@ -0,0 +1,179 @@
|
|
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.flavor import Flavor
|
10
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
11
|
+
from ..models.runtime import Runtime
|
12
|
+
from ..models.serverless_config import ServerlessConfig
|
13
|
+
from ..models.spec_configuration import SpecConfiguration
|
14
|
+
|
15
|
+
|
16
|
+
T = TypeVar("T", bound="CoreSpec")
|
17
|
+
|
18
|
+
|
19
|
+
@_attrs_define
|
20
|
+
class CoreSpec:
|
21
|
+
"""Core specification
|
22
|
+
|
23
|
+
Attributes:
|
24
|
+
configurations (Union[Unset, SpecConfiguration]): Agent configuration, this is a key value storage. In your
|
25
|
+
agent you can retrieve the value with config[key]
|
26
|
+
enabled (Union[Unset, bool]): Enable or disable the agent
|
27
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
28
|
+
integration_connections (Union[Unset, List[str]]):
|
29
|
+
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
30
|
+
policies (Union[Unset, List[str]]):
|
31
|
+
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
32
|
+
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
33
|
+
"""
|
34
|
+
|
35
|
+
configurations: Union[Unset, "SpecConfiguration"] = UNSET
|
36
|
+
enabled: Union[Unset, bool] = UNSET
|
37
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
38
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
39
|
+
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
40
|
+
policies: Union[Unset, List[str]] = UNSET
|
41
|
+
runtime: Union[Unset, "Runtime"] = UNSET
|
42
|
+
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
44
|
+
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
46
|
+
configurations: Union[Unset, Dict[str, Any]] = UNSET
|
47
|
+
if not isinstance(self.configurations, Unset):
|
48
|
+
configurations = self.configurations.to_dict()
|
49
|
+
|
50
|
+
enabled = self.enabled
|
51
|
+
|
52
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
53
|
+
if not isinstance(self.flavors, Unset):
|
54
|
+
flavors = []
|
55
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
56
|
+
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
57
|
+
flavors.append(componentsschemas_flavors_item)
|
58
|
+
|
59
|
+
integration_connections: Union[Unset, List[str]] = UNSET
|
60
|
+
if not isinstance(self.integration_connections, Unset):
|
61
|
+
integration_connections = self.integration_connections
|
62
|
+
|
63
|
+
pod_template: Union[Unset, Dict[str, Any]] = UNSET
|
64
|
+
if not isinstance(self.pod_template, Unset):
|
65
|
+
pod_template = self.pod_template.to_dict()
|
66
|
+
|
67
|
+
policies: Union[Unset, List[str]] = UNSET
|
68
|
+
if not isinstance(self.policies, Unset):
|
69
|
+
policies = self.policies
|
70
|
+
|
71
|
+
runtime: Union[Unset, Dict[str, Any]] = UNSET
|
72
|
+
if not isinstance(self.runtime, Unset):
|
73
|
+
runtime = self.runtime.to_dict()
|
74
|
+
|
75
|
+
serverless_config: Union[Unset, Dict[str, Any]] = UNSET
|
76
|
+
if not isinstance(self.serverless_config, Unset):
|
77
|
+
serverless_config = self.serverless_config.to_dict()
|
78
|
+
|
79
|
+
field_dict: dict[str, Any] = {}
|
80
|
+
field_dict.update(self.additional_properties)
|
81
|
+
field_dict.update({})
|
82
|
+
if configurations is not UNSET:
|
83
|
+
field_dict["configurations"] = configurations
|
84
|
+
if enabled is not UNSET:
|
85
|
+
field_dict["enabled"] = enabled
|
86
|
+
if flavors is not UNSET:
|
87
|
+
field_dict["flavors"] = flavors
|
88
|
+
if integration_connections is not UNSET:
|
89
|
+
field_dict["integrationConnections"] = integration_connections
|
90
|
+
if pod_template is not UNSET:
|
91
|
+
field_dict["podTemplate"] = pod_template
|
92
|
+
if policies is not UNSET:
|
93
|
+
field_dict["policies"] = policies
|
94
|
+
if runtime is not UNSET:
|
95
|
+
field_dict["runtime"] = runtime
|
96
|
+
if serverless_config is not UNSET:
|
97
|
+
field_dict["serverlessConfig"] = serverless_config
|
98
|
+
|
99
|
+
return field_dict
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
103
|
+
from ..models.flavor import Flavor
|
104
|
+
from ..models.pod_template_spec import PodTemplateSpec
|
105
|
+
from ..models.runtime import Runtime
|
106
|
+
from ..models.serverless_config import ServerlessConfig
|
107
|
+
from ..models.spec_configuration import SpecConfiguration
|
108
|
+
|
109
|
+
d = src_dict.copy()
|
110
|
+
_configurations = d.pop("configurations", UNSET)
|
111
|
+
configurations: Union[Unset, SpecConfiguration]
|
112
|
+
if isinstance(_configurations, Unset):
|
113
|
+
configurations = UNSET
|
114
|
+
else:
|
115
|
+
configurations = SpecConfiguration.from_dict(_configurations)
|
116
|
+
|
117
|
+
enabled = d.pop("enabled", UNSET)
|
118
|
+
|
119
|
+
flavors = []
|
120
|
+
_flavors = d.pop("flavors", UNSET)
|
121
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
122
|
+
componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
|
123
|
+
|
124
|
+
flavors.append(componentsschemas_flavors_item)
|
125
|
+
|
126
|
+
integration_connections = cast(List[str], d.pop("integrationConnections", UNSET))
|
127
|
+
|
128
|
+
_pod_template = d.pop("podTemplate", UNSET)
|
129
|
+
pod_template: Union[Unset, PodTemplateSpec]
|
130
|
+
if isinstance(_pod_template, Unset):
|
131
|
+
pod_template = UNSET
|
132
|
+
else:
|
133
|
+
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
134
|
+
|
135
|
+
policies = cast(List[str], d.pop("policies", UNSET))
|
136
|
+
|
137
|
+
_runtime = d.pop("runtime", UNSET)
|
138
|
+
runtime: Union[Unset, Runtime]
|
139
|
+
if isinstance(_runtime, Unset):
|
140
|
+
runtime = UNSET
|
141
|
+
else:
|
142
|
+
runtime = Runtime.from_dict(_runtime)
|
143
|
+
|
144
|
+
_serverless_config = d.pop("serverlessConfig", UNSET)
|
145
|
+
serverless_config: Union[Unset, ServerlessConfig]
|
146
|
+
if isinstance(_serverless_config, Unset):
|
147
|
+
serverless_config = UNSET
|
148
|
+
else:
|
149
|
+
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
150
|
+
|
151
|
+
core_spec = cls(
|
152
|
+
configurations=configurations,
|
153
|
+
enabled=enabled,
|
154
|
+
flavors=flavors,
|
155
|
+
integration_connections=integration_connections,
|
156
|
+
pod_template=pod_template,
|
157
|
+
policies=policies,
|
158
|
+
runtime=runtime,
|
159
|
+
serverless_config=serverless_config,
|
160
|
+
)
|
161
|
+
|
162
|
+
core_spec.additional_properties = d
|
163
|
+
return core_spec
|
164
|
+
|
165
|
+
@property
|
166
|
+
def additional_keys(self) -> list[str]:
|
167
|
+
return list(self.additional_properties.keys())
|
168
|
+
|
169
|
+
def __getitem__(self, key: str) -> Any:
|
170
|
+
return self.additional_properties[key]
|
171
|
+
|
172
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
173
|
+
self.additional_properties[key] = value
|
174
|
+
|
175
|
+
def __delitem__(self, key: str) -> None:
|
176
|
+
del self.additional_properties[key]
|
177
|
+
|
178
|
+
def __contains__(self, key: str) -> bool:
|
179
|
+
return key in self.additional_properties
|
beamlit/models/country.py
CHANGED
@@ -27,6 +27,8 @@ class DeploymentConfigurations:
|
|
27
27
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
28
28
|
from ..models.deployment_configuration import DeploymentConfiguration
|
29
29
|
|
30
|
+
if not src_dict:
|
31
|
+
return None
|
30
32
|
d = src_dict.copy()
|
31
33
|
deployment_configurations = cls()
|
32
34
|
|
@@ -0,0 +1,131 @@
|
|
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
|
+
if not src_dict:
|
85
|
+
return None
|
86
|
+
d = src_dict.copy()
|
87
|
+
last_pod_retention_period = d.pop("last_pod_retention_period", UNSET)
|
88
|
+
|
89
|
+
max_num_replicas = d.pop("max_num_replicas", UNSET)
|
90
|
+
|
91
|
+
metric = d.pop("metric", UNSET)
|
92
|
+
|
93
|
+
min_num_replicas = d.pop("min_num_replicas", UNSET)
|
94
|
+
|
95
|
+
scale_down_delay = d.pop("scale_down_delay", UNSET)
|
96
|
+
|
97
|
+
scale_up_minimum = d.pop("scale_up_minimum", UNSET)
|
98
|
+
|
99
|
+
stable_window = d.pop("stable_window", UNSET)
|
100
|
+
|
101
|
+
target = d.pop("target", UNSET)
|
102
|
+
|
103
|
+
deployment_serverless_config = cls(
|
104
|
+
last_pod_retention_period=last_pod_retention_period,
|
105
|
+
max_num_replicas=max_num_replicas,
|
106
|
+
metric=metric,
|
107
|
+
min_num_replicas=min_num_replicas,
|
108
|
+
scale_down_delay=scale_down_delay,
|
109
|
+
scale_up_minimum=scale_up_minimum,
|
110
|
+
stable_window=stable_window,
|
111
|
+
target=target,
|
112
|
+
)
|
113
|
+
|
114
|
+
deployment_serverless_config.additional_properties = d
|
115
|
+
return deployment_serverless_config
|
116
|
+
|
117
|
+
@property
|
118
|
+
def additional_keys(self) -> list[str]:
|
119
|
+
return list(self.additional_properties.keys())
|
120
|
+
|
121
|
+
def __getitem__(self, key: str) -> Any:
|
122
|
+
return self.additional_properties[key]
|
123
|
+
|
124
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
125
|
+
self.additional_properties[key] = value
|
126
|
+
|
127
|
+
def __delitem__(self, key: str) -> None:
|
128
|
+
del self.additional_properties[key]
|
129
|
+
|
130
|
+
def __contains__(self, key: str) -> bool:
|
131
|
+
return key in self.additional_properties
|