beamlit 0.0.20rc5__py3-none-any.whl → 0.0.20rc7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/delete_agent_history.py +6 -2
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +6 -2
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +6 -2
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/list_integration_connections.py +11 -11
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +26 -10
- beamlit/authentication/apikey.py +4 -4
- beamlit/authentication/authentication.py +36 -5
- beamlit/authentication/clientcredentials.py +18 -20
- beamlit/authentication/credentials.py +18 -11
- beamlit/authentication/device_mode.py +15 -12
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +31 -19
- beamlit/common/logger.py +9 -12
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +78 -30
- beamlit/common/utils.py +4 -2
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/models/acl.py +2 -2
- beamlit/models/agent.py +3 -3
- beamlit/models/agent_chain.py +2 -2
- beamlit/models/agent_configuration.py +2 -2
- beamlit/models/agent_deployment.py +25 -25
- beamlit/models/agent_deployment_configuration.py +2 -2
- beamlit/models/agent_deployment_history.py +5 -5
- beamlit/models/agent_deployment_history_event.py +9 -9
- beamlit/models/agent_deployment_pod_template.py +2 -2
- beamlit/models/agent_release.py +2 -2
- beamlit/models/agent_spec.py +15 -5
- beamlit/models/agent_with_deployments.py +6 -6
- beamlit/models/api_key.py +2 -2
- beamlit/models/authentication_provider_model.py +6 -6
- beamlit/models/authentication_provider_organization.py +2 -2
- beamlit/models/configuration.py +10 -10
- beamlit/models/continent.py +2 -2
- beamlit/models/core_spec.py +9 -3
- beamlit/models/country.py +2 -2
- beamlit/models/create_api_key_for_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_response_200.py +2 -2
- beamlit/models/delete_workspace_service_account_response_200.py +2 -2
- beamlit/models/deployment_configuration.py +2 -2
- beamlit/models/deployment_configurations.py +2 -2
- beamlit/models/deployment_serverless_config.py +2 -2
- beamlit/models/deployment_serverless_config_type_0.py +3 -1
- beamlit/models/environment.py +7 -7
- beamlit/models/environment_metrics.py +8 -8
- beamlit/models/flavor.py +9 -9
- beamlit/models/function.py +3 -3
- beamlit/models/function_configuration.py +2 -2
- beamlit/models/function_deployment.py +24 -24
- beamlit/models/function_deployment_configuration.py +2 -2
- beamlit/models/function_deployment_pod_template.py +2 -2
- beamlit/models/function_kit.py +5 -5
- beamlit/models/function_provider_ref.py +2 -2
- beamlit/models/function_release.py +2 -2
- beamlit/models/function_spec.py +9 -3
- beamlit/models/function_with_deployments.py +6 -6
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
- beamlit/models/increase_and_rate_metric.py +5 -5
- beamlit/models/integration.py +12 -12
- beamlit/models/integration_config.py +2 -2
- beamlit/models/integration_connection.py +5 -5
- beamlit/models/integration_connection_config.py +2 -2
- beamlit/models/integration_connection_secret.py +2 -2
- beamlit/models/integration_model.py +6 -6
- beamlit/models/integration_secret.py +2 -2
- beamlit/models/invite_workspace_user_body.py +2 -2
- beamlit/models/labels_type_0.py +2 -2
- beamlit/models/location.py +5 -5
- beamlit/models/location_response.py +5 -5
- beamlit/models/metric.py +2 -2
- beamlit/models/metrics.py +8 -8
- beamlit/models/model.py +3 -3
- beamlit/models/model_deployment.py +18 -18
- beamlit/models/model_deployment_log.py +2 -2
- beamlit/models/model_deployment_metrics.py +9 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/model_deployment_pod_template.py +2 -2
- beamlit/models/model_metrics.py +6 -6
- beamlit/models/model_provider.py +11 -11
- beamlit/models/model_provider_ref.py +2 -2
- beamlit/models/model_release.py +2 -2
- beamlit/models/model_spec.py +9 -3
- beamlit/models/model_with_deployments.py +6 -6
- beamlit/models/pending_invitation.py +2 -2
- beamlit/models/pending_invitation_accept.py +3 -3
- beamlit/models/pending_invitation_render.py +5 -5
- beamlit/models/pending_invitation_render_invited_by.py +2 -2
- beamlit/models/pending_invitation_render_workspace.py +2 -2
- beamlit/models/pending_invitation_workspace_details.py +6 -6
- beamlit/models/policy.py +20 -20
- beamlit/models/policy_location.py +9 -9
- beamlit/models/policy_spec.py +9 -3
- beamlit/models/provider_config.py +7 -7
- beamlit/models/qps.py +2 -2
- beamlit/models/resource_deployment_log.py +2 -2
- beamlit/models/resource_deployment_metrics.py +16 -16
- beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/resource_environment_metrics.py +62 -24
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
- beamlit/models/resource_metrics.py +10 -10
- beamlit/models/runtime.py +23 -23
- beamlit/models/runtime_readiness_probe.py +2 -2
- beamlit/models/runtime_resources.py +2 -2
- beamlit/models/serverless_config.py +2 -2
- beamlit/models/standard_fields_dynamo_db.py +2 -2
- beamlit/models/store_agent.py +6 -6
- beamlit/models/store_agent_configuration.py +2 -2
- beamlit/models/store_agent_labels.py +2 -2
- beamlit/models/store_configuration.py +16 -16
- beamlit/models/store_configuration_option.py +2 -2
- beamlit/models/store_function.py +12 -12
- beamlit/models/store_function_configuration.py +2 -2
- beamlit/models/store_function_kit.py +5 -5
- beamlit/models/store_function_labels.py +2 -2
- beamlit/models/store_function_parameter.py +9 -9
- beamlit/models/update_workspace_service_account_body.py +2 -2
- beamlit/models/update_workspace_service_account_response_200.py +2 -2
- beamlit/models/update_workspace_user_role_body.py +2 -2
- beamlit/models/workspace.py +3 -3
- beamlit/models/workspace_labels.py +2 -2
- beamlit/models/workspace_user.py +2 -2
- beamlit/run.py +6 -6
- beamlit/serve/app.py +73 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/METADATA +7 -1
- beamlit-0.0.20rc7.dist-info/RECORD +293 -0
- beamlit-0.0.20rc5.dist-info/RECORD +0 -282
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -17,14 +17,14 @@ class ResourceDeploymentMetricsInferencePerSecondPerRegion:
|
|
17
17
|
"""Historical requests per second (RPS) per location, for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
region (Union[Unset,
|
20
|
+
region (Union[Unset, list['Metric']]): Array of metrics
|
21
21
|
"""
|
22
22
|
|
23
|
-
region: Union[Unset,
|
23
|
+
region: Union[Unset, list["Metric"]] = UNSET
|
24
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
25
|
|
26
26
|
def to_dict(self) -> dict[str, Any]:
|
27
|
-
region: Union[Unset,
|
27
|
+
region: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
@@ -40,7 +40,7 @@ class ResourceDeploymentMetricsInferencePerSecondPerRegion:
|
|
40
40
|
return field_dict
|
41
41
|
|
42
42
|
@classmethod
|
43
|
-
def from_dict(cls:
|
43
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
44
44
|
from ..models.metric import Metric
|
45
45
|
|
46
46
|
if not src_dict:
|
@@ -28,7 +28,9 @@ class ResourceDeploymentMetricsInferencePerSecondPerRegionType0:
|
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
31
|
-
componentsschemas_array_metric_item =
|
31
|
+
componentsschemas_array_metric_item = (
|
32
|
+
componentsschemas_array_metric_item_data.to_dict()
|
33
|
+
)
|
32
34
|
region.append(componentsschemas_array_metric_item)
|
33
35
|
|
34
36
|
field_dict: dict[str, Any] = {}
|
@@ -47,7 +49,9 @@ class ResourceDeploymentMetricsInferencePerSecondPerRegionType0:
|
|
47
49
|
region = []
|
48
50
|
_region = d.pop("region", UNSET)
|
49
51
|
for componentsschemas_array_metric_item_data in _region or []:
|
50
|
-
componentsschemas_array_metric_item = Metric.from_dict(
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(
|
53
|
+
componentsschemas_array_metric_item_data
|
54
|
+
)
|
51
55
|
|
52
56
|
region.append(componentsschemas_array_metric_item)
|
53
57
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -25,7 +25,7 @@ class ResourceDeploymentMetricsQueryPerRegionPerCode:
|
|
25
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
26
|
|
27
27
|
def to_dict(self) -> dict[str, Any]:
|
28
|
-
region: Union[Unset,
|
28
|
+
region: Union[Unset, dict[str, Any]] = UNSET
|
29
29
|
if not isinstance(self.region, Unset):
|
30
30
|
region = self.region.to_dict()
|
31
31
|
|
@@ -38,7 +38,7 @@ class ResourceDeploymentMetricsQueryPerRegionPerCode:
|
|
38
38
|
return field_dict
|
39
39
|
|
40
40
|
@classmethod
|
41
|
-
def from_dict(cls:
|
41
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
42
42
|
from ..models.qps import QPS
|
43
43
|
|
44
44
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -25,7 +25,7 @@ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
|
|
25
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
26
|
|
27
27
|
def to_dict(self) -> dict[str, Any]:
|
28
|
-
region: Union[Unset,
|
28
|
+
region: Union[Unset, dict[str, Any]] = UNSET
|
29
29
|
if not isinstance(self.region, Unset):
|
30
30
|
region = self.region.to_dict()
|
31
31
|
|
@@ -38,7 +38,7 @@ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
|
|
38
38
|
return field_dict
|
39
39
|
|
40
40
|
@classmethod
|
41
|
-
def from_dict(cls:
|
41
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
42
42
|
from ..models.qps import QPS
|
43
43
|
|
44
44
|
if not src_dict:
|
@@ -37,32 +37,42 @@ class ResourceEnvironmentMetrics:
|
|
37
37
|
"""
|
38
38
|
|
39
39
|
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
40
|
-
inference_per_second_per_region: Union[
|
40
|
+
inference_per_second_per_region: Union[
|
41
|
+
Unset, "ResourceEnvironmentMetricsInferencePerSecondPerRegion"
|
42
|
+
] = UNSET
|
41
43
|
query_per_second_global: Union[Unset, float] = UNSET
|
42
44
|
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
43
45
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
44
|
-
query_per_second_per_region_per_code: Union[
|
45
|
-
|
46
|
-
|
46
|
+
query_per_second_per_region_per_code: Union[
|
47
|
+
Unset, "ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode"
|
48
|
+
] = UNSET
|
47
49
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
48
50
|
|
49
51
|
def to_dict(self) -> dict[str, Any]:
|
50
52
|
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
51
53
|
if not isinstance(self.inference_per_second_global, Unset):
|
52
54
|
inference_per_second_global = []
|
53
|
-
for
|
54
|
-
|
55
|
+
for (
|
56
|
+
componentsschemas_array_metric_item_data
|
57
|
+
) in self.inference_per_second_global:
|
58
|
+
componentsschemas_array_metric_item = (
|
59
|
+
componentsschemas_array_metric_item_data.to_dict()
|
60
|
+
)
|
55
61
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
56
62
|
|
57
63
|
inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
58
64
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
59
|
-
inference_per_second_per_region =
|
65
|
+
inference_per_second_per_region = (
|
66
|
+
self.inference_per_second_per_region.to_dict()
|
67
|
+
)
|
60
68
|
|
61
69
|
query_per_second_global = self.query_per_second_global
|
62
70
|
|
63
71
|
query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
|
64
72
|
if not isinstance(self.query_per_second_per_code_global, Unset):
|
65
|
-
query_per_second_per_code_global =
|
73
|
+
query_per_second_per_code_global = (
|
74
|
+
self.query_per_second_per_code_global.to_dict()
|
75
|
+
)
|
66
76
|
|
67
77
|
query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
68
78
|
if not isinstance(self.query_per_second_per_region, Unset):
|
@@ -70,7 +80,9 @@ class ResourceEnvironmentMetrics:
|
|
70
80
|
|
71
81
|
query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
|
72
82
|
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
73
|
-
query_per_second_per_region_per_code =
|
83
|
+
query_per_second_per_region_per_code = (
|
84
|
+
self.query_per_second_per_region_per_code.to_dict()
|
85
|
+
)
|
74
86
|
|
75
87
|
field_dict: dict[str, Any] = {}
|
76
88
|
field_dict.update(self.additional_properties)
|
@@ -78,15 +90,21 @@ class ResourceEnvironmentMetrics:
|
|
78
90
|
if inference_per_second_global is not UNSET:
|
79
91
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
80
92
|
if inference_per_second_per_region is not UNSET:
|
81
|
-
field_dict["inference_per_second_per_region"] =
|
93
|
+
field_dict["inference_per_second_per_region"] = (
|
94
|
+
inference_per_second_per_region
|
95
|
+
)
|
82
96
|
if query_per_second_global is not UNSET:
|
83
97
|
field_dict["query_per_second_global"] = query_per_second_global
|
84
98
|
if query_per_second_per_code_global is not UNSET:
|
85
|
-
field_dict["query_per_second_per_code_global"] =
|
99
|
+
field_dict["query_per_second_per_code_global"] = (
|
100
|
+
query_per_second_per_code_global
|
101
|
+
)
|
86
102
|
if query_per_second_per_region is not UNSET:
|
87
103
|
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
88
104
|
if query_per_second_per_region_per_code is not UNSET:
|
89
|
-
field_dict["query_per_second_per_region_per_code"] =
|
105
|
+
field_dict["query_per_second_per_region_per_code"] = (
|
106
|
+
query_per_second_per_region_per_code
|
107
|
+
)
|
90
108
|
|
91
109
|
return field_dict
|
92
110
|
|
@@ -104,28 +122,42 @@ class ResourceEnvironmentMetrics:
|
|
104
122
|
d = src_dict.copy()
|
105
123
|
inference_per_second_global = []
|
106
124
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
107
|
-
for componentsschemas_array_metric_item_data in
|
108
|
-
|
125
|
+
for componentsschemas_array_metric_item_data in (
|
126
|
+
_inference_per_second_global or []
|
127
|
+
):
|
128
|
+
componentsschemas_array_metric_item = Metric.from_dict(
|
129
|
+
componentsschemas_array_metric_item_data
|
130
|
+
)
|
109
131
|
|
110
132
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
111
133
|
|
112
|
-
_inference_per_second_per_region = d.pop(
|
113
|
-
|
134
|
+
_inference_per_second_per_region = d.pop(
|
135
|
+
"inference_per_second_per_region", UNSET
|
136
|
+
)
|
137
|
+
inference_per_second_per_region: Union[
|
138
|
+
Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion
|
139
|
+
]
|
114
140
|
if isinstance(_inference_per_second_per_region, Unset):
|
115
141
|
inference_per_second_per_region = UNSET
|
116
142
|
else:
|
117
|
-
inference_per_second_per_region =
|
118
|
-
|
143
|
+
inference_per_second_per_region = (
|
144
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion.from_dict(
|
145
|
+
_inference_per_second_per_region
|
146
|
+
)
|
119
147
|
)
|
120
148
|
|
121
149
|
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
122
150
|
|
123
|
-
_query_per_second_per_code_global = d.pop(
|
151
|
+
_query_per_second_per_code_global = d.pop(
|
152
|
+
"query_per_second_per_code_global", UNSET
|
153
|
+
)
|
124
154
|
query_per_second_per_code_global: Union[Unset, QPS]
|
125
155
|
if isinstance(_query_per_second_per_code_global, Unset):
|
126
156
|
query_per_second_per_code_global = UNSET
|
127
157
|
else:
|
128
|
-
query_per_second_per_code_global = QPS.from_dict(
|
158
|
+
query_per_second_per_code_global = QPS.from_dict(
|
159
|
+
_query_per_second_per_code_global
|
160
|
+
)
|
129
161
|
|
130
162
|
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
131
163
|
query_per_second_per_region: Union[Unset, QPS]
|
@@ -134,13 +166,19 @@ class ResourceEnvironmentMetrics:
|
|
134
166
|
else:
|
135
167
|
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
136
168
|
|
137
|
-
_query_per_second_per_region_per_code = d.pop(
|
138
|
-
|
169
|
+
_query_per_second_per_region_per_code = d.pop(
|
170
|
+
"query_per_second_per_region_per_code", UNSET
|
171
|
+
)
|
172
|
+
query_per_second_per_region_per_code: Union[
|
173
|
+
Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode
|
174
|
+
]
|
139
175
|
if isinstance(_query_per_second_per_region_per_code, Unset):
|
140
176
|
query_per_second_per_region_per_code = UNSET
|
141
177
|
else:
|
142
|
-
query_per_second_per_region_per_code =
|
143
|
-
|
178
|
+
query_per_second_per_region_per_code = (
|
179
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode.from_dict(
|
180
|
+
_query_per_second_per_region_per_code
|
181
|
+
)
|
144
182
|
)
|
145
183
|
|
146
184
|
resource_environment_metrics = cls(
|
@@ -28,7 +28,9 @@ class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
31
|
-
componentsschemas_array_metric_item =
|
31
|
+
componentsschemas_array_metric_item = (
|
32
|
+
componentsschemas_array_metric_item_data.to_dict()
|
33
|
+
)
|
32
34
|
region.append(componentsschemas_array_metric_item)
|
33
35
|
|
34
36
|
field_dict: dict[str, Any] = {}
|
@@ -47,7 +49,9 @@ class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
|
47
49
|
region = []
|
48
50
|
_region = d.pop("region", UNSET)
|
49
51
|
for componentsschemas_array_metric_item_data in _region or []:
|
50
|
-
componentsschemas_array_metric_item = Metric.from_dict(
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(
|
53
|
+
componentsschemas_array_metric_item_data
|
54
|
+
)
|
51
55
|
|
52
56
|
region.append(componentsschemas_array_metric_item)
|
53
57
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -18,40 +18,40 @@ class ResourceMetrics:
|
|
18
18
|
"""Metrics for a single resource (eg. model, function)
|
19
19
|
|
20
20
|
Attributes:
|
21
|
-
inference_global (Union[Unset,
|
22
|
-
inference_per_second_global (Union[Unset,
|
21
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
22
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
23
23
|
query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
|
24
24
|
400) or per location
|
25
25
|
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
26
26
|
(e.g. 200, 400) or per location
|
27
27
|
"""
|
28
28
|
|
29
|
-
inference_global: Union[Unset,
|
30
|
-
inference_per_second_global: Union[Unset,
|
29
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
30
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
31
31
|
query_per_region: Union[Unset, "QPS"] = UNSET
|
32
32
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
33
33
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
34
34
|
|
35
35
|
def to_dict(self) -> dict[str, Any]:
|
36
|
-
inference_global: Union[Unset,
|
36
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
37
37
|
if not isinstance(self.inference_global, Unset):
|
38
38
|
inference_global = []
|
39
39
|
for componentsschemas_array_metric_item_data in self.inference_global:
|
40
40
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
41
41
|
inference_global.append(componentsschemas_array_metric_item)
|
42
42
|
|
43
|
-
inference_per_second_global: Union[Unset,
|
43
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
44
44
|
if not isinstance(self.inference_per_second_global, Unset):
|
45
45
|
inference_per_second_global = []
|
46
46
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
47
47
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
48
48
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
49
49
|
|
50
|
-
query_per_region: Union[Unset,
|
50
|
+
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
51
51
|
if not isinstance(self.query_per_region, Unset):
|
52
52
|
query_per_region = self.query_per_region.to_dict()
|
53
53
|
|
54
|
-
query_per_second_per_region: Union[Unset,
|
54
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
55
55
|
if not isinstance(self.query_per_second_per_region, Unset):
|
56
56
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
57
57
|
|
@@ -70,7 +70,7 @@ class ResourceMetrics:
|
|
70
70
|
return field_dict
|
71
71
|
|
72
72
|
@classmethod
|
73
|
-
def from_dict(cls:
|
73
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
74
74
|
from ..models.metric import Metric
|
75
75
|
from ..models.qps import QPS
|
76
76
|
|
beamlit/models/runtime.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -18,38 +18,38 @@ class Runtime:
|
|
18
18
|
"""Set of configurations for a deployment
|
19
19
|
|
20
20
|
Attributes:
|
21
|
-
args (Union[Unset,
|
22
|
-
command (Union[Unset,
|
23
|
-
envs (Union[Unset,
|
21
|
+
args (Union[Unset, list[Any]]): The arguments to pass to the deployment runtime
|
22
|
+
command (Union[Unset, list[Any]]): The command to run the deployment
|
23
|
+
envs (Union[Unset, list[Any]]): The environment variables to set in the deployment. Should be a list of
|
24
24
|
Kubernetes EnvVar types
|
25
25
|
image (Union[Unset, str]): The Docker image for the deployment
|
26
26
|
model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
|
27
27
|
readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
|
28
28
|
resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
|
29
29
|
ResourceRequirements type
|
30
|
-
|
30
|
+
type_ (Union[Unset, str]): The type of origin for the deployment
|
31
31
|
"""
|
32
32
|
|
33
|
-
args: Union[Unset,
|
34
|
-
command: Union[Unset,
|
35
|
-
envs: Union[Unset,
|
33
|
+
args: Union[Unset, list[Any]] = UNSET
|
34
|
+
command: Union[Unset, list[Any]] = UNSET
|
35
|
+
envs: Union[Unset, list[Any]] = UNSET
|
36
36
|
image: Union[Unset, str] = UNSET
|
37
37
|
model: Union[Unset, str] = UNSET
|
38
38
|
readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
|
39
39
|
resources: Union[Unset, "RuntimeResources"] = UNSET
|
40
|
-
|
40
|
+
type_: Union[Unset, str] = UNSET
|
41
41
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
42
42
|
|
43
43
|
def to_dict(self) -> dict[str, Any]:
|
44
|
-
args: Union[Unset,
|
44
|
+
args: Union[Unset, list[Any]] = UNSET
|
45
45
|
if not isinstance(self.args, Unset):
|
46
46
|
args = self.args
|
47
47
|
|
48
|
-
command: Union[Unset,
|
48
|
+
command: Union[Unset, list[Any]] = UNSET
|
49
49
|
if not isinstance(self.command, Unset):
|
50
50
|
command = self.command
|
51
51
|
|
52
|
-
envs: Union[Unset,
|
52
|
+
envs: Union[Unset, list[Any]] = UNSET
|
53
53
|
if not isinstance(self.envs, Unset):
|
54
54
|
envs = self.envs
|
55
55
|
|
@@ -57,15 +57,15 @@ class Runtime:
|
|
57
57
|
|
58
58
|
model = self.model
|
59
59
|
|
60
|
-
readiness_probe: Union[Unset,
|
60
|
+
readiness_probe: Union[Unset, dict[str, Any]] = UNSET
|
61
61
|
if not isinstance(self.readiness_probe, Unset):
|
62
62
|
readiness_probe = self.readiness_probe.to_dict()
|
63
63
|
|
64
|
-
resources: Union[Unset,
|
64
|
+
resources: Union[Unset, dict[str, Any]] = UNSET
|
65
65
|
if not isinstance(self.resources, Unset):
|
66
66
|
resources = self.resources.to_dict()
|
67
67
|
|
68
|
-
|
68
|
+
type_ = self.type_
|
69
69
|
|
70
70
|
field_dict: dict[str, Any] = {}
|
71
71
|
field_dict.update(self.additional_properties)
|
@@ -84,24 +84,24 @@ class Runtime:
|
|
84
84
|
field_dict["readiness_probe"] = readiness_probe
|
85
85
|
if resources is not UNSET:
|
86
86
|
field_dict["resources"] = resources
|
87
|
-
if
|
88
|
-
field_dict["type"] =
|
87
|
+
if type_ is not UNSET:
|
88
|
+
field_dict["type"] = type_
|
89
89
|
|
90
90
|
return field_dict
|
91
91
|
|
92
92
|
@classmethod
|
93
|
-
def from_dict(cls:
|
93
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
94
94
|
from ..models.runtime_readiness_probe import RuntimeReadinessProbe
|
95
95
|
from ..models.runtime_resources import RuntimeResources
|
96
96
|
|
97
97
|
if not src_dict:
|
98
98
|
return None
|
99
99
|
d = src_dict.copy()
|
100
|
-
args = cast(
|
100
|
+
args = cast(list[Any], d.pop("args", UNSET))
|
101
101
|
|
102
|
-
command = cast(
|
102
|
+
command = cast(list[Any], d.pop("command", UNSET))
|
103
103
|
|
104
|
-
envs = cast(
|
104
|
+
envs = cast(list[Any], d.pop("envs", UNSET))
|
105
105
|
|
106
106
|
image = d.pop("image", UNSET)
|
107
107
|
|
@@ -121,7 +121,7 @@ class Runtime:
|
|
121
121
|
else:
|
122
122
|
resources = RuntimeResources.from_dict(_resources)
|
123
123
|
|
124
|
-
|
124
|
+
type_ = d.pop("type", UNSET)
|
125
125
|
|
126
126
|
runtime = cls(
|
127
127
|
args=args,
|
@@ -131,7 +131,7 @@ class Runtime:
|
|
131
131
|
model=model,
|
132
132
|
readiness_probe=readiness_probe,
|
133
133
|
resources=resources,
|
134
|
-
|
134
|
+
type_=type_,
|
135
135
|
)
|
136
136
|
|
137
137
|
runtime.additional_properties = d
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class RuntimeReadinessProbe:
|
|
19
19
|
return field_dict
|
20
20
|
|
21
21
|
@classmethod
|
22
|
-
def from_dict(cls:
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class RuntimeResources:
|
|
19
19
|
return field_dict
|
20
20
|
|
21
21
|
@classmethod
|
22
|
-
def from_dict(cls:
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -73,7 +73,7 @@ class ServerlessConfig:
|
|
73
73
|
return field_dict
|
74
74
|
|
75
75
|
@classmethod
|
76
|
-
def from_dict(cls:
|
76
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
77
77
|
if not src_dict:
|
78
78
|
return None
|
79
79
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -49,7 +49,7 @@ class StandardFieldsDynamoDb:
|
|
49
49
|
return field_dict
|
50
50
|
|
51
51
|
@classmethod
|
52
|
-
def from_dict(cls:
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
53
|
if not src_dict:
|
54
54
|
return None
|
55
55
|
d = src_dict.copy()
|
beamlit/models/store_agent.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -22,7 +22,7 @@ class StoreAgent:
|
|
22
22
|
created_by (Union[Unset, str]): The user or service account who created the resource
|
23
23
|
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
24
24
|
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
25
|
-
configuration (Union[Unset,
|
25
|
+
configuration (Union[Unset, list['StoreConfiguration']]): Store agent configuration
|
26
26
|
description (Union[Unset, str]): Store agent description
|
27
27
|
display_name (Union[Unset, str]): Store agent display name
|
28
28
|
image (Union[Unset, str]): Store agent image
|
@@ -34,7 +34,7 @@ class StoreAgent:
|
|
34
34
|
created_by: Union[Unset, str] = UNSET
|
35
35
|
updated_at: Union[Unset, str] = UNSET
|
36
36
|
updated_by: Union[Unset, str] = UNSET
|
37
|
-
configuration: Union[Unset,
|
37
|
+
configuration: Union[Unset, list["StoreConfiguration"]] = UNSET
|
38
38
|
description: Union[Unset, str] = UNSET
|
39
39
|
display_name: Union[Unset, str] = UNSET
|
40
40
|
image: Union[Unset, str] = UNSET
|
@@ -51,7 +51,7 @@ class StoreAgent:
|
|
51
51
|
|
52
52
|
updated_by = self.updated_by
|
53
53
|
|
54
|
-
configuration: Union[Unset,
|
54
|
+
configuration: Union[Unset, list[dict[str, Any]]] = UNSET
|
55
55
|
if not isinstance(self.configuration, Unset):
|
56
56
|
configuration = []
|
57
57
|
for configuration_item_data in self.configuration:
|
@@ -64,7 +64,7 @@ class StoreAgent:
|
|
64
64
|
|
65
65
|
image = self.image
|
66
66
|
|
67
|
-
labels: Union[Unset,
|
67
|
+
labels: Union[Unset, dict[str, Any]] = UNSET
|
68
68
|
if not isinstance(self.labels, Unset):
|
69
69
|
labels = self.labels.to_dict()
|
70
70
|
|
@@ -97,7 +97,7 @@ class StoreAgent:
|
|
97
97
|
return field_dict
|
98
98
|
|
99
99
|
@classmethod
|
100
|
-
def from_dict(cls:
|
100
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
101
101
|
from ..models.store_agent_labels import StoreAgentLabels
|
102
102
|
from ..models.store_configuration import StoreConfiguration
|
103
103
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -55,7 +55,7 @@ class StoreAgentConfiguration:
|
|
55
55
|
return field_dict
|
56
56
|
|
57
57
|
@classmethod
|
58
|
-
def from_dict(cls:
|
58
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
59
59
|
if not src_dict:
|
60
60
|
return None
|
61
61
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -19,7 +19,7 @@ class StoreAgentLabels:
|
|
19
19
|
return field_dict
|
20
20
|
|
21
21
|
@classmethod
|
22
|
-
def from_dict(cls:
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|