beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. beamlit/api/agents/delete_agent_history.py +155 -0
  2. beamlit/api/agents/get_agent_deployment.py +1 -22
  3. beamlit/api/agents/get_agent_environment_logs.py +151 -0
  4. beamlit/api/agents/get_agent_history.py +155 -0
  5. beamlit/api/agents/list_agent_history.py +151 -0
  6. beamlit/api/agents/put_agent_history.py +181 -0
  7. beamlit/api/functions/get_function_environment_logs.py +151 -0
  8. beamlit/api/models/get_model_environment_logs.py +155 -0
  9. beamlit/authentication/__init__.py +4 -0
  10. beamlit/authentication/apikey.py +6 -0
  11. beamlit/authentication/authentication.py +31 -2
  12. beamlit/authentication/clientcredentials.py +20 -9
  13. beamlit/authentication/credentials.py +1 -0
  14. beamlit/authentication/device_mode.py +10 -1
  15. beamlit/common/generate.py +8 -3
  16. beamlit/common/logger.py +2 -0
  17. beamlit/common/settings.py +1 -5
  18. beamlit/models/__init__.py +28 -30
  19. beamlit/models/acl.py +2 -0
  20. beamlit/models/agent.py +2 -0
  21. beamlit/models/agent_chain.py +2 -0
  22. beamlit/models/agent_configuration.py +2 -0
  23. beamlit/models/agent_deployment.py +44 -99
  24. beamlit/models/agent_deployment_configuration.py +45 -0
  25. beamlit/models/agent_deployment_history.py +15 -46
  26. beamlit/models/agent_deployment_history_event.py +24 -78
  27. beamlit/models/agent_deployment_pod_template.py +45 -0
  28. beamlit/models/agent_history.py +165 -0
  29. beamlit/models/agent_history_event.py +131 -0
  30. beamlit/models/agent_metadata.py +144 -0
  31. beamlit/models/agent_release.py +2 -0
  32. beamlit/models/agent_spec.py +238 -0
  33. beamlit/models/agent_with_deployments.py +2 -0
  34. beamlit/models/api_key.py +2 -0
  35. beamlit/models/authentication_provider_model.py +2 -0
  36. beamlit/models/authentication_provider_organization.py +2 -0
  37. beamlit/models/configuration.py +2 -0
  38. beamlit/models/continent.py +2 -0
  39. beamlit/models/core_spec.py +179 -0
  40. beamlit/models/country.py +2 -0
  41. beamlit/models/create_api_key_for_service_account_body.py +2 -0
  42. beamlit/models/create_workspace_service_account_body.py +2 -0
  43. beamlit/models/create_workspace_service_account_response_200.py +2 -0
  44. beamlit/models/delete_workspace_service_account_response_200.py +2 -0
  45. beamlit/models/deployment_configuration.py +2 -0
  46. beamlit/models/deployment_configurations.py +2 -0
  47. beamlit/models/deployment_serverless_config.py +131 -0
  48. beamlit/models/environment.py +2 -0
  49. beamlit/models/environment_metrics.py +2 -0
  50. beamlit/models/environment_spec.py +61 -0
  51. beamlit/models/flavor.py +2 -0
  52. beamlit/models/function.py +2 -0
  53. beamlit/models/function_configuration.py +2 -0
  54. beamlit/models/function_deployment.py +44 -99
  55. beamlit/models/function_deployment_configuration.py +45 -0
  56. beamlit/models/function_deployment_pod_template.py +45 -0
  57. beamlit/models/function_kit.py +2 -0
  58. beamlit/models/function_metadata.py +144 -0
  59. beamlit/models/function_provider_ref.py +2 -0
  60. beamlit/models/function_release.py +2 -0
  61. beamlit/models/function_spec.py +240 -0
  62. beamlit/models/function_with_deployments.py +2 -0
  63. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
  64. beamlit/models/increase_and_rate_metric.py +2 -0
  65. beamlit/models/integration.py +2 -0
  66. beamlit/models/integration_config.py +2 -0
  67. beamlit/models/integration_connection.py +2 -0
  68. beamlit/models/integration_connection_config.py +2 -0
  69. beamlit/models/integration_connection_secret.py +2 -0
  70. beamlit/models/integration_connection_spec.py +99 -0
  71. beamlit/models/integration_model.py +2 -0
  72. beamlit/models/integration_secret.py +2 -0
  73. beamlit/models/invite_workspace_user_body.py +2 -0
  74. beamlit/models/labels_type_0.py +2 -0
  75. beamlit/models/location.py +2 -0
  76. beamlit/models/location_response.py +2 -0
  77. beamlit/models/metadata.py +135 -0
  78. beamlit/models/metadata_labels.py +43 -0
  79. beamlit/models/metric.py +2 -0
  80. beamlit/models/metrics.py +2 -0
  81. beamlit/models/model.py +2 -0
  82. beamlit/models/model_deployment.py +66 -85
  83. beamlit/models/model_deployment_log.py +2 -0
  84. beamlit/models/model_deployment_metrics.py +2 -0
  85. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
  86. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
  87. beamlit/models/model_deployment_pod_template.py +45 -0
  88. beamlit/models/model_metadata.py +144 -0
  89. beamlit/models/model_metrics.py +2 -0
  90. beamlit/models/model_provider.py +2 -0
  91. beamlit/models/model_provider_ref.py +2 -0
  92. beamlit/models/model_release.py +2 -0
  93. beamlit/models/model_spec.py +188 -0
  94. beamlit/models/model_with_deployments.py +2 -0
  95. beamlit/models/owner_fields.py +68 -0
  96. beamlit/models/pending_invitation.py +2 -0
  97. beamlit/models/pending_invitation_accept.py +2 -0
  98. beamlit/models/pending_invitation_render.py +2 -0
  99. beamlit/models/pending_invitation_render_invited_by.py +2 -0
  100. beamlit/models/pending_invitation_render_workspace.py +2 -0
  101. beamlit/models/pending_invitation_workspace_details.py +2 -0
  102. beamlit/models/pod_template_spec.py +43 -0
  103. beamlit/models/policy.py +36 -8
  104. beamlit/models/policy_location.py +2 -0
  105. beamlit/models/policy_spec.py +119 -0
  106. beamlit/models/provider_config.py +2 -0
  107. beamlit/models/qps.py +2 -0
  108. beamlit/models/resource_deployment_log.py +2 -0
  109. beamlit/models/resource_deployment_metrics.py +70 -155
  110. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  111. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
  112. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  113. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
  114. beamlit/models/resource_environment_metrics.py +172 -0
  115. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
  116. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  117. beamlit/models/resource_log.py +68 -0
  118. beamlit/models/resource_metrics.py +2 -0
  119. beamlit/models/runtime.py +14 -29
  120. beamlit/models/runtime_readiness_probe.py +45 -0
  121. beamlit/models/runtime_resources.py +2 -0
  122. beamlit/models/runtime_type_0.py +111 -0
  123. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  124. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  125. beamlit/models/runtime_type_0_resources.py +59 -0
  126. beamlit/models/serverless_config.py +2 -0
  127. beamlit/models/spec_configuration.py +68 -0
  128. beamlit/models/standard_fields_dynamo_db.py +2 -0
  129. beamlit/models/store_agent.py +15 -29
  130. beamlit/models/store_agent_configuration.py +2 -0
  131. beamlit/models/store_agent_labels.py +45 -0
  132. beamlit/models/store_configuration.py +6 -15
  133. beamlit/models/store_configuration_option.py +7 -18
  134. beamlit/models/store_function.py +15 -29
  135. beamlit/models/store_function_configuration.py +2 -0
  136. beamlit/models/store_function_kit.py +2 -0
  137. beamlit/models/store_function_labels.py +45 -0
  138. beamlit/models/store_function_parameter.py +2 -0
  139. beamlit/models/time_fields.py +68 -0
  140. beamlit/models/update_workspace_service_account_body.py +2 -0
  141. beamlit/models/update_workspace_service_account_response_200.py +2 -0
  142. beamlit/models/update_workspace_user_role_body.py +2 -0
  143. beamlit/models/websocket_channel.py +86 -0
  144. beamlit/models/workspace.py +2 -0
  145. beamlit/models/workspace_labels.py +2 -0
  146. beamlit/models/workspace_user.py +2 -0
  147. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/METADATA +1 -1
  148. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/RECORD +149 -102
  149. {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,75 @@
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="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,75 @@
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="ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode")
13
+
14
+
15
+ @_attrs_define
16
+ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
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
+ 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_second_per_region_per_code = cls(
55
+ region=region,
56
+ )
57
+
58
+ resource_deployment_metrics_query_per_second_per_region_per_code.additional_properties = d
59
+ return resource_deployment_metrics_query_per_second_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,172 @@
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[Unset, "ResourceEnvironmentMetricsInferencePerSecondPerRegion"] = UNSET
41
+ query_per_second_global: Union[Unset, float] = UNSET
42
+ query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
43
+ query_per_second_per_region: Union[Unset, "QPS"] = UNSET
44
+ query_per_second_per_region_per_code: Union[Unset, "ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode"] = (
45
+ UNSET
46
+ )
47
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
48
+
49
+ def to_dict(self) -> dict[str, Any]:
50
+ inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
51
+ if not isinstance(self.inference_per_second_global, Unset):
52
+ inference_per_second_global = []
53
+ for componentsschemas_array_metric_item_data in self.inference_per_second_global:
54
+ componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
55
+ inference_per_second_global.append(componentsschemas_array_metric_item)
56
+
57
+ inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
58
+ if not isinstance(self.inference_per_second_per_region, Unset):
59
+ inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
60
+
61
+ query_per_second_global = self.query_per_second_global
62
+
63
+ query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
64
+ if not isinstance(self.query_per_second_per_code_global, Unset):
65
+ query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
66
+
67
+ query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
68
+ if not isinstance(self.query_per_second_per_region, Unset):
69
+ query_per_second_per_region = self.query_per_second_per_region.to_dict()
70
+
71
+ query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
72
+ if not isinstance(self.query_per_second_per_region_per_code, Unset):
73
+ query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
74
+
75
+ field_dict: dict[str, Any] = {}
76
+ field_dict.update(self.additional_properties)
77
+ field_dict.update({})
78
+ if inference_per_second_global is not UNSET:
79
+ field_dict["inference_per_second_global"] = inference_per_second_global
80
+ if inference_per_second_per_region is not UNSET:
81
+ field_dict["inference_per_second_per_region"] = inference_per_second_per_region
82
+ if query_per_second_global is not UNSET:
83
+ field_dict["query_per_second_global"] = query_per_second_global
84
+ if query_per_second_per_code_global is not UNSET:
85
+ field_dict["query_per_second_per_code_global"] = query_per_second_per_code_global
86
+ if query_per_second_per_region is not UNSET:
87
+ field_dict["query_per_second_per_region"] = query_per_second_per_region
88
+ if query_per_second_per_region_per_code is not UNSET:
89
+ field_dict["query_per_second_per_region_per_code"] = query_per_second_per_region_per_code
90
+
91
+ return field_dict
92
+
93
+ @classmethod
94
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
95
+ from ..models.metric import Metric
96
+ from ..models.qps import QPS
97
+ from ..models.resource_environment_metrics_inference_per_second_per_region import (
98
+ ResourceEnvironmentMetricsInferencePerSecondPerRegion,
99
+ )
100
+ from ..models.resource_environment_metrics_query_per_second_per_region_per_code import (
101
+ ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode,
102
+ )
103
+
104
+ d = src_dict.copy()
105
+ inference_per_second_global = []
106
+ _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
107
+ for componentsschemas_array_metric_item_data in _inference_per_second_global or []:
108
+ componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
109
+
110
+ inference_per_second_global.append(componentsschemas_array_metric_item)
111
+
112
+ _inference_per_second_per_region = d.pop("inference_per_second_per_region", UNSET)
113
+ inference_per_second_per_region: Union[Unset, ResourceEnvironmentMetricsInferencePerSecondPerRegion]
114
+ if isinstance(_inference_per_second_per_region, Unset):
115
+ inference_per_second_per_region = UNSET
116
+ else:
117
+ inference_per_second_per_region = ResourceEnvironmentMetricsInferencePerSecondPerRegion.from_dict(
118
+ _inference_per_second_per_region
119
+ )
120
+
121
+ query_per_second_global = d.pop("query_per_second_global", UNSET)
122
+
123
+ _query_per_second_per_code_global = d.pop("query_per_second_per_code_global", UNSET)
124
+ query_per_second_per_code_global: Union[Unset, QPS]
125
+ if isinstance(_query_per_second_per_code_global, Unset):
126
+ query_per_second_per_code_global = UNSET
127
+ else:
128
+ query_per_second_per_code_global = QPS.from_dict(_query_per_second_per_code_global)
129
+
130
+ _query_per_second_per_region = d.pop("query_per_second_per_region", UNSET)
131
+ query_per_second_per_region: Union[Unset, QPS]
132
+ if isinstance(_query_per_second_per_region, Unset):
133
+ query_per_second_per_region = UNSET
134
+ else:
135
+ query_per_second_per_region = QPS.from_dict(_query_per_second_per_region)
136
+
137
+ _query_per_second_per_region_per_code = d.pop("query_per_second_per_region_per_code", UNSET)
138
+ query_per_second_per_region_per_code: Union[Unset, ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode]
139
+ if isinstance(_query_per_second_per_region_per_code, Unset):
140
+ query_per_second_per_region_per_code = UNSET
141
+ else:
142
+ query_per_second_per_region_per_code = ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode.from_dict(
143
+ _query_per_second_per_region_per_code
144
+ )
145
+
146
+ resource_environment_metrics = cls(
147
+ inference_per_second_global=inference_per_second_global,
148
+ inference_per_second_per_region=inference_per_second_per_region,
149
+ query_per_second_global=query_per_second_global,
150
+ query_per_second_per_code_global=query_per_second_per_code_global,
151
+ query_per_second_per_region=query_per_second_per_region,
152
+ query_per_second_per_region_per_code=query_per_second_per_region_per_code,
153
+ )
154
+
155
+ resource_environment_metrics.additional_properties = d
156
+ return resource_environment_metrics
157
+
158
+ @property
159
+ def additional_keys(self) -> list[str]:
160
+ return list(self.additional_properties.keys())
161
+
162
+ def __getitem__(self, key: str) -> Any:
163
+ return self.additional_properties[key]
164
+
165
+ def __setitem__(self, key: str, value: Any) -> None:
166
+ self.additional_properties[key] = value
167
+
168
+ def __delitem__(self, key: str) -> None:
169
+ del self.additional_properties[key]
170
+
171
+ def __contains__(self, key: str) -> bool:
172
+ return key in self.additional_properties
@@ -0,0 +1,75 @@
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 = 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
+ d = src_dict.copy()
47
+ region = []
48
+ _region = d.pop("region", UNSET)
49
+ for componentsschemas_array_metric_item_data in _region or []:
50
+ componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
51
+
52
+ region.append(componentsschemas_array_metric_item)
53
+
54
+ resource_environment_metrics_inference_per_second_per_region = cls(
55
+ region=region,
56
+ )
57
+
58
+ resource_environment_metrics_inference_per_second_per_region.additional_properties = d
59
+ return resource_environment_metrics_inference_per_second_per_region
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="ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode")
13
+
14
+
15
+ @_attrs_define
16
+ class ResourceEnvironmentMetricsQueryPerSecondPerRegionPerCode:
17
+ """RPS value (in last 24 hours) per response status code per location, for the model deployment
18
+
19
+ Attributes:
20
+ region (Union[Unset, QPS]): Query per second per element, can be per response status code (e.g. 200, 400) or per
21
+ location
22
+ """
23
+
24
+ region: Union[Unset, "QPS"] = UNSET
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ region: Union[Unset, Dict[str, Any]] = UNSET
29
+ if not isinstance(self.region, Unset):
30
+ region = self.region.to_dict()
31
+
32
+ field_dict: dict[str, Any] = {}
33
+ field_dict.update(self.additional_properties)
34
+ field_dict.update({})
35
+ if region is not UNSET:
36
+ field_dict["region"] = region
37
+
38
+ return field_dict
39
+
40
+ @classmethod
41
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
42
+ from ..models.qps import QPS
43
+
44
+ d = src_dict.copy()
45
+ _region = d.pop("region", UNSET)
46
+ region: Union[Unset, QPS]
47
+ if isinstance(_region, Unset):
48
+ region = UNSET
49
+ else:
50
+ region = QPS.from_dict(_region)
51
+
52
+ resource_environment_metrics_query_per_second_per_region_per_code = cls(
53
+ region=region,
54
+ )
55
+
56
+ resource_environment_metrics_query_per_second_per_region_per_code.additional_properties = d
57
+ return resource_environment_metrics_query_per_second_per_region_per_code
58
+
59
+ @property
60
+ def additional_keys(self) -> list[str]:
61
+ return list(self.additional_properties.keys())
62
+
63
+ def __getitem__(self, key: str) -> Any:
64
+ return self.additional_properties[key]
65
+
66
+ def __setitem__(self, key: str, value: Any) -> None:
67
+ self.additional_properties[key] = value
68
+
69
+ def __delitem__(self, key: str) -> None:
70
+ del self.additional_properties[key]
71
+
72
+ def __contains__(self, key: str) -> bool:
73
+ return key in self.additional_properties
@@ -0,0 +1,68 @@
1
+ from typing import Any, Type, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="ResourceLog")
9
+
10
+
11
+ @_attrs_define
12
+ class ResourceLog:
13
+ """Log for a resource deployment (eg. model deployment, function deployment)
14
+
15
+ Attributes:
16
+ message (Union[Unset, str]): Content of the log
17
+ timestamp (Union[Unset, str]): The timestamp of the log
18
+ """
19
+
20
+ message: Union[Unset, str] = UNSET
21
+ timestamp: Union[Unset, str] = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ message = self.message
26
+
27
+ timestamp = self.timestamp
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update({})
32
+ if message is not UNSET:
33
+ field_dict["message"] = message
34
+ if timestamp is not UNSET:
35
+ field_dict["timestamp"] = timestamp
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ d = src_dict.copy()
42
+ message = d.pop("message", UNSET)
43
+
44
+ timestamp = d.pop("timestamp", UNSET)
45
+
46
+ resource_log = cls(
47
+ message=message,
48
+ timestamp=timestamp,
49
+ )
50
+
51
+ resource_log.additional_properties = d
52
+ return resource_log
53
+
54
+ @property
55
+ def additional_keys(self) -> list[str]:
56
+ return list(self.additional_properties.keys())
57
+
58
+ def __getitem__(self, key: str) -> Any:
59
+ return self.additional_properties[key]
60
+
61
+ def __setitem__(self, key: str, value: Any) -> None:
62
+ self.additional_properties[key] = value
63
+
64
+ def __delitem__(self, key: str) -> None:
65
+ del self.additional_properties[key]
66
+
67
+ def __contains__(self, key: str) -> bool:
68
+ return key in self.additional_properties
@@ -74,6 +74,8 @@ class ResourceMetrics:
74
74
  from ..models.metric import Metric
75
75
  from ..models.qps import QPS
76
76
 
77
+ if not src_dict:
78
+ return None
77
79
  d = src_dict.copy()
78
80
  inference_global = []
79
81
  _inference_global = d.pop("inference_global", UNSET)
beamlit/models/runtime.py CHANGED
@@ -6,7 +6,7 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
- from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
9
+ from ..models.runtime_readiness_probe import RuntimeReadinessProbe
10
10
  from ..models.runtime_resources import RuntimeResources
11
11
 
12
12
 
@@ -24,8 +24,7 @@ class Runtime:
24
24
  Kubernetes EnvVar types
25
25
  image (Union[Unset, str]): The Docker image for the deployment
26
26
  model (Union[Unset, str]): The slug name of the origin model. Only used if the deployment is a ModelDeployment
27
- readiness_probe (Union['RuntimeReadinessProbeType0', None, Unset]): The readiness probe. Should be a Kubernetes
28
- Probe type
27
+ readiness_probe (Union[Unset, RuntimeReadinessProbe]): The readiness probe. Should be a Kubernetes Probe type
29
28
  resources (Union[Unset, RuntimeResources]): The resources for the deployment. Should be a Kubernetes
30
29
  ResourceRequirements type
31
30
  type (Union[Unset, str]): The type of origin for the deployment
@@ -36,14 +35,12 @@ class Runtime:
36
35
  envs: Union[Unset, List[Any]] = UNSET
37
36
  image: Union[Unset, str] = UNSET
38
37
  model: Union[Unset, str] = UNSET
39
- readiness_probe: Union["RuntimeReadinessProbeType0", None, Unset] = UNSET
38
+ readiness_probe: Union[Unset, "RuntimeReadinessProbe"] = UNSET
40
39
  resources: Union[Unset, "RuntimeResources"] = UNSET
41
40
  type: Union[Unset, str] = UNSET
42
41
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
43
42
 
44
43
  def to_dict(self) -> dict[str, Any]:
45
- from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
46
-
47
44
  args: Union[Unset, List[Any]] = UNSET
48
45
  if not isinstance(self.args, Unset):
49
46
  args = self.args
@@ -60,13 +57,9 @@ class Runtime:
60
57
 
61
58
  model = self.model
62
59
 
63
- readiness_probe: Union[Dict[str, Any], None, Unset]
64
- if isinstance(self.readiness_probe, Unset):
65
- readiness_probe = UNSET
66
- elif isinstance(self.readiness_probe, RuntimeReadinessProbeType0):
60
+ readiness_probe: Union[Unset, Dict[str, Any]] = UNSET
61
+ if not isinstance(self.readiness_probe, Unset):
67
62
  readiness_probe = self.readiness_probe.to_dict()
68
- else:
69
- readiness_probe = self.readiness_probe
70
63
 
71
64
  resources: Union[Unset, Dict[str, Any]] = UNSET
72
65
  if not isinstance(self.resources, Unset):
@@ -98,9 +91,11 @@ class Runtime:
98
91
 
99
92
  @classmethod
100
93
  def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
101
- from ..models.runtime_readiness_probe_type_0 import RuntimeReadinessProbeType0
94
+ from ..models.runtime_readiness_probe import RuntimeReadinessProbe
102
95
  from ..models.runtime_resources import RuntimeResources
103
96
 
97
+ if not src_dict:
98
+ return None
104
99
  d = src_dict.copy()
105
100
  args = cast(List[Any], d.pop("args", UNSET))
106
101
 
@@ -112,22 +107,12 @@ class Runtime:
112
107
 
113
108
  model = d.pop("model", UNSET)
114
109
 
115
- def _parse_readiness_probe(data: object) -> Union["RuntimeReadinessProbeType0", None, Unset]:
116
- if data is None:
117
- return data
118
- if isinstance(data, Unset):
119
- return data
120
- try:
121
- if not isinstance(data, dict):
122
- raise TypeError()
123
- readiness_probe_type_0 = RuntimeReadinessProbeType0.from_dict(data)
124
-
125
- return readiness_probe_type_0
126
- except: # noqa: E722
127
- pass
128
- return cast(Union["RuntimeReadinessProbeType0", None, Unset], data)
129
-
130
- readiness_probe = _parse_readiness_probe(d.pop("readiness_probe", UNSET))
110
+ _readiness_probe = d.pop("readiness_probe", UNSET)
111
+ readiness_probe: Union[Unset, RuntimeReadinessProbe]
112
+ if isinstance(_readiness_probe, Unset):
113
+ readiness_probe = UNSET
114
+ else:
115
+ readiness_probe = RuntimeReadinessProbe.from_dict(_readiness_probe)
131
116
 
132
117
  _resources = d.pop("resources", UNSET)
133
118
  resources: Union[Unset, RuntimeResources]
@@ -0,0 +1,45 @@
1
+ from typing import Any, Type, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RuntimeReadinessProbe")
7
+
8
+
9
+ @_attrs_define
10
+ class RuntimeReadinessProbe:
11
+ """The readiness probe. Should be a Kubernetes Probe type"""
12
+
13
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> dict[str, Any]:
16
+ field_dict: dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ runtime_readiness_probe = cls()
27
+
28
+ runtime_readiness_probe.additional_properties = d
29
+ return runtime_readiness_probe
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties