beamlit 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/create_agent.py +14 -9
- beamlit/api/agents/delete_agent_history.py +159 -0
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
- beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +185 -0
- beamlit/api/agents/update_agent.py +14 -9
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/create_function.py +14 -9
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/functions/update_function.py +14 -9
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/create_integration_connection.py +167 -0
- beamlit/api/integrations/delete_integration_connection.py +158 -0
- beamlit/api/integrations/get_integration.py +97 -0
- beamlit/api/integrations/get_integration_connection.py +154 -0
- beamlit/api/integrations/get_integration_connection_model.py +97 -0
- beamlit/api/integrations/get_integration_model.py +97 -0
- beamlit/api/integrations/list_integration_connection_models.py +97 -0
- beamlit/api/integrations/list_integration_connections.py +139 -0
- beamlit/api/integrations/list_integration_models.py +97 -0
- beamlit/api/integrations/update_integration_connection.py +180 -0
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +29 -8
- beamlit/authentication/apikey.py +8 -2
- beamlit/authentication/authentication.py +66 -3
- beamlit/authentication/clientcredentials.py +108 -0
- beamlit/authentication/credentials.py +22 -8
- beamlit/authentication/device_mode.py +23 -13
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +183 -0
- beamlit/common/logger.py +29 -0
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +156 -0
- beamlit/common/utils.py +15 -0
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/functions/github/__init__.py +3 -0
- beamlit/functions/github/github.py +21 -0
- beamlit/functions/github/kit/__init__.py +7 -0
- beamlit/functions/github/kit/pull_request.py +51 -0
- beamlit/functions/math/__init__.py +3 -0
- beamlit/functions/math/math.py +40 -0
- beamlit/functions/search/__init__.py +3 -0
- beamlit/functions/search/search.py +15 -0
- beamlit/models/__init__.py +24 -0
- beamlit/models/acl.py +4 -2
- beamlit/models/agent.py +5 -3
- beamlit/models/agent_chain.py +4 -2
- beamlit/models/agent_configuration.py +4 -2
- beamlit/models/agent_deployment.py +41 -28
- beamlit/models/agent_deployment_configuration.py +4 -2
- beamlit/models/agent_deployment_configuration_type_0.py +43 -0
- beamlit/models/agent_deployment_history.py +7 -5
- beamlit/models/agent_deployment_history_event.py +11 -9
- beamlit/models/agent_deployment_pod_template.py +4 -2
- beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +4 -2
- beamlit/models/agent_spec.py +248 -0
- beamlit/models/agent_with_deployments.py +176 -0
- beamlit/models/api_key.py +4 -2
- beamlit/models/authentication_provider_model.py +8 -6
- beamlit/models/authentication_provider_organization.py +4 -2
- beamlit/models/configuration.py +12 -10
- beamlit/models/continent.py +4 -2
- beamlit/models/core_spec.py +185 -0
- beamlit/models/country.py +4 -2
- beamlit/models/create_api_key_for_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_body.py +4 -2
- beamlit/models/create_workspace_service_account_response_200.py +4 -2
- beamlit/models/delete_workspace_service_account_response_200.py +4 -2
- beamlit/models/deployment_configuration.py +4 -2
- beamlit/models/deployment_configurations.py +22 -7
- beamlit/models/deployment_serverless_config.py +4 -2
- beamlit/models/deployment_serverless_config_type_0.py +220 -0
- beamlit/models/environment.py +9 -7
- beamlit/models/environment_metrics.py +26 -5
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +11 -9
- beamlit/models/function.py +5 -3
- beamlit/models/function_configuration.py +4 -2
- beamlit/models/function_deployment.py +33 -20
- beamlit/models/function_deployment_configuration.py +4 -2
- beamlit/models/function_deployment_configuration_type_0.py +43 -0
- beamlit/models/function_deployment_pod_template.py +4 -2
- beamlit/models/function_deployment_pod_template_type_0.py +43 -0
- beamlit/models/function_kit.py +7 -5
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +4 -2
- beamlit/models/function_release.py +4 -2
- beamlit/models/function_spec.py +246 -0
- beamlit/models/function_with_deployments.py +176 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
- beamlit/models/increase_and_rate_metric.py +104 -0
- beamlit/models/integration.py +198 -0
- beamlit/models/integration_config.py +45 -0
- beamlit/models/integration_connection.py +198 -0
- beamlit/models/integration_connection_config.py +45 -0
- beamlit/models/integration_connection_secret.py +61 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +144 -0
- beamlit/models/integration_secret.py +61 -0
- beamlit/models/invite_workspace_user_body.py +4 -2
- beamlit/models/labels_type_0.py +4 -2
- beamlit/models/location.py +7 -5
- beamlit/models/location_response.py +7 -5
- beamlit/models/metadata.py +135 -0
- beamlit/models/{labels.py → metadata_labels.py} +5 -5
- beamlit/models/metric.py +4 -2
- beamlit/models/metrics.py +68 -25
- beamlit/models/model.py +5 -3
- beamlit/models/model_deployment.py +27 -14
- beamlit/models/model_deployment_log.py +4 -2
- beamlit/models/model_deployment_metrics.py +11 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/model_deployment_pod_template.py +4 -2
- beamlit/models/model_deployment_pod_template_type_0.py +43 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +8 -6
- beamlit/models/model_provider.py +13 -11
- beamlit/models/model_provider_ref.py +4 -2
- beamlit/models/model_release.py +4 -2
- beamlit/models/model_spec.py +194 -0
- beamlit/models/model_with_deployments.py +8 -6
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +4 -2
- beamlit/models/pending_invitation_accept.py +5 -3
- beamlit/models/pending_invitation_render.py +7 -5
- beamlit/models/pending_invitation_render_invited_by.py +4 -2
- beamlit/models/pending_invitation_render_workspace.py +4 -2
- beamlit/models/pending_invitation_workspace_details.py +8 -6
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +22 -20
- beamlit/models/policy_location.py +11 -9
- beamlit/models/policy_spec.py +125 -0
- beamlit/models/provider_config.py +9 -16
- beamlit/models/qps.py +4 -2
- beamlit/models/resource_deployment_log.py +4 -2
- beamlit/models/resource_deployment_metrics.py +119 -9
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
- beamlit/models/resource_environment_metrics.py +210 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +44 -6
- beamlit/models/runtime.py +25 -23
- beamlit/models/runtime_readiness_probe.py +4 -2
- beamlit/models/runtime_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_resources.py +4 -2
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +4 -2
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +4 -2
- beamlit/models/store_agent.py +8 -6
- beamlit/models/store_agent_configuration.py +4 -2
- beamlit/models/store_agent_labels.py +4 -2
- beamlit/models/store_agent_labels_type_0.py +43 -0
- beamlit/models/store_configuration.py +18 -16
- beamlit/models/store_configuration_option.py +4 -2
- beamlit/models/store_function.py +14 -12
- beamlit/models/store_function_configuration.py +4 -2
- beamlit/models/store_function_kit.py +7 -5
- beamlit/models/store_function_labels.py +4 -2
- beamlit/models/store_function_labels_type_0.py +43 -0
- beamlit/models/store_function_parameter.py +11 -9
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +4 -2
- beamlit/models/update_workspace_service_account_response_200.py +4 -2
- beamlit/models/update_workspace_user_role_body.py +4 -2
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +5 -3
- beamlit/models/workspace_labels.py +4 -2
- beamlit/models/workspace_user.py +4 -2
- beamlit/run.py +49 -0
- beamlit/serve/app.py +78 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
- beamlit-0.0.20.dist-info/RECORD +301 -0
- beamlit-0.0.18.dist-info/RECORD +0 -211
- /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
- {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.qps import QPS
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode:
|
17
|
+
"""RPS value (in last 24 hours) per response status code per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200, 400) or per
|
21
|
+
location
|
22
|
+
"""
|
23
|
+
|
24
|
+
region: Union[Unset, "QPS"] = UNSET
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
|
+
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
28
|
+
region: Union[Unset, Dict[str, Any]] = UNSET
|
29
|
+
if not isinstance(self.region, Unset):
|
30
|
+
region = self.region.to_dict()
|
31
|
+
|
32
|
+
field_dict: dict[str, Any] = {}
|
33
|
+
field_dict.update(self.additional_properties)
|
34
|
+
field_dict.update({})
|
35
|
+
if region is not UNSET:
|
36
|
+
field_dict["region"] = region
|
37
|
+
|
38
|
+
return field_dict
|
39
|
+
|
40
|
+
@classmethod
|
41
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
42
|
+
from ..models.qps import QPS
|
43
|
+
|
44
|
+
d = src_dict.copy()
|
45
|
+
_region = d.pop("region", UNSET)
|
46
|
+
region: Union[Unset, QPS]
|
47
|
+
if isinstance(_region, Unset):
|
48
|
+
region = UNSET
|
49
|
+
else:
|
50
|
+
region = QPS.from_dict(_region)
|
51
|
+
|
52
|
+
resource_environment_metrics_query_per_second_per_region_per_code = cls(
|
53
|
+
region=region,
|
54
|
+
)
|
55
|
+
|
56
|
+
resource_environment_metrics_query_per_second_per_region_per_code.additional_properties = d
|
57
|
+
return resource_environment_metrics_query_per_second_per_region_per_code
|
58
|
+
|
59
|
+
@property
|
60
|
+
def additional_keys(self) -> list[str]:
|
61
|
+
return list(self.additional_properties.keys())
|
62
|
+
|
63
|
+
def __getitem__(self, key: str) -> Any:
|
64
|
+
return self.additional_properties[key]
|
65
|
+
|
66
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
67
|
+
self.additional_properties[key] = value
|
68
|
+
|
69
|
+
def __delitem__(self, key: str) -> None:
|
70
|
+
del self.additional_properties[key]
|
71
|
+
|
72
|
+
def __contains__(self, key: str) -> bool:
|
73
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="ResourceLog")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class ResourceLog:
|
13
|
+
"""Log for a resource deployment (eg. model deployment, function deployment)
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
message (Union[Unset, str]): Content of the log
|
17
|
+
timestamp (Union[Unset, str]): The timestamp of the log
|
18
|
+
"""
|
19
|
+
|
20
|
+
message: Union[Unset, str] = UNSET
|
21
|
+
timestamp: 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
|
+
message = self.message
|
26
|
+
|
27
|
+
timestamp = self.timestamp
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if message is not UNSET:
|
33
|
+
field_dict["message"] = message
|
34
|
+
if timestamp is not UNSET:
|
35
|
+
field_dict["timestamp"] = timestamp
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
message = d.pop("message", UNSET)
|
43
|
+
|
44
|
+
timestamp = d.pop("timestamp", UNSET)
|
45
|
+
|
46
|
+
resource_log = cls(
|
47
|
+
message=message,
|
48
|
+
timestamp=timestamp,
|
49
|
+
)
|
50
|
+
|
51
|
+
resource_log.additional_properties = d
|
52
|
+
return resource_log
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
@@ -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,43 +18,72 @@ class ResourceMetrics:
|
|
18
18
|
"""Metrics for a single resource (eg. model, function)
|
19
19
|
|
20
20
|
Attributes:
|
21
|
-
|
21
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
22
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
23
|
+
query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
|
24
|
+
400) or per location
|
22
25
|
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
23
26
|
(e.g. 200, 400) or per location
|
24
27
|
"""
|
25
28
|
|
26
|
-
|
29
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
30
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
31
|
+
query_per_region: Union[Unset, "QPS"] = UNSET
|
27
32
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
28
33
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
34
|
|
30
35
|
def to_dict(self) -> dict[str, Any]:
|
31
|
-
|
36
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
37
|
+
if not isinstance(self.inference_global, Unset):
|
38
|
+
inference_global = []
|
39
|
+
for componentsschemas_array_metric_item_data in self.inference_global:
|
40
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
41
|
+
inference_global.append(componentsschemas_array_metric_item)
|
42
|
+
|
43
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
32
44
|
if not isinstance(self.inference_per_second_global, Unset):
|
33
45
|
inference_per_second_global = []
|
34
46
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
35
47
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
36
48
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
37
49
|
|
38
|
-
|
50
|
+
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
51
|
+
if not isinstance(self.query_per_region, Unset):
|
52
|
+
query_per_region = self.query_per_region.to_dict()
|
53
|
+
|
54
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
39
55
|
if not isinstance(self.query_per_second_per_region, Unset):
|
40
56
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
41
57
|
|
42
58
|
field_dict: dict[str, Any] = {}
|
43
59
|
field_dict.update(self.additional_properties)
|
44
60
|
field_dict.update({})
|
61
|
+
if inference_global is not UNSET:
|
62
|
+
field_dict["inference_global"] = inference_global
|
45
63
|
if inference_per_second_global is not UNSET:
|
46
64
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
65
|
+
if query_per_region is not UNSET:
|
66
|
+
field_dict["query_per_region"] = query_per_region
|
47
67
|
if query_per_second_per_region is not UNSET:
|
48
68
|
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
49
69
|
|
50
70
|
return field_dict
|
51
71
|
|
52
72
|
@classmethod
|
53
|
-
def from_dict(cls:
|
73
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
54
74
|
from ..models.metric import Metric
|
55
75
|
from ..models.qps import QPS
|
56
76
|
|
77
|
+
if not src_dict:
|
78
|
+
return None
|
57
79
|
d = src_dict.copy()
|
80
|
+
inference_global = []
|
81
|
+
_inference_global = d.pop("inference_global", UNSET)
|
82
|
+
for componentsschemas_array_metric_item_data in _inference_global or []:
|
83
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
84
|
+
|
85
|
+
inference_global.append(componentsschemas_array_metric_item)
|
86
|
+
|
58
87
|
inference_per_second_global = []
|
59
88
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
60
89
|
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
@@ -62,6 +91,13 @@ class ResourceMetrics:
|
|
62
91
|
|
63
92
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
64
93
|
|
94
|
+
_query_per_region = d.pop("query_per_region", UNSET)
|
95
|
+
query_per_region: Union[Unset, QPS]
|
96
|
+
if isinstance(_query_per_region, Unset):
|
97
|
+
query_per_region = UNSET
|
98
|
+
else:
|
99
|
+
query_per_region = QPS.from_dict(_query_per_region)
|
100
|
+
|
65
101
|
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
66
102
|
query_per_second_per_region: Union[Unset, QPS]
|
67
103
|
if isinstance(_query_per_second_per_region, Unset):
|
@@ -70,7 +106,9 @@ class ResourceMetrics:
|
|
70
106
|
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
71
107
|
|
72
108
|
resource_metrics = cls(
|
109
|
+
inference_global=inference_global,
|
73
110
|
inference_per_second_global=inference_per_second_global,
|
111
|
+
query_per_region=query_per_region,
|
74
112
|
query_per_second_per_region=query_per_second_per_region,
|
75
113
|
)
|
76
114
|
|
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,22 +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
|
+
if not src_dict:
|
98
|
+
return None
|
97
99
|
d = src_dict.copy()
|
98
|
-
args = cast(
|
100
|
+
args = cast(list[Any], d.pop("args", UNSET))
|
99
101
|
|
100
|
-
command = cast(
|
102
|
+
command = cast(list[Any], d.pop("command", UNSET))
|
101
103
|
|
102
|
-
envs = cast(
|
104
|
+
envs = cast(list[Any], d.pop("envs", UNSET))
|
103
105
|
|
104
106
|
image = d.pop("image", UNSET)
|
105
107
|
|
@@ -119,7 +121,7 @@ class Runtime:
|
|
119
121
|
else:
|
120
122
|
resources = RuntimeResources.from_dict(_resources)
|
121
123
|
|
122
|
-
|
124
|
+
type_ = d.pop("type", UNSET)
|
123
125
|
|
124
126
|
runtime = cls(
|
125
127
|
args=args,
|
@@ -129,7 +131,7 @@ class Runtime:
|
|
129
131
|
model=model,
|
130
132
|
readiness_probe=readiness_probe,
|
131
133
|
resources=resources,
|
132
|
-
|
134
|
+
type_=type_,
|
133
135
|
)
|
134
136
|
|
135
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,9 @@ 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
|
+
if not src_dict:
|
24
|
+
return None
|
23
25
|
d = src_dict.copy()
|
24
26
|
runtime_readiness_probe = cls()
|
25
27
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeReadinessProbeType0")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeReadinessProbeType0:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
d = src_dict.copy()
|
24
|
+
runtime_readiness_probe_type_0 = cls()
|
25
|
+
|
26
|
+
runtime_readiness_probe_type_0.additional_properties = d
|
27
|
+
return runtime_readiness_probe_type_0
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -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,9 @@ 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
|
+
if not src_dict:
|
24
|
+
return None
|
23
25
|
d = src_dict.copy()
|
24
26
|
runtime_resources = cls()
|
25
27
|
|
@@ -0,0 +1,111 @@
|
|
1
|
+
from typing import Any, List, Type, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="RuntimeType0")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RuntimeType0:
|
13
|
+
"""Set of configurations for a deployment
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
args (Union[Unset, List[Any]]): The arguments to pass to the deployment runtime
|
17
|
+
command (Union[Unset, List[Any]]): The command to run the deployment
|
18
|
+
envs (Union[Unset, List[Any]]): The environment variables to set in the deployment. Should be a list of
|
19
|
+
Kubernetes EnvVar types
|
20
|
+
image (Union[Unset, str]): The Docker image for the deployment
|
21
|
+
model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
|
22
|
+
type (Union[Unset, str]): The type of origin for the deployment
|
23
|
+
"""
|
24
|
+
|
25
|
+
args: Union[Unset, List[Any]] = UNSET
|
26
|
+
command: Union[Unset, List[Any]] = UNSET
|
27
|
+
envs: Union[Unset, List[Any]] = UNSET
|
28
|
+
image: Union[Unset, str] = UNSET
|
29
|
+
model: Union[Unset, str] = UNSET
|
30
|
+
type: Union[Unset, str] = UNSET
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
32
|
+
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
34
|
+
args: Union[Unset, List[Any]] = UNSET
|
35
|
+
if not isinstance(self.args, Unset):
|
36
|
+
args = self.args
|
37
|
+
|
38
|
+
command: Union[Unset, List[Any]] = UNSET
|
39
|
+
if not isinstance(self.command, Unset):
|
40
|
+
command = self.command
|
41
|
+
|
42
|
+
envs: Union[Unset, List[Any]] = UNSET
|
43
|
+
if not isinstance(self.envs, Unset):
|
44
|
+
envs = self.envs
|
45
|
+
|
46
|
+
image = self.image
|
47
|
+
|
48
|
+
model = self.model
|
49
|
+
|
50
|
+
type = self.type
|
51
|
+
|
52
|
+
field_dict: dict[str, Any] = {}
|
53
|
+
field_dict.update(self.additional_properties)
|
54
|
+
field_dict.update({})
|
55
|
+
if args is not UNSET:
|
56
|
+
field_dict["args"] = args
|
57
|
+
if command is not UNSET:
|
58
|
+
field_dict["command"] = command
|
59
|
+
if envs is not UNSET:
|
60
|
+
field_dict["envs"] = envs
|
61
|
+
if image is not UNSET:
|
62
|
+
field_dict["image"] = image
|
63
|
+
if model is not UNSET:
|
64
|
+
field_dict["model"] = model
|
65
|
+
if type is not UNSET:
|
66
|
+
field_dict["type"] = type
|
67
|
+
|
68
|
+
return field_dict
|
69
|
+
|
70
|
+
@classmethod
|
71
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
72
|
+
d = src_dict.copy()
|
73
|
+
args = cast(List[Any], d.pop("args", UNSET))
|
74
|
+
|
75
|
+
command = cast(List[Any], d.pop("command", UNSET))
|
76
|
+
|
77
|
+
envs = cast(List[Any], d.pop("envs", UNSET))
|
78
|
+
|
79
|
+
image = d.pop("image", UNSET)
|
80
|
+
|
81
|
+
model = d.pop("model", UNSET)
|
82
|
+
|
83
|
+
type = d.pop("type", UNSET)
|
84
|
+
|
85
|
+
runtime_type_0 = cls(
|
86
|
+
args=args,
|
87
|
+
command=command,
|
88
|
+
envs=envs,
|
89
|
+
image=image,
|
90
|
+
model=model,
|
91
|
+
type=type,
|
92
|
+
)
|
93
|
+
|
94
|
+
runtime_type_0.additional_properties = d
|
95
|
+
return runtime_type_0
|
96
|
+
|
97
|
+
@property
|
98
|
+
def additional_keys(self) -> list[str]:
|
99
|
+
return list(self.additional_properties.keys())
|
100
|
+
|
101
|
+
def __getitem__(self, key: str) -> Any:
|
102
|
+
return self.additional_properties[key]
|
103
|
+
|
104
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
105
|
+
self.additional_properties[key] = value
|
106
|
+
|
107
|
+
def __delitem__(self, key: str) -> None:
|
108
|
+
del self.additional_properties[key]
|
109
|
+
|
110
|
+
def __contains__(self, key: str) -> bool:
|
111
|
+
return key in self.additional_properties
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeType0ReadinessProbe")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeType0ReadinessProbe:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
d = src_dict.copy()
|
24
|
+
runtime_type_0_readiness_probe = cls()
|
25
|
+
|
26
|
+
runtime_type_0_readiness_probe.additional_properties = d
|
27
|
+
return runtime_type_0_readiness_probe
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeType0ReadinessProbeType0")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeType0ReadinessProbeType0:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
d = src_dict.copy()
|
24
|
+
runtime_type_0_readiness_probe_type_0 = cls()
|
25
|
+
|
26
|
+
runtime_type_0_readiness_probe_type_0.additional_properties = d
|
27
|
+
return runtime_type_0_readiness_probe_type_0
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|