beamlit 0.0.33rc49__py3-none-any.whl → 0.0.34__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beamlit/agents/__init__.py +2 -1
- beamlit/agents/chat.py +16 -4
- beamlit/agents/decorator.py +68 -155
- beamlit/agents/thread.py +14 -0
- beamlit/api/workspaces/workspace_quotas_request.py +97 -0
- beamlit/authentication/clientcredentials.py +5 -3
- beamlit/authentication/device_mode.py +4 -4
- beamlit/common/__init__.py +1 -2
- beamlit/common/instrumentation.py +202 -34
- beamlit/common/settings.py +7 -64
- beamlit/deploy/deploy.py +64 -60
- beamlit/deploy/format.py +10 -0
- beamlit/functions/__init__.py +2 -2
- beamlit/functions/decorator.py +149 -1
- beamlit/functions/github/github.py +0 -1
- beamlit/models/__init__.py +51 -11
- beamlit/models/agent.py +27 -15
- beamlit/models/agent_metadata.py +1 -1
- beamlit/models/agent_render.py +45 -0
- beamlit/models/agent_spec.py +32 -5
- beamlit/models/core_event.py +88 -0
- beamlit/models/core_spec.py +14 -5
- beamlit/models/core_spec_configurations.py +1 -1
- beamlit/models/core_status.py +3 -20
- beamlit/models/environment.py +2 -2
- beamlit/models/environment_metadata.py +1 -1
- beamlit/models/function.py +27 -15
- beamlit/models/function_metadata.py +1 -1
- beamlit/models/function_render.py +45 -0
- beamlit/models/function_spec.py +14 -5
- beamlit/models/histogram_bucket.py +79 -0
- beamlit/models/histogram_stats.py +88 -0
- beamlit/models/increase_and_rate_metric.py +0 -9
- beamlit/models/integration_connection.py +2 -2
- beamlit/models/integration_connection_spec.py +11 -2
- beamlit/models/integration_repository.py +88 -0
- beamlit/models/last_n_requests_metric.py +88 -0
- beamlit/models/latency_metric.py +124 -0
- beamlit/models/metadata.py +1 -1
- beamlit/models/metric.py +18 -9
- beamlit/models/metrics.py +81 -46
- beamlit/models/metrics_models.py +45 -0
- beamlit/models/metrics_request_total_per_code.py +45 -0
- beamlit/models/metrics_rps_per_code.py +45 -0
- beamlit/models/model.py +27 -15
- beamlit/models/model_metadata.py +1 -1
- beamlit/models/model_provider.py +2 -2
- beamlit/models/model_render.py +45 -0
- beamlit/models/model_spec.py +14 -14
- beamlit/models/pending_invitation_accept.py +1 -1
- beamlit/models/pending_invitation_render.py +3 -3
- beamlit/models/policy.py +2 -2
- beamlit/models/provider_config.py +1 -1
- beamlit/models/repository.py +70 -0
- beamlit/models/repository_type_0.py +70 -0
- beamlit/models/request_duration_over_time_metric.py +97 -0
- beamlit/models/request_duration_over_time_metrics.py +74 -0
- beamlit/models/request_total_by_origin_metric.py +103 -0
- beamlit/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
- beamlit/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
- beamlit/models/request_total_metric.py +115 -0
- beamlit/models/request_total_metric_request_total_per_code.py +45 -0
- beamlit/models/request_total_metric_rps_per_code.py +45 -0
- beamlit/models/resource_deployment_metrics.py +6 -4
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +1 -1
- beamlit/models/resource_environment_metrics.py +155 -75
- beamlit/models/resource_environment_metrics_request_total_per_code.py +45 -0
- beamlit/models/resource_environment_metrics_rps_per_code.py +45 -0
- beamlit/models/resource_metrics.py +1 -1
- beamlit/models/runtime.py +2 -2
- beamlit/models/store_agent.py +1 -1
- beamlit/models/store_function.py +1 -1
- beamlit/models/token_rate_metric.py +88 -0
- beamlit/models/token_rate_metrics.py +106 -0
- beamlit/models/token_total_metric.py +106 -0
- beamlit/models/workspace.py +17 -8
- beamlit/serve/app.py +9 -13
- {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/METADATA +21 -3
- {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/RECORD +80 -52
- beamlit/common/generate.py +0 -196
- {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/WHEEL +0 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="MetricsRequestTotalPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class MetricsRequestTotalPerCode:
|
11
|
+
"""Number of requests for all resources globally per code"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _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
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
metrics_request_total_per_code = cls()
|
27
|
+
|
28
|
+
metrics_request_total_per_code.additional_properties = d
|
29
|
+
return metrics_request_total_per_code
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="MetricsRpsPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class MetricsRpsPerCode:
|
11
|
+
"""Number of requests per second for all resources globally per code"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _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
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
metrics_rps_per_code = cls()
|
27
|
+
|
28
|
+
metrics_rps_per_code.additional_properties = d
|
29
|
+
return metrics_rps_per_code
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
beamlit/models/model.py
CHANGED
@@ -6,7 +6,7 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
9
|
+
from ..models.core_event import CoreEvent
|
10
10
|
from ..models.environment_metadata import EnvironmentMetadata
|
11
11
|
from ..models.model_spec import ModelSpec
|
12
12
|
|
@@ -19,32 +19,41 @@ class Model:
|
|
19
19
|
"""Logical object representing a model, that can be instantiated in multiple environments as model deployments
|
20
20
|
|
21
21
|
Attributes:
|
22
|
+
events (Union[Unset, list['CoreEvent']]): Core events
|
22
23
|
metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
|
23
24
|
spec (Union[Unset, ModelSpec]): Model specification
|
24
|
-
status (Union[Unset,
|
25
|
+
status (Union[Unset, str]): Model status
|
25
26
|
"""
|
26
27
|
|
28
|
+
events: Union[Unset, list["CoreEvent"]] = UNSET
|
27
29
|
metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
|
28
30
|
spec: Union[Unset, "ModelSpec"] = UNSET
|
29
|
-
status: Union[Unset,
|
31
|
+
status: Union[Unset, str] = UNSET
|
30
32
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
31
33
|
|
32
34
|
def to_dict(self) -> dict[str, Any]:
|
35
|
+
events: Union[Unset, list[dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.events, Unset):
|
37
|
+
events = []
|
38
|
+
for componentsschemas_core_events_item_data in self.events:
|
39
|
+
componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
|
40
|
+
events.append(componentsschemas_core_events_item)
|
41
|
+
|
33
42
|
metadata: Union[Unset, dict[str, Any]] = UNSET
|
34
|
-
if not isinstance(self.metadata, Unset):
|
43
|
+
if self.metadata and not isinstance(self.metadata, Unset):
|
35
44
|
metadata = self.metadata.to_dict()
|
36
45
|
|
37
46
|
spec: Union[Unset, dict[str, Any]] = UNSET
|
38
|
-
if not isinstance(self.spec, Unset):
|
47
|
+
if self.spec and not isinstance(self.spec, Unset):
|
39
48
|
spec = self.spec.to_dict()
|
40
49
|
|
41
|
-
status
|
42
|
-
if not isinstance(self.status, Unset):
|
43
|
-
status = self.status.to_dict()
|
50
|
+
status = self.status
|
44
51
|
|
45
52
|
field_dict: dict[str, Any] = {}
|
46
53
|
field_dict.update(self.additional_properties)
|
47
54
|
field_dict.update({})
|
55
|
+
if events is not UNSET:
|
56
|
+
field_dict["events"] = events
|
48
57
|
if metadata is not UNSET:
|
49
58
|
field_dict["metadata"] = metadata
|
50
59
|
if spec is not UNSET:
|
@@ -56,13 +65,20 @@ class Model:
|
|
56
65
|
|
57
66
|
@classmethod
|
58
67
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
59
|
-
from ..models.
|
68
|
+
from ..models.core_event import CoreEvent
|
60
69
|
from ..models.environment_metadata import EnvironmentMetadata
|
61
70
|
from ..models.model_spec import ModelSpec
|
62
71
|
|
63
72
|
if not src_dict:
|
64
73
|
return None
|
65
74
|
d = src_dict.copy()
|
75
|
+
events = []
|
76
|
+
_events = d.pop("events", UNSET)
|
77
|
+
for componentsschemas_core_events_item_data in _events or []:
|
78
|
+
componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
|
79
|
+
|
80
|
+
events.append(componentsschemas_core_events_item)
|
81
|
+
|
66
82
|
_metadata = d.pop("metadata", UNSET)
|
67
83
|
metadata: Union[Unset, EnvironmentMetadata]
|
68
84
|
if isinstance(_metadata, Unset):
|
@@ -77,14 +93,10 @@ class Model:
|
|
77
93
|
else:
|
78
94
|
spec = ModelSpec.from_dict(_spec)
|
79
95
|
|
80
|
-
|
81
|
-
status: Union[Unset, CoreStatus]
|
82
|
-
if isinstance(_status, Unset):
|
83
|
-
status = UNSET
|
84
|
-
else:
|
85
|
-
status = CoreStatus.from_dict(_status)
|
96
|
+
status = d.pop("status", UNSET)
|
86
97
|
|
87
98
|
model = cls(
|
99
|
+
events=events,
|
88
100
|
metadata=metadata,
|
89
101
|
spec=spec,
|
90
102
|
status=status,
|
beamlit/models/model_metadata.py
CHANGED
@@ -51,7 +51,7 @@ class ModelMetadata:
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
53
|
labels: Union[Unset, dict[str, Any]] = UNSET
|
54
|
-
if not isinstance(self.labels, Unset):
|
54
|
+
if self.labels and not isinstance(self.labels, Unset):
|
55
55
|
labels = self.labels.to_dict()
|
56
56
|
|
57
57
|
name = self.name
|
beamlit/models/model_provider.py
CHANGED
@@ -56,13 +56,13 @@ class ModelProvider:
|
|
56
56
|
comment = self.comment
|
57
57
|
|
58
58
|
config: Union[Unset, dict[str, Any]] = UNSET
|
59
|
-
if not isinstance(self.config, Unset):
|
59
|
+
if self.config and not isinstance(self.config, Unset):
|
60
60
|
config = self.config.to_dict()
|
61
61
|
|
62
62
|
display_name = self.display_name
|
63
63
|
|
64
64
|
labels: Union[Unset, dict[str, Any]] = UNSET
|
65
|
-
if not isinstance(self.labels, Unset):
|
65
|
+
if self.labels and not isinstance(self.labels, Unset):
|
66
66
|
labels = self.labels.to_dict()
|
67
67
|
|
68
68
|
name = self.name
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="ModelRender")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class ModelRender:
|
11
|
+
"""ModelRender"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _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
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
model_render = cls()
|
27
|
+
|
28
|
+
model_render.additional_properties = d
|
29
|
+
return model_render
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
beamlit/models/model_spec.py
CHANGED
@@ -30,8 +30,8 @@ class ModelSpec:
|
|
30
30
|
policies (Union[Unset, list[str]]):
|
31
31
|
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
32
32
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
33
|
+
sandbox (Union[Unset, bool]): Sandbox mode
|
33
34
|
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
34
|
-
model_provider (Union[Unset, str]): Model provider name
|
35
35
|
"""
|
36
36
|
|
37
37
|
configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
|
@@ -42,13 +42,13 @@ class ModelSpec:
|
|
42
42
|
policies: Union[Unset, list[str]] = UNSET
|
43
43
|
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
44
44
|
runtime: Union[Unset, "Runtime"] = UNSET
|
45
|
+
sandbox: Union[Unset, bool] = UNSET
|
45
46
|
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
46
|
-
model_provider: Union[Unset, str] = UNSET
|
47
47
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
48
48
|
|
49
49
|
def to_dict(self) -> dict[str, Any]:
|
50
50
|
configurations: Union[Unset, dict[str, Any]] = UNSET
|
51
|
-
if not isinstance(self.configurations, Unset):
|
51
|
+
if self.configurations and not isinstance(self.configurations, Unset):
|
52
52
|
configurations = self.configurations.to_dict()
|
53
53
|
|
54
54
|
enabled = self.enabled
|
@@ -65,7 +65,7 @@ class ModelSpec:
|
|
65
65
|
integration_connections = self.integration_connections
|
66
66
|
|
67
67
|
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
68
|
-
if not isinstance(self.pod_template, Unset):
|
68
|
+
if self.pod_template and not isinstance(self.pod_template, Unset):
|
69
69
|
pod_template = self.pod_template.to_dict()
|
70
70
|
|
71
71
|
policies: Union[Unset, list[str]] = UNSET
|
@@ -73,19 +73,19 @@ class ModelSpec:
|
|
73
73
|
policies = self.policies
|
74
74
|
|
75
75
|
private_clusters: Union[Unset, dict[str, Any]] = UNSET
|
76
|
-
if not isinstance(self.private_clusters, Unset):
|
76
|
+
if self.private_clusters and not isinstance(self.private_clusters, Unset):
|
77
77
|
private_clusters = self.private_clusters.to_dict()
|
78
78
|
|
79
79
|
runtime: Union[Unset, dict[str, Any]] = UNSET
|
80
|
-
if not isinstance(self.runtime, Unset):
|
80
|
+
if self.runtime and not isinstance(self.runtime, Unset):
|
81
81
|
runtime = self.runtime.to_dict()
|
82
82
|
|
83
|
+
sandbox = self.sandbox
|
84
|
+
|
83
85
|
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
84
|
-
if not isinstance(self.serverless_config, Unset):
|
86
|
+
if self.serverless_config and not isinstance(self.serverless_config, Unset):
|
85
87
|
serverless_config = self.serverless_config.to_dict()
|
86
88
|
|
87
|
-
model_provider = self.model_provider
|
88
|
-
|
89
89
|
field_dict: dict[str, Any] = {}
|
90
90
|
field_dict.update(self.additional_properties)
|
91
91
|
field_dict.update({})
|
@@ -105,10 +105,10 @@ class ModelSpec:
|
|
105
105
|
field_dict["privateClusters"] = private_clusters
|
106
106
|
if runtime is not UNSET:
|
107
107
|
field_dict["runtime"] = runtime
|
108
|
+
if sandbox is not UNSET:
|
109
|
+
field_dict["sandbox"] = sandbox
|
108
110
|
if serverless_config is not UNSET:
|
109
111
|
field_dict["serverlessConfig"] = serverless_config
|
110
|
-
if model_provider is not UNSET:
|
111
|
-
field_dict["modelProvider"] = model_provider
|
112
112
|
|
113
113
|
return field_dict
|
114
114
|
|
@@ -165,6 +165,8 @@ class ModelSpec:
|
|
165
165
|
else:
|
166
166
|
runtime = Runtime.from_dict(_runtime)
|
167
167
|
|
168
|
+
sandbox = d.pop("sandbox", UNSET)
|
169
|
+
|
168
170
|
_serverless_config = d.pop("serverlessConfig", UNSET)
|
169
171
|
serverless_config: Union[Unset, ServerlessConfig]
|
170
172
|
if isinstance(_serverless_config, Unset):
|
@@ -172,8 +174,6 @@ class ModelSpec:
|
|
172
174
|
else:
|
173
175
|
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
174
176
|
|
175
|
-
model_provider = d.pop("modelProvider", UNSET)
|
176
|
-
|
177
177
|
model_spec = cls(
|
178
178
|
configurations=configurations,
|
179
179
|
enabled=enabled,
|
@@ -183,8 +183,8 @@ class ModelSpec:
|
|
183
183
|
policies=policies,
|
184
184
|
private_clusters=private_clusters,
|
185
185
|
runtime=runtime,
|
186
|
+
sandbox=sandbox,
|
186
187
|
serverless_config=serverless_config,
|
187
|
-
model_provider=model_provider,
|
188
188
|
)
|
189
189
|
|
190
190
|
model_spec.additional_properties = d
|
@@ -29,7 +29,7 @@ class PendingInvitationAccept:
|
|
29
29
|
email = self.email
|
30
30
|
|
31
31
|
workspace: Union[Unset, dict[str, Any]] = UNSET
|
32
|
-
if not isinstance(self.workspace, Unset):
|
32
|
+
if self.workspace and not isinstance(self.workspace, Unset):
|
33
33
|
workspace = self.workspace.to_dict()
|
34
34
|
|
35
35
|
field_dict: dict[str, Any] = {}
|
@@ -41,17 +41,17 @@ class PendingInvitationRender:
|
|
41
41
|
invited_at = self.invited_at
|
42
42
|
|
43
43
|
invited_by: Union[Unset, dict[str, Any]] = UNSET
|
44
|
-
if not isinstance(self.invited_by, Unset):
|
44
|
+
if self.invited_by and not isinstance(self.invited_by, Unset):
|
45
45
|
invited_by = self.invited_by.to_dict()
|
46
46
|
|
47
47
|
role = self.role
|
48
48
|
|
49
49
|
workspace: Union[Unset, dict[str, Any]] = UNSET
|
50
|
-
if not isinstance(self.workspace, Unset):
|
50
|
+
if self.workspace and not isinstance(self.workspace, Unset):
|
51
51
|
workspace = self.workspace.to_dict()
|
52
52
|
|
53
53
|
workspace_details: Union[Unset, dict[str, Any]] = UNSET
|
54
|
-
if not isinstance(self.workspace_details, Unset):
|
54
|
+
if self.workspace_details and not isinstance(self.workspace_details, Unset):
|
55
55
|
workspace_details = self.workspace_details.to_dict()
|
56
56
|
|
57
57
|
field_dict: dict[str, Any] = {}
|
beamlit/models/policy.py
CHANGED
@@ -28,11 +28,11 @@ class Policy:
|
|
28
28
|
|
29
29
|
def to_dict(self) -> dict[str, Any]:
|
30
30
|
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
-
if not isinstance(self.metadata, Unset):
|
31
|
+
if self.metadata and not isinstance(self.metadata, Unset):
|
32
32
|
metadata = self.metadata.to_dict()
|
33
33
|
|
34
34
|
spec: Union[Unset, dict[str, Any]] = UNSET
|
35
|
-
if not isinstance(self.spec, Unset):
|
35
|
+
if self.spec and not isinstance(self.spec, Unset):
|
36
36
|
spec = self.spec.to_dict()
|
37
37
|
|
38
38
|
field_dict: dict[str, Any] = {}
|
@@ -35,7 +35,7 @@ class ProviderConfig:
|
|
35
35
|
presigned_url = self.presigned_url
|
36
36
|
|
37
37
|
runtime: Union[Unset, dict[str, Any]] = UNSET
|
38
|
-
if not isinstance(self.runtime, Unset):
|
38
|
+
if self.runtime and not isinstance(self.runtime, Unset):
|
39
39
|
runtime = self.runtime.to_dict()
|
40
40
|
|
41
41
|
field_dict: dict[str, Any] = {}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, 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="Repository")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class Repository:
|
13
|
+
"""Repository
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
type_ (Union[Unset, str]): Repository type
|
17
|
+
url (Union[Unset, str]): Repository URL
|
18
|
+
"""
|
19
|
+
|
20
|
+
type_: Union[Unset, str] = UNSET
|
21
|
+
url: 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
|
+
type_ = self.type_
|
26
|
+
|
27
|
+
url = self.url
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if type_ is not UNSET:
|
33
|
+
field_dict["type"] = type_
|
34
|
+
if url is not UNSET:
|
35
|
+
field_dict["url"] = url
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
type_ = d.pop("type", UNSET)
|
45
|
+
|
46
|
+
url = d.pop("url", UNSET)
|
47
|
+
|
48
|
+
repository = cls(
|
49
|
+
type_=type_,
|
50
|
+
url=url,
|
51
|
+
)
|
52
|
+
|
53
|
+
repository.additional_properties = d
|
54
|
+
return repository
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, 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="RepositoryType0")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RepositoryType0:
|
13
|
+
"""Repository
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
type_ (Union[Unset, str]): Repository type
|
17
|
+
url (Union[Unset, str]): Repository URL
|
18
|
+
"""
|
19
|
+
|
20
|
+
type_: Union[Unset, str] = UNSET
|
21
|
+
url: 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
|
+
type_ = self.type_
|
26
|
+
|
27
|
+
url = self.url
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if type_ is not UNSET:
|
33
|
+
field_dict["type"] = type_
|
34
|
+
if url is not UNSET:
|
35
|
+
field_dict["url"] = url
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
type_ = d.pop("type", UNSET)
|
45
|
+
|
46
|
+
url = d.pop("url", UNSET)
|
47
|
+
|
48
|
+
repository_type_0 = cls(
|
49
|
+
type_=type_,
|
50
|
+
url=url,
|
51
|
+
)
|
52
|
+
|
53
|
+
repository_type_0.additional_properties = d
|
54
|
+
return repository_type_0
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -0,0 +1,97 @@
|
|
1
|
+
from typing import Any, 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="RequestDurationOverTimeMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RequestDurationOverTimeMetric:
|
13
|
+
"""Request duration over time metric
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
average (Union[Unset, float]): Average request duration
|
17
|
+
p50 (Union[Unset, float]): P50 request duration
|
18
|
+
p90 (Union[Unset, float]): P90 request duration
|
19
|
+
p99 (Union[Unset, float]): P99 request duration
|
20
|
+
timestamp (Union[Unset, str]): Timestamp
|
21
|
+
"""
|
22
|
+
|
23
|
+
average: Union[Unset, float] = UNSET
|
24
|
+
p50: Union[Unset, float] = UNSET
|
25
|
+
p90: Union[Unset, float] = UNSET
|
26
|
+
p99: Union[Unset, float] = UNSET
|
27
|
+
timestamp: Union[Unset, str] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
average = self.average
|
32
|
+
|
33
|
+
p50 = self.p50
|
34
|
+
|
35
|
+
p90 = self.p90
|
36
|
+
|
37
|
+
p99 = self.p99
|
38
|
+
|
39
|
+
timestamp = self.timestamp
|
40
|
+
|
41
|
+
field_dict: dict[str, Any] = {}
|
42
|
+
field_dict.update(self.additional_properties)
|
43
|
+
field_dict.update({})
|
44
|
+
if average is not UNSET:
|
45
|
+
field_dict["average"] = average
|
46
|
+
if p50 is not UNSET:
|
47
|
+
field_dict["p50"] = p50
|
48
|
+
if p90 is not UNSET:
|
49
|
+
field_dict["p90"] = p90
|
50
|
+
if p99 is not UNSET:
|
51
|
+
field_dict["p99"] = p99
|
52
|
+
if timestamp is not UNSET:
|
53
|
+
field_dict["timestamp"] = timestamp
|
54
|
+
|
55
|
+
return field_dict
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
59
|
+
if not src_dict:
|
60
|
+
return None
|
61
|
+
d = src_dict.copy()
|
62
|
+
average = d.pop("average", UNSET)
|
63
|
+
|
64
|
+
p50 = d.pop("p50", UNSET)
|
65
|
+
|
66
|
+
p90 = d.pop("p90", UNSET)
|
67
|
+
|
68
|
+
p99 = d.pop("p99", UNSET)
|
69
|
+
|
70
|
+
timestamp = d.pop("timestamp", UNSET)
|
71
|
+
|
72
|
+
request_duration_over_time_metric = cls(
|
73
|
+
average=average,
|
74
|
+
p50=p50,
|
75
|
+
p90=p90,
|
76
|
+
p99=p99,
|
77
|
+
timestamp=timestamp,
|
78
|
+
)
|
79
|
+
|
80
|
+
request_duration_over_time_metric.additional_properties = d
|
81
|
+
return request_duration_over_time_metric
|
82
|
+
|
83
|
+
@property
|
84
|
+
def additional_keys(self) -> list[str]:
|
85
|
+
return list(self.additional_properties.keys())
|
86
|
+
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
88
|
+
return self.additional_properties[key]
|
89
|
+
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
91
|
+
self.additional_properties[key] = value
|
92
|
+
|
93
|
+
def __delitem__(self, key: str) -> None:
|
94
|
+
del self.additional_properties[key]
|
95
|
+
|
96
|
+
def __contains__(self, key: str) -> bool:
|
97
|
+
return key in self.additional_properties
|