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
@@ -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
|
@@ -14,38 +14,40 @@ class PolicyLocation:
|
|
14
14
|
|
15
15
|
Attributes:
|
16
16
|
name (Union[Unset, str]): Policy location name
|
17
|
-
|
17
|
+
type_ (Union[Unset, str]): Policy location type
|
18
18
|
"""
|
19
19
|
|
20
20
|
name: Union[Unset, str] = UNSET
|
21
|
-
|
21
|
+
type_: Union[Unset, str] = UNSET
|
22
22
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
23
|
|
24
24
|
def to_dict(self) -> dict[str, Any]:
|
25
25
|
name = self.name
|
26
26
|
|
27
|
-
|
27
|
+
type_ = self.type_
|
28
28
|
|
29
29
|
field_dict: dict[str, Any] = {}
|
30
30
|
field_dict.update(self.additional_properties)
|
31
31
|
field_dict.update({})
|
32
32
|
if name is not UNSET:
|
33
33
|
field_dict["name"] = name
|
34
|
-
if
|
35
|
-
field_dict["type"] =
|
34
|
+
if type_ is not UNSET:
|
35
|
+
field_dict["type"] = type_
|
36
36
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
41
43
|
d = src_dict.copy()
|
42
44
|
name = d.pop("name", UNSET)
|
43
45
|
|
44
|
-
|
46
|
+
type_ = d.pop("type", UNSET)
|
45
47
|
|
46
48
|
policy_location = cls(
|
47
49
|
name=name,
|
48
|
-
|
50
|
+
type_=type_,
|
49
51
|
)
|
50
52
|
|
51
53
|
policy_location.additional_properties = d
|
@@ -0,0 +1,125 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.flavor import Flavor
|
10
|
+
from ..models.policy_location import PolicyLocation
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="PolicySpec")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class PolicySpec:
|
18
|
+
"""Policy specification
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
|
22
|
+
locations (Union[Unset, List['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
|
23
|
+
resource_types (Union[Unset, List[str]]): PolicyResourceTypes is a local type that wraps a slice of
|
24
|
+
PolicyResourceType
|
25
|
+
type (Union[Unset, str]): Policy type, can be location or flavor
|
26
|
+
"""
|
27
|
+
|
28
|
+
flavors: Union[Unset, List["Flavor"]] = UNSET
|
29
|
+
locations: Union[Unset, List["PolicyLocation"]] = UNSET
|
30
|
+
resource_types: Union[Unset, List[str]] = UNSET
|
31
|
+
type: Union[Unset, str] = UNSET
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
33
|
+
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
35
|
+
flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
|
36
|
+
if not isinstance(self.flavors, Unset):
|
37
|
+
flavors = []
|
38
|
+
for componentsschemas_flavors_item_data in self.flavors:
|
39
|
+
componentsschemas_flavors_item = (
|
40
|
+
componentsschemas_flavors_item_data.to_dict()
|
41
|
+
)
|
42
|
+
flavors.append(componentsschemas_flavors_item)
|
43
|
+
|
44
|
+
locations: Union[Unset, List[Dict[str, Any]]] = UNSET
|
45
|
+
if not isinstance(self.locations, Unset):
|
46
|
+
locations = []
|
47
|
+
for componentsschemas_policy_locations_item_data in self.locations:
|
48
|
+
componentsschemas_policy_locations_item = (
|
49
|
+
componentsschemas_policy_locations_item_data.to_dict()
|
50
|
+
)
|
51
|
+
locations.append(componentsschemas_policy_locations_item)
|
52
|
+
|
53
|
+
resource_types: Union[Unset, List[str]] = UNSET
|
54
|
+
if not isinstance(self.resource_types, Unset):
|
55
|
+
resource_types = self.resource_types
|
56
|
+
|
57
|
+
type = self.type
|
58
|
+
|
59
|
+
field_dict: dict[str, Any] = {}
|
60
|
+
field_dict.update(self.additional_properties)
|
61
|
+
field_dict.update({})
|
62
|
+
if flavors is not UNSET:
|
63
|
+
field_dict["flavors"] = flavors
|
64
|
+
if locations is not UNSET:
|
65
|
+
field_dict["locations"] = locations
|
66
|
+
if resource_types is not UNSET:
|
67
|
+
field_dict["resourceTypes"] = resource_types
|
68
|
+
if type is not UNSET:
|
69
|
+
field_dict["type"] = type
|
70
|
+
|
71
|
+
return field_dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
75
|
+
from ..models.flavor import Flavor
|
76
|
+
from ..models.policy_location import PolicyLocation
|
77
|
+
|
78
|
+
d = src_dict.copy()
|
79
|
+
flavors = []
|
80
|
+
_flavors = d.pop("flavors", UNSET)
|
81
|
+
for componentsschemas_flavors_item_data in _flavors or []:
|
82
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
83
|
+
componentsschemas_flavors_item_data
|
84
|
+
)
|
85
|
+
|
86
|
+
flavors.append(componentsschemas_flavors_item)
|
87
|
+
|
88
|
+
locations = []
|
89
|
+
_locations = d.pop("locations", UNSET)
|
90
|
+
for componentsschemas_policy_locations_item_data in _locations or []:
|
91
|
+
componentsschemas_policy_locations_item = PolicyLocation.from_dict(
|
92
|
+
componentsschemas_policy_locations_item_data
|
93
|
+
)
|
94
|
+
|
95
|
+
locations.append(componentsschemas_policy_locations_item)
|
96
|
+
|
97
|
+
resource_types = cast(List[str], d.pop("resourceTypes", UNSET))
|
98
|
+
|
99
|
+
type = d.pop("type", UNSET)
|
100
|
+
|
101
|
+
policy_spec = cls(
|
102
|
+
flavors=flavors,
|
103
|
+
locations=locations,
|
104
|
+
resource_types=resource_types,
|
105
|
+
type=type,
|
106
|
+
)
|
107
|
+
|
108
|
+
policy_spec.additional_properties = d
|
109
|
+
return policy_spec
|
110
|
+
|
111
|
+
@property
|
112
|
+
def additional_keys(self) -> list[str]:
|
113
|
+
return list(self.additional_properties.keys())
|
114
|
+
|
115
|
+
def __getitem__(self, key: str) -> Any:
|
116
|
+
return self.additional_properties[key]
|
117
|
+
|
118
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
119
|
+
self.additional_properties[key] = value
|
120
|
+
|
121
|
+
def __delitem__(self, key: str) -> None:
|
122
|
+
del self.additional_properties[key]
|
123
|
+
|
124
|
+
def __contains__(self, key: str) -> bool:
|
125
|
+
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, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -17,36 +17,30 @@ class ProviderConfig:
|
|
17
17
|
"""Model provider config
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
access_token (Union[Unset, str]): The access token to use for the provider
|
21
20
|
filename (Union[Unset, str]): The file name to use for the model
|
22
|
-
presigned_url (Union[Unset,
|
21
|
+
presigned_url (Union[Unset, list[Any]]): The presigned URLs to upload the model to
|
23
22
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
24
23
|
"""
|
25
24
|
|
26
|
-
access_token: Union[Unset, str] = UNSET
|
27
25
|
filename: Union[Unset, str] = UNSET
|
28
|
-
presigned_url: Union[Unset,
|
26
|
+
presigned_url: Union[Unset, list[Any]] = UNSET
|
29
27
|
runtime: Union[Unset, "Runtime"] = UNSET
|
30
28
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
31
29
|
|
32
30
|
def to_dict(self) -> dict[str, Any]:
|
33
|
-
access_token = self.access_token
|
34
|
-
|
35
31
|
filename = self.filename
|
36
32
|
|
37
|
-
presigned_url: Union[Unset,
|
33
|
+
presigned_url: Union[Unset, list[Any]] = UNSET
|
38
34
|
if not isinstance(self.presigned_url, Unset):
|
39
35
|
presigned_url = self.presigned_url
|
40
36
|
|
41
|
-
runtime: Union[Unset,
|
37
|
+
runtime: Union[Unset, dict[str, Any]] = UNSET
|
42
38
|
if not isinstance(self.runtime, Unset):
|
43
39
|
runtime = self.runtime.to_dict()
|
44
40
|
|
45
41
|
field_dict: dict[str, Any] = {}
|
46
42
|
field_dict.update(self.additional_properties)
|
47
43
|
field_dict.update({})
|
48
|
-
if access_token is not UNSET:
|
49
|
-
field_dict["access_token"] = access_token
|
50
44
|
if filename is not UNSET:
|
51
45
|
field_dict["filename"] = filename
|
52
46
|
if presigned_url is not UNSET:
|
@@ -57,15 +51,15 @@ class ProviderConfig:
|
|
57
51
|
return field_dict
|
58
52
|
|
59
53
|
@classmethod
|
60
|
-
def from_dict(cls:
|
54
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
61
55
|
from ..models.runtime import Runtime
|
62
56
|
|
57
|
+
if not src_dict:
|
58
|
+
return None
|
63
59
|
d = src_dict.copy()
|
64
|
-
access_token = d.pop("access_token", UNSET)
|
65
|
-
|
66
60
|
filename = d.pop("filename", UNSET)
|
67
61
|
|
68
|
-
presigned_url = cast(
|
62
|
+
presigned_url = cast(list[Any], d.pop("presigned_url", UNSET))
|
69
63
|
|
70
64
|
_runtime = d.pop("runtime", UNSET)
|
71
65
|
runtime: Union[Unset, Runtime]
|
@@ -75,7 +69,6 @@ class ProviderConfig:
|
|
75
69
|
runtime = Runtime.from_dict(_runtime)
|
76
70
|
|
77
71
|
provider_config = cls(
|
78
|
-
access_token=access_token,
|
79
72
|
filename=filename,
|
80
73
|
presigned_url=presigned_url,
|
81
74
|
runtime=runtime,
|
beamlit/models/qps.py
CHANGED
@@ -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
|
@@ -31,7 +31,9 @@ class QPS:
|
|
31
31
|
return field_dict
|
32
32
|
|
33
33
|
@classmethod
|
34
|
-
def from_dict(cls:
|
34
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
35
|
+
if not src_dict:
|
36
|
+
return None
|
35
37
|
d = src_dict.copy()
|
36
38
|
region_code = d.pop("region_code", UNSET)
|
37
39
|
|
@@ -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
|
@@ -37,7 +37,9 @@ class ResourceDeploymentLog:
|
|
37
37
|
return field_dict
|
38
38
|
|
39
39
|
@classmethod
|
40
|
-
def from_dict(cls:
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
41
43
|
d = src_dict.copy()
|
42
44
|
message = d.pop("message", UNSET)
|
43
45
|
|
@@ -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
|
@@ -8,9 +8,13 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.metric import Metric
|
10
10
|
from ..models.qps import QPS
|
11
|
+
from ..models.resource_deployment_metrics_inference_per_region import ResourceDeploymentMetricsInferencePerRegion
|
11
12
|
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
12
13
|
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
13
14
|
)
|
15
|
+
from ..models.resource_deployment_metrics_query_per_region_per_code import (
|
16
|
+
ResourceDeploymentMetricsQueryPerRegionPerCode,
|
17
|
+
)
|
14
18
|
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
15
19
|
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
16
20
|
)
|
@@ -24,9 +28,19 @@ class ResourceDeploymentMetrics:
|
|
24
28
|
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
25
29
|
|
26
30
|
Attributes:
|
27
|
-
|
31
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
32
|
+
inference_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerRegion]): Historical requests (in last
|
33
|
+
24 hours) per location, for the model deployment
|
34
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
28
35
|
inference_per_second_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]): Historical
|
29
36
|
requests per second (RPS) per location, for the model deployment
|
37
|
+
query_global (Union[Unset, float]): Number of requests done on the resource for the model deployment
|
38
|
+
query_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g.
|
39
|
+
200, 400) or per location
|
40
|
+
query_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200,
|
41
|
+
400) or per location
|
42
|
+
query_per_region_per_code (Union[Unset, ResourceDeploymentMetricsQueryPerRegionPerCode]): Number of requests
|
43
|
+
done on the resource for the model deployment
|
30
44
|
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
31
45
|
query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
|
32
46
|
code (e.g. 200, 400) or per location
|
@@ -36,8 +50,14 @@ class ResourceDeploymentMetrics:
|
|
36
50
|
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
37
51
|
"""
|
38
52
|
|
39
|
-
|
53
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
54
|
+
inference_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerRegion"] = UNSET
|
55
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
40
56
|
inference_per_second_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
|
57
|
+
query_global: Union[Unset, float] = UNSET
|
58
|
+
query_per_code_global: Union[Unset, "QPS"] = UNSET
|
59
|
+
query_per_region: Union[Unset, "QPS"] = UNSET
|
60
|
+
query_per_region_per_code: Union[Unset, "ResourceDeploymentMetricsQueryPerRegionPerCode"] = UNSET
|
41
61
|
query_per_second_global: Union[Unset, float] = UNSET
|
42
62
|
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
43
63
|
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
@@ -47,38 +67,75 @@ class ResourceDeploymentMetrics:
|
|
47
67
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
48
68
|
|
49
69
|
def to_dict(self) -> dict[str, Any]:
|
50
|
-
|
70
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
71
|
+
if not isinstance(self.inference_global, Unset):
|
72
|
+
inference_global = []
|
73
|
+
for componentsschemas_array_metric_item_data in self.inference_global:
|
74
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
75
|
+
inference_global.append(componentsschemas_array_metric_item)
|
76
|
+
|
77
|
+
inference_per_region: Union[Unset, dict[str, Any]] = UNSET
|
78
|
+
if not isinstance(self.inference_per_region, Unset):
|
79
|
+
inference_per_region = self.inference_per_region.to_dict()
|
80
|
+
|
81
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
51
82
|
if not isinstance(self.inference_per_second_global, Unset):
|
52
83
|
inference_per_second_global = []
|
53
84
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
54
85
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
55
86
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
56
87
|
|
57
|
-
inference_per_second_per_region: Union[Unset,
|
88
|
+
inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
58
89
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
59
90
|
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
60
91
|
|
92
|
+
query_global = self.query_global
|
93
|
+
|
94
|
+
query_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
95
|
+
if not isinstance(self.query_per_code_global, Unset):
|
96
|
+
query_per_code_global = self.query_per_code_global.to_dict()
|
97
|
+
|
98
|
+
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
99
|
+
if not isinstance(self.query_per_region, Unset):
|
100
|
+
query_per_region = self.query_per_region.to_dict()
|
101
|
+
|
102
|
+
query_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
103
|
+
if not isinstance(self.query_per_region_per_code, Unset):
|
104
|
+
query_per_region_per_code = self.query_per_region_per_code.to_dict()
|
105
|
+
|
61
106
|
query_per_second_global = self.query_per_second_global
|
62
107
|
|
63
|
-
query_per_second_per_code_global: Union[Unset,
|
108
|
+
query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
64
109
|
if not isinstance(self.query_per_second_per_code_global, Unset):
|
65
110
|
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
66
111
|
|
67
|
-
query_per_second_per_region: Union[Unset,
|
112
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
68
113
|
if not isinstance(self.query_per_second_per_region, Unset):
|
69
114
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
70
115
|
|
71
|
-
query_per_second_per_region_per_code: Union[Unset,
|
116
|
+
query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
72
117
|
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
73
118
|
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
74
119
|
|
75
120
|
field_dict: dict[str, Any] = {}
|
76
121
|
field_dict.update(self.additional_properties)
|
77
122
|
field_dict.update({})
|
123
|
+
if inference_global is not UNSET:
|
124
|
+
field_dict["inference_global"] = inference_global
|
125
|
+
if inference_per_region is not UNSET:
|
126
|
+
field_dict["inference_per_region"] = inference_per_region
|
78
127
|
if inference_per_second_global is not UNSET:
|
79
128
|
field_dict["inference_per_second_global"] = inference_per_second_global
|
80
129
|
if inference_per_second_per_region is not UNSET:
|
81
130
|
field_dict["inference_per_second_per_region"] = inference_per_second_per_region
|
131
|
+
if query_global is not UNSET:
|
132
|
+
field_dict["query_global"] = query_global
|
133
|
+
if query_per_code_global is not UNSET:
|
134
|
+
field_dict["query_per_code_global"] = query_per_code_global
|
135
|
+
if query_per_region is not UNSET:
|
136
|
+
field_dict["query_per_region"] = query_per_region
|
137
|
+
if query_per_region_per_code is not UNSET:
|
138
|
+
field_dict["query_per_region_per_code"] = query_per_region_per_code
|
82
139
|
if query_per_second_global is not UNSET:
|
83
140
|
field_dict["query_per_second_global"] = query_per_second_global
|
84
141
|
if query_per_second_per_code_global is not UNSET:
|
@@ -91,17 +148,39 @@ class ResourceDeploymentMetrics:
|
|
91
148
|
return field_dict
|
92
149
|
|
93
150
|
@classmethod
|
94
|
-
def from_dict(cls:
|
151
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
95
152
|
from ..models.metric import Metric
|
96
153
|
from ..models.qps import QPS
|
154
|
+
from ..models.resource_deployment_metrics_inference_per_region import (
|
155
|
+
ResourceDeploymentMetricsInferencePerRegion,
|
156
|
+
)
|
97
157
|
from ..models.resource_deployment_metrics_inference_per_second_per_region import (
|
98
158
|
ResourceDeploymentMetricsInferencePerSecondPerRegion,
|
99
159
|
)
|
160
|
+
from ..models.resource_deployment_metrics_query_per_region_per_code import (
|
161
|
+
ResourceDeploymentMetricsQueryPerRegionPerCode,
|
162
|
+
)
|
100
163
|
from ..models.resource_deployment_metrics_query_per_second_per_region_per_code import (
|
101
164
|
ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
|
102
165
|
)
|
103
166
|
|
167
|
+
if not src_dict:
|
168
|
+
return None
|
104
169
|
d = src_dict.copy()
|
170
|
+
inference_global = []
|
171
|
+
_inference_global = d.pop("inference_global", UNSET)
|
172
|
+
for componentsschemas_array_metric_item_data in _inference_global or []:
|
173
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
174
|
+
|
175
|
+
inference_global.append(componentsschemas_array_metric_item)
|
176
|
+
|
177
|
+
_inference_per_region = d.pop("inference_per_region", UNSET)
|
178
|
+
inference_per_region: Union[Unset, ResourceDeploymentMetricsInferencePerRegion]
|
179
|
+
if isinstance(_inference_per_region, Unset):
|
180
|
+
inference_per_region = UNSET
|
181
|
+
else:
|
182
|
+
inference_per_region = ResourceDeploymentMetricsInferencePerRegion.from_dict(_inference_per_region)
|
183
|
+
|
105
184
|
inference_per_second_global = []
|
106
185
|
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
107
186
|
for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
|
@@ -118,6 +197,31 @@ class ResourceDeploymentMetrics:
|
|
118
197
|
_inference_per_second_per_region
|
119
198
|
)
|
120
199
|
|
200
|
+
query_global = d.pop("query_global", UNSET)
|
201
|
+
|
202
|
+
_query_per_code_global = d.pop("query_per_code_global", UNSET)
|
203
|
+
query_per_code_global: Union[Unset, QPS]
|
204
|
+
if isinstance(_query_per_code_global, Unset):
|
205
|
+
query_per_code_global = UNSET
|
206
|
+
else:
|
207
|
+
query_per_code_global = QPS.from_dict(_query_per_code_global)
|
208
|
+
|
209
|
+
_query_per_region = d.pop("query_per_region", UNSET)
|
210
|
+
query_per_region: Union[Unset, QPS]
|
211
|
+
if isinstance(_query_per_region, Unset):
|
212
|
+
query_per_region = UNSET
|
213
|
+
else:
|
214
|
+
query_per_region = QPS.from_dict(_query_per_region)
|
215
|
+
|
216
|
+
_query_per_region_per_code = d.pop("query_per_region_per_code", UNSET)
|
217
|
+
query_per_region_per_code: Union[Unset, ResourceDeploymentMetricsQueryPerRegionPerCode]
|
218
|
+
if isinstance(_query_per_region_per_code, Unset):
|
219
|
+
query_per_region_per_code = UNSET
|
220
|
+
else:
|
221
|
+
query_per_region_per_code = ResourceDeploymentMetricsQueryPerRegionPerCode.from_dict(
|
222
|
+
_query_per_region_per_code
|
223
|
+
)
|
224
|
+
|
121
225
|
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
122
226
|
|
123
227
|
_query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
|
@@ -144,8 +248,14 @@ class ResourceDeploymentMetrics:
|
|
144
248
|
)
|
145
249
|
|
146
250
|
resource_deployment_metrics = cls(
|
251
|
+
inference_global=inference_global,
|
252
|
+
inference_per_region=inference_per_region,
|
147
253
|
inference_per_second_global=inference_per_second_global,
|
148
254
|
inference_per_second_per_region=inference_per_second_per_region,
|
255
|
+
query_global=query_global,
|
256
|
+
query_per_code_global=query_per_code_global,
|
257
|
+
query_per_region=query_per_region,
|
258
|
+
query_per_region_per_code=query_per_region_per_code,
|
149
259
|
query_per_second_global=query_per_second_global,
|
150
260
|
query_per_second_per_code_global=query_per_second_per_code_global,
|
151
261
|
query_per_second_per_region=query_per_second_per_region,
|
@@ -0,0 +1,77 @@
|
|
1
|
+
from typing import TYPE_CHECKING, 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
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.metric import Metric
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceDeploymentMetricsInferencePerRegion")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsInferencePerRegion:
|
17
|
+
"""Historical requests (in last 24 hours) per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, list['Metric']]): Array of metrics
|
21
|
+
"""
|
22
|
+
|
23
|
+
region: Union[Unset, list["Metric"]] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
region: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
|
+
if not isinstance(self.region, Unset):
|
29
|
+
region = []
|
30
|
+
for componentsschemas_array_metric_item_data in self.region:
|
31
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
32
|
+
region.append(componentsschemas_array_metric_item)
|
33
|
+
|
34
|
+
field_dict: dict[str, Any] = {}
|
35
|
+
field_dict.update(self.additional_properties)
|
36
|
+
field_dict.update({})
|
37
|
+
if region is not UNSET:
|
38
|
+
field_dict["region"] = region
|
39
|
+
|
40
|
+
return field_dict
|
41
|
+
|
42
|
+
@classmethod
|
43
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
44
|
+
from ..models.metric import Metric
|
45
|
+
|
46
|
+
if not src_dict:
|
47
|
+
return None
|
48
|
+
d = src_dict.copy()
|
49
|
+
region = []
|
50
|
+
_region = d.pop("region", UNSET)
|
51
|
+
for componentsschemas_array_metric_item_data in _region or []:
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
53
|
+
|
54
|
+
region.append(componentsschemas_array_metric_item)
|
55
|
+
|
56
|
+
resource_deployment_metrics_inference_per_region = cls(
|
57
|
+
region=region,
|
58
|
+
)
|
59
|
+
|
60
|
+
resource_deployment_metrics_inference_per_region.additional_properties = d
|
61
|
+
return resource_deployment_metrics_inference_per_region
|
62
|
+
|
63
|
+
@property
|
64
|
+
def additional_keys(self) -> list[str]:
|
65
|
+
return list(self.additional_properties.keys())
|
66
|
+
|
67
|
+
def __getitem__(self, key: str) -> Any:
|
68
|
+
return self.additional_properties[key]
|
69
|
+
|
70
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
71
|
+
self.additional_properties[key] = value
|
72
|
+
|
73
|
+
def __delitem__(self, key: str) -> None:
|
74
|
+
del self.additional_properties[key]
|
75
|
+
|
76
|
+
def __contains__(self, key: str) -> bool:
|
77
|
+
return key in self.additional_properties
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.metric import Metric
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceDeploymentMetricsInferencePerRegionType0")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsInferencePerRegionType0:
|
17
|
+
"""Historical requests (in last 24 hours) per location, for the model deployment
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
region (Union[Unset, List['Metric']]): Array of metrics
|
21
|
+
"""
|
22
|
+
|
23
|
+
region: Union[Unset, List["Metric"]] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
region: Union[Unset, List[Dict[str, Any]]] = UNSET
|
28
|
+
if not isinstance(self.region, Unset):
|
29
|
+
region = []
|
30
|
+
for componentsschemas_array_metric_item_data in self.region:
|
31
|
+
componentsschemas_array_metric_item = (
|
32
|
+
componentsschemas_array_metric_item_data.to_dict()
|
33
|
+
)
|
34
|
+
region.append(componentsschemas_array_metric_item)
|
35
|
+
|
36
|
+
field_dict: dict[str, Any] = {}
|
37
|
+
field_dict.update(self.additional_properties)
|
38
|
+
field_dict.update({})
|
39
|
+
if region is not UNSET:
|
40
|
+
field_dict["region"] = region
|
41
|
+
|
42
|
+
return field_dict
|
43
|
+
|
44
|
+
@classmethod
|
45
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
46
|
+
from ..models.metric import Metric
|
47
|
+
|
48
|
+
d = src_dict.copy()
|
49
|
+
region = []
|
50
|
+
_region = d.pop("region", UNSET)
|
51
|
+
for componentsschemas_array_metric_item_data in _region or []:
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(
|
53
|
+
componentsschemas_array_metric_item_data
|
54
|
+
)
|
55
|
+
|
56
|
+
region.append(componentsschemas_array_metric_item)
|
57
|
+
|
58
|
+
resource_deployment_metrics_inference_per_region_type_0 = cls(
|
59
|
+
region=region,
|
60
|
+
)
|
61
|
+
|
62
|
+
resource_deployment_metrics_inference_per_region_type_0.additional_properties = d
|
63
|
+
return resource_deployment_metrics_inference_per_region_type_0
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|