beamlit 0.0.20rc5__py3-none-any.whl → 0.0.20rc7__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/agents/__init__.py +4 -0
- beamlit/agents/chat.py +87 -0
- beamlit/agents/decorator.py +147 -0
- beamlit/api/agents/delete_agent_history.py +6 -2
- beamlit/api/agents/get_agent_deployment_logs.py +11 -11
- beamlit/api/agents/get_agent_history.py +6 -2
- beamlit/api/agents/list_agent_deployment_history.py +11 -11
- beamlit/api/agents/list_agent_deployments.py +11 -11
- beamlit/api/agents/list_agents.py +11 -11
- beamlit/api/agents/put_agent_history.py +6 -2
- beamlit/api/environments/list_environments.py +11 -11
- beamlit/api/functions/get_function_deployment_logs.py +11 -11
- beamlit/api/functions/list_function_deployments.py +11 -11
- beamlit/api/functions/list_functions.py +11 -11
- beamlit/api/history/get_agents_history.py +11 -11
- beamlit/api/history/list_agents_history.py +11 -11
- beamlit/api/integrations/list_integration_connections.py +11 -11
- beamlit/api/invitations/list_all_pending_invitations.py +11 -11
- beamlit/api/locations/list_locations.py +11 -11
- beamlit/api/model_providers/list_model_providers.py +11 -11
- beamlit/api/models/get_model_deployment_logs.py +11 -11
- beamlit/api/models/list_model_deployments.py +11 -11
- beamlit/api/models/list_models.py +11 -11
- beamlit/api/policies/list_policies.py +11 -11
- beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
- beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
- beamlit/api/store/list_store_agents.py +11 -11
- beamlit/api/store/list_store_functions.py +11 -11
- beamlit/api/workspaces/list_workspace_users.py +11 -11
- beamlit/api/workspaces/list_workspaces.py +11 -11
- beamlit/authentication/__init__.py +26 -10
- beamlit/authentication/apikey.py +4 -4
- beamlit/authentication/authentication.py +36 -5
- beamlit/authentication/clientcredentials.py +18 -20
- beamlit/authentication/credentials.py +18 -11
- beamlit/authentication/device_mode.py +15 -12
- beamlit/common/__init__.py +13 -0
- beamlit/common/generate.py +31 -19
- beamlit/common/logger.py +9 -12
- beamlit/common/secrets.py +11 -0
- beamlit/common/settings.py +78 -30
- beamlit/common/utils.py +4 -2
- beamlit/functions/__init__.py +5 -0
- beamlit/functions/decorator.py +90 -0
- beamlit/models/acl.py +2 -2
- beamlit/models/agent.py +3 -3
- beamlit/models/agent_chain.py +2 -2
- beamlit/models/agent_configuration.py +2 -2
- beamlit/models/agent_deployment.py +25 -25
- beamlit/models/agent_deployment_configuration.py +2 -2
- beamlit/models/agent_deployment_history.py +5 -5
- beamlit/models/agent_deployment_history_event.py +9 -9
- beamlit/models/agent_deployment_pod_template.py +2 -2
- beamlit/models/agent_release.py +2 -2
- beamlit/models/agent_spec.py +15 -5
- beamlit/models/agent_with_deployments.py +6 -6
- beamlit/models/api_key.py +2 -2
- beamlit/models/authentication_provider_model.py +6 -6
- beamlit/models/authentication_provider_organization.py +2 -2
- beamlit/models/configuration.py +10 -10
- beamlit/models/continent.py +2 -2
- beamlit/models/core_spec.py +9 -3
- beamlit/models/country.py +2 -2
- beamlit/models/create_api_key_for_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_body.py +2 -2
- beamlit/models/create_workspace_service_account_response_200.py +2 -2
- beamlit/models/delete_workspace_service_account_response_200.py +2 -2
- beamlit/models/deployment_configuration.py +2 -2
- beamlit/models/deployment_configurations.py +2 -2
- beamlit/models/deployment_serverless_config.py +2 -2
- beamlit/models/deployment_serverless_config_type_0.py +3 -1
- beamlit/models/environment.py +7 -7
- beamlit/models/environment_metrics.py +8 -8
- beamlit/models/flavor.py +9 -9
- beamlit/models/function.py +3 -3
- beamlit/models/function_configuration.py +2 -2
- beamlit/models/function_deployment.py +24 -24
- beamlit/models/function_deployment_configuration.py +2 -2
- beamlit/models/function_deployment_pod_template.py +2 -2
- beamlit/models/function_kit.py +5 -5
- beamlit/models/function_provider_ref.py +2 -2
- beamlit/models/function_release.py +2 -2
- beamlit/models/function_spec.py +9 -3
- beamlit/models/function_with_deployments.py +6 -6
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
- beamlit/models/increase_and_rate_metric.py +5 -5
- beamlit/models/integration.py +12 -12
- beamlit/models/integration_config.py +2 -2
- beamlit/models/integration_connection.py +5 -5
- beamlit/models/integration_connection_config.py +2 -2
- beamlit/models/integration_connection_secret.py +2 -2
- beamlit/models/integration_model.py +6 -6
- beamlit/models/integration_secret.py +2 -2
- beamlit/models/invite_workspace_user_body.py +2 -2
- beamlit/models/labels_type_0.py +2 -2
- beamlit/models/location.py +5 -5
- beamlit/models/location_response.py +5 -5
- beamlit/models/metric.py +2 -2
- beamlit/models/metrics.py +8 -8
- beamlit/models/model.py +3 -3
- beamlit/models/model_deployment.py +18 -18
- beamlit/models/model_deployment_log.py +2 -2
- beamlit/models/model_deployment_metrics.py +9 -9
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/model_deployment_pod_template.py +2 -2
- beamlit/models/model_metrics.py +6 -6
- beamlit/models/model_provider.py +11 -11
- beamlit/models/model_provider_ref.py +2 -2
- beamlit/models/model_release.py +2 -2
- beamlit/models/model_spec.py +9 -3
- beamlit/models/model_with_deployments.py +6 -6
- beamlit/models/pending_invitation.py +2 -2
- beamlit/models/pending_invitation_accept.py +3 -3
- beamlit/models/pending_invitation_render.py +5 -5
- beamlit/models/pending_invitation_render_invited_by.py +2 -2
- beamlit/models/pending_invitation_render_workspace.py +2 -2
- beamlit/models/pending_invitation_workspace_details.py +6 -6
- beamlit/models/policy.py +20 -20
- beamlit/models/policy_location.py +9 -9
- beamlit/models/policy_spec.py +9 -3
- beamlit/models/provider_config.py +7 -7
- beamlit/models/qps.py +2 -2
- beamlit/models/resource_deployment_log.py +2 -2
- beamlit/models/resource_deployment_metrics.py +16 -16
- beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
- beamlit/models/resource_environment_metrics.py +62 -24
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
- beamlit/models/resource_metrics.py +10 -10
- beamlit/models/runtime.py +23 -23
- beamlit/models/runtime_readiness_probe.py +2 -2
- beamlit/models/runtime_resources.py +2 -2
- beamlit/models/serverless_config.py +2 -2
- beamlit/models/standard_fields_dynamo_db.py +2 -2
- beamlit/models/store_agent.py +6 -6
- beamlit/models/store_agent_configuration.py +2 -2
- beamlit/models/store_agent_labels.py +2 -2
- beamlit/models/store_configuration.py +16 -16
- beamlit/models/store_configuration_option.py +2 -2
- beamlit/models/store_function.py +12 -12
- beamlit/models/store_function_configuration.py +2 -2
- beamlit/models/store_function_kit.py +5 -5
- beamlit/models/store_function_labels.py +2 -2
- beamlit/models/store_function_parameter.py +9 -9
- beamlit/models/update_workspace_service_account_body.py +2 -2
- beamlit/models/update_workspace_service_account_response_200.py +2 -2
- beamlit/models/update_workspace_user_role_body.py +2 -2
- beamlit/models/workspace.py +3 -3
- beamlit/models/workspace_labels.py +2 -2
- beamlit/models/workspace_user.py +2 -2
- beamlit/run.py +6 -6
- beamlit/serve/app.py +73 -0
- beamlit/serve/middlewares/__init__.py +4 -0
- beamlit/serve/middlewares/accesslog.py +14 -0
- beamlit/serve/middlewares/processtime.py +12 -0
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/METADATA +7 -1
- beamlit-0.0.20rc7.dist-info/RECORD +293 -0
- beamlit-0.0.20rc5.dist-info/RECORD +0 -282
- {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc7.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -26,7 +26,7 @@ class ModelWithDeployments:
|
|
26
26
|
labels (Union['LabelsType0', None, Unset]): Labels
|
27
27
|
name (Union[Unset, str]): Model name
|
28
28
|
workspace (Union[Unset, str]): The workspace the model belongs to
|
29
|
-
deployments (Union[Unset,
|
29
|
+
deployments (Union[Unset, list['ModelDeployment']]):
|
30
30
|
"""
|
31
31
|
|
32
32
|
created_at: Union[Unset, str] = UNSET
|
@@ -37,7 +37,7 @@ class ModelWithDeployments:
|
|
37
37
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
38
38
|
name: Union[Unset, str] = UNSET
|
39
39
|
workspace: Union[Unset, str] = UNSET
|
40
|
-
deployments: Union[Unset,
|
40
|
+
deployments: Union[Unset, list["ModelDeployment"]] = 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]:
|
@@ -53,7 +53,7 @@ class ModelWithDeployments:
|
|
53
53
|
|
54
54
|
display_name = self.display_name
|
55
55
|
|
56
|
-
labels: Union[
|
56
|
+
labels: Union[None, Unset, dict[str, Any]]
|
57
57
|
if isinstance(self.labels, Unset):
|
58
58
|
labels = UNSET
|
59
59
|
elif isinstance(self.labels, LabelsType0):
|
@@ -65,7 +65,7 @@ class ModelWithDeployments:
|
|
65
65
|
|
66
66
|
workspace = self.workspace
|
67
67
|
|
68
|
-
deployments: Union[Unset,
|
68
|
+
deployments: Union[Unset, list[dict[str, Any]]] = UNSET
|
69
69
|
if not isinstance(self.deployments, Unset):
|
70
70
|
deployments = []
|
71
71
|
for componentsschemas_model_deployments_item_data in self.deployments:
|
@@ -97,7 +97,7 @@ class ModelWithDeployments:
|
|
97
97
|
return field_dict
|
98
98
|
|
99
99
|
@classmethod
|
100
|
-
def from_dict(cls:
|
100
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
101
101
|
from ..models.labels_type_0 import LabelsType0
|
102
102
|
from ..models.model_deployment import ModelDeployment
|
103
103
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -73,7 +73,7 @@ class PendingInvitation:
|
|
73
73
|
return field_dict
|
74
74
|
|
75
75
|
@classmethod
|
76
|
-
def from_dict(cls:
|
76
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
77
77
|
if not src_dict:
|
78
78
|
return None
|
79
79
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import 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
|
@@ -28,7 +28,7 @@ class PendingInvitationAccept:
|
|
28
28
|
def to_dict(self) -> dict[str, Any]:
|
29
29
|
email = self.email
|
30
30
|
|
31
|
-
workspace: Union[Unset,
|
31
|
+
workspace: Union[Unset, dict[str, Any]] = UNSET
|
32
32
|
if not isinstance(self.workspace, Unset):
|
33
33
|
workspace = self.workspace.to_dict()
|
34
34
|
|
@@ -43,7 +43,7 @@ class PendingInvitationAccept:
|
|
43
43
|
return field_dict
|
44
44
|
|
45
45
|
@classmethod
|
46
|
-
def from_dict(cls:
|
46
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
47
47
|
from ..models.workspace import Workspace
|
48
48
|
|
49
49
|
if not src_dict:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any,
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -40,17 +40,17 @@ class PendingInvitationRender:
|
|
40
40
|
|
41
41
|
invited_at = self.invited_at
|
42
42
|
|
43
|
-
invited_by: Union[Unset,
|
43
|
+
invited_by: Union[Unset, dict[str, Any]] = UNSET
|
44
44
|
if not isinstance(self.invited_by, Unset):
|
45
45
|
invited_by = self.invited_by.to_dict()
|
46
46
|
|
47
47
|
role = self.role
|
48
48
|
|
49
|
-
workspace: Union[Unset,
|
49
|
+
workspace: Union[Unset, dict[str, Any]] = UNSET
|
50
50
|
if not isinstance(self.workspace, Unset):
|
51
51
|
workspace = self.workspace.to_dict()
|
52
52
|
|
53
|
-
workspace_details: Union[Unset,
|
53
|
+
workspace_details: Union[Unset, dict[str, Any]] = UNSET
|
54
54
|
if not isinstance(self.workspace_details, Unset):
|
55
55
|
workspace_details = self.workspace_details.to_dict()
|
56
56
|
|
@@ -73,7 +73,7 @@ class PendingInvitationRender:
|
|
73
73
|
return field_dict
|
74
74
|
|
75
75
|
@classmethod
|
76
|
-
def from_dict(cls:
|
76
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
77
77
|
from ..models.pending_invitation_render_invited_by import PendingInvitationRenderInvitedBy
|
78
78
|
from ..models.pending_invitation_render_workspace import PendingInvitationRenderWorkspace
|
79
79
|
from ..models.pending_invitation_workspace_details import PendingInvitationWorkspaceDetails
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -49,7 +49,7 @@ class PendingInvitationRenderInvitedBy:
|
|
49
49
|
return field_dict
|
50
50
|
|
51
51
|
@classmethod
|
52
|
-
def from_dict(cls:
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
53
|
if not src_dict:
|
54
54
|
return None
|
55
55
|
d = src_dict.copy()
|
@@ -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,7 @@ class PendingInvitationRenderWorkspace:
|
|
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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union, cast
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -13,16 +13,16 @@ class PendingInvitationWorkspaceDetails:
|
|
13
13
|
"""Workspace details
|
14
14
|
|
15
15
|
Attributes:
|
16
|
-
emails (Union[Unset,
|
16
|
+
emails (Union[Unset, list[Any]]): List of user emails in the workspace
|
17
17
|
user_number (Union[Unset, float]): Number of users in the workspace
|
18
18
|
"""
|
19
19
|
|
20
|
-
emails: Union[Unset,
|
20
|
+
emails: Union[Unset, list[Any]] = UNSET
|
21
21
|
user_number: Union[Unset, float] = 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
|
-
emails: Union[Unset,
|
25
|
+
emails: Union[Unset, list[Any]] = UNSET
|
26
26
|
if not isinstance(self.emails, Unset):
|
27
27
|
emails = self.emails
|
28
28
|
|
@@ -39,11 +39,11 @@ class PendingInvitationWorkspaceDetails:
|
|
39
39
|
return field_dict
|
40
40
|
|
41
41
|
@classmethod
|
42
|
-
def from_dict(cls:
|
42
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
43
43
|
if not src_dict:
|
44
44
|
return None
|
45
45
|
d = src_dict.copy()
|
46
|
-
emails = cast(
|
46
|
+
emails = cast(list[Any], d.pop("emails", UNSET))
|
47
47
|
|
48
48
|
user_number = d.pop("user_number", UNSET)
|
49
49
|
|
beamlit/models/policy.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
|
@@ -24,13 +24,13 @@ class Policy:
|
|
24
24
|
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
25
25
|
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
26
26
|
display_name (Union[Unset, str]): Policy display name
|
27
|
-
flavors (Union[Unset,
|
27
|
+
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
28
28
|
labels (Union['LabelsType0', None, Unset]): Labels
|
29
|
-
locations (Union[Unset,
|
29
|
+
locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
|
30
30
|
name (Union[Unset, str]): Policy name
|
31
|
-
resource_types (Union[Unset,
|
31
|
+
resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
|
32
32
|
PolicyResourceType
|
33
|
-
|
33
|
+
type_ (Union[Unset, str]): Policy type, can be location or flavor
|
34
34
|
workspace (Union[Unset, str]): The workspace the policy belongs to
|
35
35
|
"""
|
36
36
|
|
@@ -39,12 +39,12 @@ class Policy:
|
|
39
39
|
updated_at: Union[Unset, str] = UNSET
|
40
40
|
updated_by: Union[Unset, str] = UNSET
|
41
41
|
display_name: Union[Unset, str] = UNSET
|
42
|
-
flavors: Union[Unset,
|
42
|
+
flavors: Union[Unset, list["Flavor"]] = UNSET
|
43
43
|
labels: Union["LabelsType0", None, Unset] = UNSET
|
44
|
-
locations: Union[Unset,
|
44
|
+
locations: Union[Unset, list["PolicyLocation"]] = UNSET
|
45
45
|
name: Union[Unset, str] = UNSET
|
46
|
-
resource_types: Union[Unset,
|
47
|
-
|
46
|
+
resource_types: Union[Unset, list[str]] = UNSET
|
47
|
+
type_: Union[Unset, str] = UNSET
|
48
48
|
workspace: Union[Unset, str] = UNSET
|
49
49
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
50
50
|
|
@@ -61,14 +61,14 @@ class Policy:
|
|
61
61
|
|
62
62
|
display_name = self.display_name
|
63
63
|
|
64
|
-
flavors: Union[Unset,
|
64
|
+
flavors: Union[Unset, list[dict[str, Any]]] = UNSET
|
65
65
|
if not isinstance(self.flavors, Unset):
|
66
66
|
flavors = []
|
67
67
|
for componentsschemas_flavors_item_data in self.flavors:
|
68
68
|
componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
|
69
69
|
flavors.append(componentsschemas_flavors_item)
|
70
70
|
|
71
|
-
labels: Union[
|
71
|
+
labels: Union[None, Unset, dict[str, Any]]
|
72
72
|
if isinstance(self.labels, Unset):
|
73
73
|
labels = UNSET
|
74
74
|
elif isinstance(self.labels, LabelsType0):
|
@@ -76,7 +76,7 @@ class Policy:
|
|
76
76
|
else:
|
77
77
|
labels = self.labels
|
78
78
|
|
79
|
-
locations: Union[Unset,
|
79
|
+
locations: Union[Unset, list[dict[str, Any]]] = UNSET
|
80
80
|
if not isinstance(self.locations, Unset):
|
81
81
|
locations = []
|
82
82
|
for componentsschemas_policy_locations_item_data in self.locations:
|
@@ -85,11 +85,11 @@ class Policy:
|
|
85
85
|
|
86
86
|
name = self.name
|
87
87
|
|
88
|
-
resource_types: Union[Unset,
|
88
|
+
resource_types: Union[Unset, list[str]] = UNSET
|
89
89
|
if not isinstance(self.resource_types, Unset):
|
90
90
|
resource_types = self.resource_types
|
91
91
|
|
92
|
-
|
92
|
+
type_ = self.type_
|
93
93
|
|
94
94
|
workspace = self.workspace
|
95
95
|
|
@@ -116,15 +116,15 @@ class Policy:
|
|
116
116
|
field_dict["name"] = name
|
117
117
|
if resource_types is not UNSET:
|
118
118
|
field_dict["resource_types"] = resource_types
|
119
|
-
if
|
120
|
-
field_dict["type"] =
|
119
|
+
if type_ is not UNSET:
|
120
|
+
field_dict["type"] = type_
|
121
121
|
if workspace is not UNSET:
|
122
122
|
field_dict["workspace"] = workspace
|
123
123
|
|
124
124
|
return field_dict
|
125
125
|
|
126
126
|
@classmethod
|
127
|
-
def from_dict(cls:
|
127
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
128
128
|
from ..models.flavor import Flavor
|
129
129
|
from ..models.labels_type_0 import LabelsType0
|
130
130
|
from ..models.policy_location import PolicyLocation
|
@@ -177,9 +177,9 @@ class Policy:
|
|
177
177
|
|
178
178
|
name = d.pop("name", UNSET)
|
179
179
|
|
180
|
-
resource_types = cast(
|
180
|
+
resource_types = cast(list[str], d.pop("resource_types", UNSET))
|
181
181
|
|
182
|
-
|
182
|
+
type_ = d.pop("type", UNSET)
|
183
183
|
|
184
184
|
workspace = d.pop("workspace", UNSET)
|
185
185
|
|
@@ -194,7 +194,7 @@ class Policy:
|
|
194
194
|
locations=locations,
|
195
195
|
name=name,
|
196
196
|
resource_types=resource_types,
|
197
|
-
|
197
|
+
type_=type_,
|
198
198
|
workspace=workspace,
|
199
199
|
)
|
200
200
|
|
@@ -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,40 +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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
44
44
|
name = d.pop("name", UNSET)
|
45
45
|
|
46
|
-
|
46
|
+
type_ = d.pop("type", UNSET)
|
47
47
|
|
48
48
|
policy_location = cls(
|
49
49
|
name=name,
|
50
|
-
|
50
|
+
type_=type_,
|
51
51
|
)
|
52
52
|
|
53
53
|
policy_location.additional_properties = d
|
beamlit/models/policy_spec.py
CHANGED
@@ -36,14 +36,18 @@ class PolicySpec:
|
|
36
36
|
if not isinstance(self.flavors, Unset):
|
37
37
|
flavors = []
|
38
38
|
for componentsschemas_flavors_item_data in self.flavors:
|
39
|
-
componentsschemas_flavors_item =
|
39
|
+
componentsschemas_flavors_item = (
|
40
|
+
componentsschemas_flavors_item_data.to_dict()
|
41
|
+
)
|
40
42
|
flavors.append(componentsschemas_flavors_item)
|
41
43
|
|
42
44
|
locations: Union[Unset, List[Dict[str, Any]]] = UNSET
|
43
45
|
if not isinstance(self.locations, Unset):
|
44
46
|
locations = []
|
45
47
|
for componentsschemas_policy_locations_item_data in self.locations:
|
46
|
-
componentsschemas_policy_locations_item =
|
48
|
+
componentsschemas_policy_locations_item = (
|
49
|
+
componentsschemas_policy_locations_item_data.to_dict()
|
50
|
+
)
|
47
51
|
locations.append(componentsschemas_policy_locations_item)
|
48
52
|
|
49
53
|
resource_types: Union[Unset, List[str]] = UNSET
|
@@ -75,7 +79,9 @@ class PolicySpec:
|
|
75
79
|
flavors = []
|
76
80
|
_flavors = d.pop("flavors", UNSET)
|
77
81
|
for componentsschemas_flavors_item_data in _flavors or []:
|
78
|
-
componentsschemas_flavors_item = Flavor.from_dict(
|
82
|
+
componentsschemas_flavors_item = Flavor.from_dict(
|
83
|
+
componentsschemas_flavors_item_data
|
84
|
+
)
|
79
85
|
|
80
86
|
flavors.append(componentsschemas_flavors_item)
|
81
87
|
|
@@ -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,23 +18,23 @@ class ProviderConfig:
|
|
18
18
|
|
19
19
|
Attributes:
|
20
20
|
filename (Union[Unset, str]): The file name to use for the model
|
21
|
-
presigned_url (Union[Unset,
|
21
|
+
presigned_url (Union[Unset, list[Any]]): The presigned URLs to upload the model to
|
22
22
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
23
23
|
"""
|
24
24
|
|
25
25
|
filename: Union[Unset, str] = UNSET
|
26
|
-
presigned_url: Union[Unset,
|
26
|
+
presigned_url: Union[Unset, list[Any]] = UNSET
|
27
27
|
runtime: Union[Unset, "Runtime"] = UNSET
|
28
28
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
29
|
|
30
30
|
def to_dict(self) -> dict[str, Any]:
|
31
31
|
filename = self.filename
|
32
32
|
|
33
|
-
presigned_url: Union[Unset,
|
33
|
+
presigned_url: Union[Unset, list[Any]] = UNSET
|
34
34
|
if not isinstance(self.presigned_url, Unset):
|
35
35
|
presigned_url = self.presigned_url
|
36
36
|
|
37
|
-
runtime: Union[Unset,
|
37
|
+
runtime: Union[Unset, dict[str, Any]] = UNSET
|
38
38
|
if not isinstance(self.runtime, Unset):
|
39
39
|
runtime = self.runtime.to_dict()
|
40
40
|
|
@@ -51,7 +51,7 @@ class ProviderConfig:
|
|
51
51
|
return field_dict
|
52
52
|
|
53
53
|
@classmethod
|
54
|
-
def from_dict(cls:
|
54
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
55
55
|
from ..models.runtime import Runtime
|
56
56
|
|
57
57
|
if not src_dict:
|
@@ -59,7 +59,7 @@ class ProviderConfig:
|
|
59
59
|
d = src_dict.copy()
|
60
60
|
filename = d.pop("filename", UNSET)
|
61
61
|
|
62
|
-
presigned_url = cast(
|
62
|
+
presigned_url = cast(list[Any], d.pop("presigned_url", UNSET))
|
63
63
|
|
64
64
|
_runtime = d.pop("runtime", UNSET)
|
65
65
|
runtime: Union[Unset, 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,7 @@ 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
35
|
if not src_dict:
|
36
36
|
return None
|
37
37
|
d = src_dict.copy()
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any,
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -37,7 +37,7 @@ 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
41
|
if not src_dict:
|
42
42
|
return None
|
43
43
|
d = src_dict.copy()
|
@@ -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
|
@@ -28,10 +28,10 @@ class ResourceDeploymentMetrics:
|
|
28
28
|
"""Metrics for a single resource deployment (eg. model deployment, function deployment)
|
29
29
|
|
30
30
|
Attributes:
|
31
|
-
inference_global (Union[Unset,
|
31
|
+
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
32
32
|
inference_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerRegion]): Historical requests (in last
|
33
33
|
24 hours) per location, for the model deployment
|
34
|
-
inference_per_second_global (Union[Unset,
|
34
|
+
inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
|
35
35
|
inference_per_second_per_region (Union[Unset, ResourceDeploymentMetricsInferencePerSecondPerRegion]): Historical
|
36
36
|
requests per second (RPS) per location, for the model deployment
|
37
37
|
query_global (Union[Unset, float]): Number of requests done on the resource for the model deployment
|
@@ -50,9 +50,9 @@ class ResourceDeploymentMetrics:
|
|
50
50
|
RPS value (in last 24 hours) per response status code per location, for the model deployment
|
51
51
|
"""
|
52
52
|
|
53
|
-
inference_global: Union[Unset,
|
53
|
+
inference_global: Union[Unset, list["Metric"]] = UNSET
|
54
54
|
inference_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerRegion"] = UNSET
|
55
|
-
inference_per_second_global: Union[Unset,
|
55
|
+
inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
|
56
56
|
inference_per_second_per_region: Union[Unset, "ResourceDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
|
57
57
|
query_global: Union[Unset, float] = UNSET
|
58
58
|
query_per_code_global: Union[Unset, "QPS"] = UNSET
|
@@ -67,53 +67,53 @@ class ResourceDeploymentMetrics:
|
|
67
67
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
68
68
|
|
69
69
|
def to_dict(self) -> dict[str, Any]:
|
70
|
-
inference_global: Union[Unset,
|
70
|
+
inference_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
71
71
|
if not isinstance(self.inference_global, Unset):
|
72
72
|
inference_global = []
|
73
73
|
for componentsschemas_array_metric_item_data in self.inference_global:
|
74
74
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
75
75
|
inference_global.append(componentsschemas_array_metric_item)
|
76
76
|
|
77
|
-
inference_per_region: Union[Unset,
|
77
|
+
inference_per_region: Union[Unset, dict[str, Any]] = UNSET
|
78
78
|
if not isinstance(self.inference_per_region, Unset):
|
79
79
|
inference_per_region = self.inference_per_region.to_dict()
|
80
80
|
|
81
|
-
inference_per_second_global: Union[Unset,
|
81
|
+
inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
|
82
82
|
if not isinstance(self.inference_per_second_global, Unset):
|
83
83
|
inference_per_second_global = []
|
84
84
|
for componentsschemas_array_metric_item_data in self.inference_per_second_global:
|
85
85
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
86
86
|
inference_per_second_global.append(componentsschemas_array_metric_item)
|
87
87
|
|
88
|
-
inference_per_second_per_region: Union[Unset,
|
88
|
+
inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
89
89
|
if not isinstance(self.inference_per_second_per_region, Unset):
|
90
90
|
inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
|
91
91
|
|
92
92
|
query_global = self.query_global
|
93
93
|
|
94
|
-
query_per_code_global: Union[Unset,
|
94
|
+
query_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
95
95
|
if not isinstance(self.query_per_code_global, Unset):
|
96
96
|
query_per_code_global = self.query_per_code_global.to_dict()
|
97
97
|
|
98
|
-
query_per_region: Union[Unset,
|
98
|
+
query_per_region: Union[Unset, dict[str, Any]] = UNSET
|
99
99
|
if not isinstance(self.query_per_region, Unset):
|
100
100
|
query_per_region = self.query_per_region.to_dict()
|
101
101
|
|
102
|
-
query_per_region_per_code: Union[Unset,
|
102
|
+
query_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
103
103
|
if not isinstance(self.query_per_region_per_code, Unset):
|
104
104
|
query_per_region_per_code = self.query_per_region_per_code.to_dict()
|
105
105
|
|
106
106
|
query_per_second_global = self.query_per_second_global
|
107
107
|
|
108
|
-
query_per_second_per_code_global: Union[Unset,
|
108
|
+
query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
|
109
109
|
if not isinstance(self.query_per_second_per_code_global, Unset):
|
110
110
|
query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
|
111
111
|
|
112
|
-
query_per_second_per_region: Union[Unset,
|
112
|
+
query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
|
113
113
|
if not isinstance(self.query_per_second_per_region, Unset):
|
114
114
|
query_per_second_per_region = self.query_per_second_per_region.to_dict()
|
115
115
|
|
116
|
-
query_per_second_per_region_per_code: Union[Unset,
|
116
|
+
query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
|
117
117
|
if not isinstance(self.query_per_second_per_region_per_code, Unset):
|
118
118
|
query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
|
119
119
|
|
@@ -148,7 +148,7 @@ class ResourceDeploymentMetrics:
|
|
148
148
|
return field_dict
|
149
149
|
|
150
150
|
@classmethod
|
151
|
-
def from_dict(cls:
|
151
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
152
152
|
from ..models.metric import Metric
|
153
153
|
from ..models.qps import QPS
|
154
154
|
from ..models.resource_deployment_metrics_inference_per_region import (
|
@@ -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 ResourceDeploymentMetricsInferencePerRegion:
|
|
17
17
|
"""Historical requests (in last 24 hours) per location, for the model deployment
|
18
18
|
|
19
19
|
Attributes:
|
20
|
-
region (Union[Unset,
|
20
|
+
region (Union[Unset, list['Metric']]): Array of metrics
|
21
21
|
"""
|
22
22
|
|
23
|
-
region: Union[Unset,
|
23
|
+
region: Union[Unset, list["Metric"]] = UNSET
|
24
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
25
|
|
26
26
|
def to_dict(self) -> dict[str, Any]:
|
27
|
-
region: Union[Unset,
|
27
|
+
region: Union[Unset, list[dict[str, Any]]] = UNSET
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
@@ -40,7 +40,7 @@ class ResourceDeploymentMetricsInferencePerRegion:
|
|
40
40
|
return field_dict
|
41
41
|
|
42
42
|
@classmethod
|
43
|
-
def from_dict(cls:
|
43
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
44
44
|
from ..models.metric import Metric
|
45
45
|
|
46
46
|
if not src_dict:
|
@@ -28,7 +28,9 @@ class ResourceDeploymentMetricsInferencePerRegionType0:
|
|
28
28
|
if not isinstance(self.region, Unset):
|
29
29
|
region = []
|
30
30
|
for componentsschemas_array_metric_item_data in self.region:
|
31
|
-
componentsschemas_array_metric_item =
|
31
|
+
componentsschemas_array_metric_item = (
|
32
|
+
componentsschemas_array_metric_item_data.to_dict()
|
33
|
+
)
|
32
34
|
region.append(componentsschemas_array_metric_item)
|
33
35
|
|
34
36
|
field_dict: dict[str, Any] = {}
|
@@ -47,7 +49,9 @@ class ResourceDeploymentMetricsInferencePerRegionType0:
|
|
47
49
|
region = []
|
48
50
|
_region = d.pop("region", UNSET)
|
49
51
|
for componentsschemas_array_metric_item_data in _region or []:
|
50
|
-
componentsschemas_array_metric_item = Metric.from_dict(
|
52
|
+
componentsschemas_array_metric_item = Metric.from_dict(
|
53
|
+
componentsschemas_array_metric_item_data
|
54
|
+
)
|
51
55
|
|
52
56
|
region.append(componentsschemas_array_metric_item)
|
53
57
|
|