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 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,9 +40,11 @@ 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
|
+
if not src_dict:
|
47
|
+
return None
|
46
48
|
d = src_dict.copy()
|
47
49
|
region = []
|
48
50
|
_region = d.pop("region", UNSET)
|
@@ -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="ResourceDeploymentMetricsInferencePerSecondPerRegionType0")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsInferencePerSecondPerRegionType0:
|
17
|
+
"""Historical requests per second (RPS) 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_second_per_region_type_0 = cls(
|
59
|
+
region=region,
|
60
|
+
)
|
61
|
+
|
62
|
+
resource_deployment_metrics_inference_per_second_per_region_type_0.additional_properties = d
|
63
|
+
return resource_deployment_metrics_inference_per_second_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
|
@@ -0,0 +1,75 @@
|
|
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.qps import QPS
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="ResourceDeploymentMetricsQueryPerRegionPerCode")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsQueryPerRegionPerCode:
|
17
|
+
"""Number of requests done on the resource 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
|
+
if not src_dict:
|
45
|
+
return None
|
46
|
+
d = src_dict.copy()
|
47
|
+
_region = d.pop("region", UNSET)
|
48
|
+
region: Union[Unset, QPS]
|
49
|
+
if isinstance(_region, Unset):
|
50
|
+
region = UNSET
|
51
|
+
else:
|
52
|
+
region = QPS.from_dict(_region)
|
53
|
+
|
54
|
+
resource_deployment_metrics_query_per_region_per_code = cls(
|
55
|
+
region=region,
|
56
|
+
)
|
57
|
+
|
58
|
+
resource_deployment_metrics_query_per_region_per_code.additional_properties = d
|
59
|
+
return resource_deployment_metrics_query_per_region_per_code
|
60
|
+
|
61
|
+
@property
|
62
|
+
def additional_keys(self) -> list[str]:
|
63
|
+
return list(self.additional_properties.keys())
|
64
|
+
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
66
|
+
return self.additional_properties[key]
|
67
|
+
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
69
|
+
self.additional_properties[key] = value
|
70
|
+
|
71
|
+
def __delitem__(self, key: str) -> None:
|
72
|
+
del self.additional_properties[key]
|
73
|
+
|
74
|
+
def __contains__(self, key: str) -> bool:
|
75
|
+
return key in self.additional_properties
|
@@ -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="ResourceDeploymentMetricsQueryPerRegionPerCodeType0")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsQueryPerRegionPerCodeType0:
|
17
|
+
"""Number of requests done on the resource 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_deployment_metrics_query_per_region_per_code_type_0 = cls(
|
53
|
+
region=region,
|
54
|
+
)
|
55
|
+
|
56
|
+
resource_deployment_metrics_query_per_region_per_code_type_0.additional_properties = d
|
57
|
+
return resource_deployment_metrics_query_per_region_per_code_type_0
|
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
|
@@ -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,9 +38,11 @@ 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
|
+
if not src_dict:
|
45
|
+
return None
|
44
46
|
d = src_dict.copy()
|
45
47
|
_region = d.pop("region", UNSET)
|
46
48
|
region: Union[Unset, QPS]
|
@@ -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="ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCodeType0:
|
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_deployment_metrics_query_per_second_per_region_per_code_type_0 = cls(
|
53
|
+
region=region,
|
54
|
+
)
|
55
|
+
|
56
|
+
resource_deployment_metrics_query_per_second_per_region_per_code_type_0.additional_properties = d
|
57
|
+
return resource_deployment_metrics_query_per_second_per_region_per_code_type_0
|
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,210 @@
|
|
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
|
+
from ..models.qps import QPS
|
11
|
+
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
12
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
13
|
+
)
|
14
|
+
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
15
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
T = TypeVar("T", bound="ResourceEnvironmentMetrics")
|
20
|
+
|
21
|
+
|
22
|
+
@_attrs_define
|
23
|
+
class ResourceEnvironmentMetrics:
|
24
|
+
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
25
|
+
|
26
|
+
Attributes:
|
27
|
+
inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
|
28
|
+
inference_per_second_per_region (Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]):
|
29
|
+
Historical requests per second (RPS) per location, for the model deployment
|
30
|
+
query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
|
31
|
+
query_per_second_per_code_global (Union[Unset, QPS]): Query per second per element, can be per response status
|
32
|
+
code (e.g. 200, 400) or per location
|
33
|
+
query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
|
34
|
+
(e.g. 200, 400) or per location
|
35
|
+
query_per_second_per_region_per_code (Union[Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode]):
|
36
|
+
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
37
|
+
"""
|
38
|
+
|
39
|
+
inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
|
40
|
+
inference_per_second_per_region: Union[
|
41
|
+
Unset, "ResourceEnvironmentMetricsInferencePerSecondPerRegion"
|
42
|
+
] = UNSET
|
43
|
+
query_per_second_global: Union[Unset, float] = UNSET
|
44
|
+
query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
|
45
|
+
query_per_second_per_region: Union[Unset, "QPS"] = UNSET
|
46
|
+
query_per_second_per_region_per_code: Union[
|
47
|
+
Unset, "ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode"
|
48
|
+
] = UNSET
|
49
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
50
|
+
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
52
|
+
inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
|
53
|
+
if not isinstance(self.inference_per_second_global, Unset):
|
54
|
+
inference_per_second_global = []
|
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
|
+
)
|
61
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
62
|
+
|
63
|
+
inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
64
|
+
if not isinstance(self.inference_per_second_per_region, Unset):
|
65
|
+
inference_per_second_per_region = (
|
66
|
+
self.inference_per_second_per_region.to_dict()
|
67
|
+
)
|
68
|
+
|
69
|
+
query_per_second_global = self.query_per_second_global
|
70
|
+
|
71
|
+
query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
|
72
|
+
if not isinstance(self.query_per_second_per_code_global, Unset):
|
73
|
+
query_per_second_per_code_global = (
|
74
|
+
self.query_per_second_per_code_global.to_dict()
|
75
|
+
)
|
76
|
+
|
77
|
+
query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
|
78
|
+
if not isinstance(self.query_per_second_per_region, Unset):
|
79
|
+
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
80
|
+
|
81
|
+
query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
|
82
|
+
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
83
|
+
query_per_second_per_region_per_code = (
|
84
|
+
self.query_per_second_per_region_per_code.to_dict()
|
85
|
+
)
|
86
|
+
|
87
|
+
field_dict: dict[str, Any] = {}
|
88
|
+
field_dict.update(self.additional_properties)
|
89
|
+
field_dict.update({})
|
90
|
+
if inference_per_second_global is not UNSET:
|
91
|
+
field_dict["inference_per_second_global"] = inference_per_second_global
|
92
|
+
if inference_per_second_per_region is not UNSET:
|
93
|
+
field_dict["inference_per_second_per_region"] = (
|
94
|
+
inference_per_second_per_region
|
95
|
+
)
|
96
|
+
if query_per_second_global is not UNSET:
|
97
|
+
field_dict["query_per_second_global"] = query_per_second_global
|
98
|
+
if query_per_second_per_code_global is not UNSET:
|
99
|
+
field_dict["query_per_second_per_code_global"] = (
|
100
|
+
query_per_second_per_code_global
|
101
|
+
)
|
102
|
+
if query_per_second_per_region is not UNSET:
|
103
|
+
field_dict["query_per_second_per_region"] = query_per_second_per_region
|
104
|
+
if query_per_second_per_region_per_code is not UNSET:
|
105
|
+
field_dict["query_per_second_per_region_per_code"] = (
|
106
|
+
query_per_second_per_region_per_code
|
107
|
+
)
|
108
|
+
|
109
|
+
return field_dict
|
110
|
+
|
111
|
+
@classmethod
|
112
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
113
|
+
from ..models.metric import Metric
|
114
|
+
from ..models.qps import QPS
|
115
|
+
from ..models.resource_environment_metrics_inference_per_second_per_region import (
|
116
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion,
|
117
|
+
)
|
118
|
+
from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
|
119
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
|
120
|
+
)
|
121
|
+
|
122
|
+
d = src_dict.copy()
|
123
|
+
inference_per_second_global = []
|
124
|
+
_inference_per_second_global = d.pop("inference_per_second_global", UNSET)
|
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
|
+
)
|
131
|
+
|
132
|
+
inference_per_second_global.append(componentsschemas_array_metric_item)
|
133
|
+
|
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
|
+
]
|
140
|
+
if isinstance(_inference_per_second_per_region, Unset):
|
141
|
+
inference_per_second_per_region = UNSET
|
142
|
+
else:
|
143
|
+
inference_per_second_per_region = (
|
144
|
+
ResourceEnvironmentMetricsInferencePerSecondPerRegion.from_dict(
|
145
|
+
_inference_per_second_per_region
|
146
|
+
)
|
147
|
+
)
|
148
|
+
|
149
|
+
query_per_second_global = d.pop("query_per_second_global", UNSET)
|
150
|
+
|
151
|
+
_query_per_second_per_code_global = d.pop(
|
152
|
+
"query_per_second_per_code_global", UNSET
|
153
|
+
)
|
154
|
+
query_per_second_per_code_global: Union[Unset, QPS]
|
155
|
+
if isinstance(_query_per_second_per_code_global, Unset):
|
156
|
+
query_per_second_per_code_global = UNSET
|
157
|
+
else:
|
158
|
+
query_per_second_per_code_global = QPS.from_dict(
|
159
|
+
_query_per_second_per_code_global
|
160
|
+
)
|
161
|
+
|
162
|
+
_query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
|
163
|
+
query_per_second_per_region: Union[Unset, QPS]
|
164
|
+
if isinstance(_query_per_second_per_region, Unset):
|
165
|
+
query_per_second_per_region = UNSET
|
166
|
+
else:
|
167
|
+
query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
|
168
|
+
|
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
|
+
]
|
175
|
+
if isinstance(_query_per_second_per_region_per_code, Unset):
|
176
|
+
query_per_second_per_region_per_code = UNSET
|
177
|
+
else:
|
178
|
+
query_per_second_per_region_per_code = (
|
179
|
+
ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode.from_dict(
|
180
|
+
_query_per_second_per_region_per_code
|
181
|
+
)
|
182
|
+
)
|
183
|
+
|
184
|
+
resource_environment_metrics = cls(
|
185
|
+
inference_per_second_global=inference_per_second_global,
|
186
|
+
inference_per_second_per_region=inference_per_second_per_region,
|
187
|
+
query_per_second_global=query_per_second_global,
|
188
|
+
query_per_second_per_code_global=query_per_second_per_code_global,
|
189
|
+
query_per_second_per_region=query_per_second_per_region,
|
190
|
+
query_per_second_per_region_per_code=query_per_second_per_region_per_code,
|
191
|
+
)
|
192
|
+
|
193
|
+
resource_environment_metrics.additional_properties = d
|
194
|
+
return resource_environment_metrics
|
195
|
+
|
196
|
+
@property
|
197
|
+
def additional_keys(self) -> list[str]:
|
198
|
+
return list(self.additional_properties.keys())
|
199
|
+
|
200
|
+
def __getitem__(self, key: str) -> Any:
|
201
|
+
return self.additional_properties[key]
|
202
|
+
|
203
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
204
|
+
self.additional_properties[key] = value
|
205
|
+
|
206
|
+
def __delitem__(self, key: str) -> None:
|
207
|
+
del self.additional_properties[key]
|
208
|
+
|
209
|
+
def __contains__(self, key: str) -> bool:
|
210
|
+
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="ResourceEnvironmentMetricsInferencePerSecondPerRegion")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class ResourceEnvironmentMetricsInferencePerSecondPerRegion:
|
17
|
+
"""Historical requests per second (RPS) 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_environment_metrics_inference_per_second_per_region = cls(
|
59
|
+
region=region,
|
60
|
+
)
|
61
|
+
|
62
|
+
resource_environment_metrics_inference_per_second_per_region.additional_properties = d
|
63
|
+
return resource_environment_metrics_inference_per_second_per_region
|
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
|