beamlit 0.0.33rc49__py3-none-any.whl → 0.0.34__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. beamlit/agents/__init__.py +2 -1
  2. beamlit/agents/chat.py +16 -4
  3. beamlit/agents/decorator.py +68 -155
  4. beamlit/agents/thread.py +14 -0
  5. beamlit/api/workspaces/workspace_quotas_request.py +97 -0
  6. beamlit/authentication/clientcredentials.py +5 -3
  7. beamlit/authentication/device_mode.py +4 -4
  8. beamlit/common/__init__.py +1 -2
  9. beamlit/common/instrumentation.py +202 -34
  10. beamlit/common/settings.py +7 -64
  11. beamlit/deploy/deploy.py +64 -60
  12. beamlit/deploy/format.py +10 -0
  13. beamlit/functions/__init__.py +2 -2
  14. beamlit/functions/decorator.py +149 -1
  15. beamlit/functions/github/github.py +0 -1
  16. beamlit/models/__init__.py +51 -11
  17. beamlit/models/agent.py +27 -15
  18. beamlit/models/agent_metadata.py +1 -1
  19. beamlit/models/agent_render.py +45 -0
  20. beamlit/models/agent_spec.py +32 -5
  21. beamlit/models/core_event.py +88 -0
  22. beamlit/models/core_spec.py +14 -5
  23. beamlit/models/core_spec_configurations.py +1 -1
  24. beamlit/models/core_status.py +3 -20
  25. beamlit/models/environment.py +2 -2
  26. beamlit/models/environment_metadata.py +1 -1
  27. beamlit/models/function.py +27 -15
  28. beamlit/models/function_metadata.py +1 -1
  29. beamlit/models/function_render.py +45 -0
  30. beamlit/models/function_spec.py +14 -5
  31. beamlit/models/histogram_bucket.py +79 -0
  32. beamlit/models/histogram_stats.py +88 -0
  33. beamlit/models/increase_and_rate_metric.py +0 -9
  34. beamlit/models/integration_connection.py +2 -2
  35. beamlit/models/integration_connection_spec.py +11 -2
  36. beamlit/models/integration_repository.py +88 -0
  37. beamlit/models/last_n_requests_metric.py +88 -0
  38. beamlit/models/latency_metric.py +124 -0
  39. beamlit/models/metadata.py +1 -1
  40. beamlit/models/metric.py +18 -9
  41. beamlit/models/metrics.py +81 -46
  42. beamlit/models/metrics_models.py +45 -0
  43. beamlit/models/metrics_request_total_per_code.py +45 -0
  44. beamlit/models/metrics_rps_per_code.py +45 -0
  45. beamlit/models/model.py +27 -15
  46. beamlit/models/model_metadata.py +1 -1
  47. beamlit/models/model_provider.py +2 -2
  48. beamlit/models/model_render.py +45 -0
  49. beamlit/models/model_spec.py +14 -14
  50. beamlit/models/pending_invitation_accept.py +1 -1
  51. beamlit/models/pending_invitation_render.py +3 -3
  52. beamlit/models/policy.py +2 -2
  53. beamlit/models/provider_config.py +1 -1
  54. beamlit/models/repository.py +70 -0
  55. beamlit/models/repository_type_0.py +70 -0
  56. beamlit/models/request_duration_over_time_metric.py +97 -0
  57. beamlit/models/request_duration_over_time_metrics.py +74 -0
  58. beamlit/models/request_total_by_origin_metric.py +103 -0
  59. beamlit/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
  60. beamlit/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
  61. beamlit/models/request_total_metric.py +115 -0
  62. beamlit/models/request_total_metric_request_total_per_code.py +45 -0
  63. beamlit/models/request_total_metric_rps_per_code.py +45 -0
  64. beamlit/models/resource_deployment_metrics.py +6 -4
  65. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +1 -1
  66. beamlit/models/resource_environment_metrics.py +155 -75
  67. beamlit/models/resource_environment_metrics_request_total_per_code.py +45 -0
  68. beamlit/models/resource_environment_metrics_rps_per_code.py +45 -0
  69. beamlit/models/resource_metrics.py +1 -1
  70. beamlit/models/runtime.py +2 -2
  71. beamlit/models/store_agent.py +1 -1
  72. beamlit/models/store_function.py +1 -1
  73. beamlit/models/token_rate_metric.py +88 -0
  74. beamlit/models/token_rate_metrics.py +106 -0
  75. beamlit/models/token_total_metric.py +106 -0
  76. beamlit/models/workspace.py +17 -8
  77. beamlit/serve/app.py +9 -13
  78. {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/METADATA +21 -3
  79. {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/RECORD +80 -52
  80. beamlit/common/generate.py +0 -196
  81. {beamlit-0.0.33rc49.dist-info → beamlit-0.0.34.dist-info}/WHEEL +0 -0
@@ -0,0 +1,74 @@
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.request_duration_over_time_metric import RequestDurationOverTimeMetric
10
+
11
+
12
+ T = TypeVar("T", bound="RequestDurationOverTimeMetrics")
13
+
14
+
15
+ @_attrs_define
16
+ class RequestDurationOverTimeMetrics:
17
+ """Request duration over time metrics
18
+
19
+ Attributes:
20
+ request_duration_over_time (Union[Unset, RequestDurationOverTimeMetric]): Request duration over time metric
21
+ """
22
+
23
+ request_duration_over_time: Union[Unset, "RequestDurationOverTimeMetric"] = UNSET
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ request_duration_over_time: Union[Unset, dict[str, Any]] = UNSET
28
+ if self.request_duration_over_time and not isinstance(self.request_duration_over_time, Unset):
29
+ request_duration_over_time = self.request_duration_over_time.to_dict()
30
+
31
+ field_dict: dict[str, Any] = {}
32
+ field_dict.update(self.additional_properties)
33
+ field_dict.update({})
34
+ if request_duration_over_time is not UNSET:
35
+ field_dict["requestDurationOverTime"] = request_duration_over_time
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
+ from ..models.request_duration_over_time_metric import RequestDurationOverTimeMetric
42
+
43
+ if not src_dict:
44
+ return None
45
+ d = src_dict.copy()
46
+ _request_duration_over_time = d.pop("requestDurationOverTime", UNSET)
47
+ request_duration_over_time: Union[Unset, RequestDurationOverTimeMetric]
48
+ if isinstance(_request_duration_over_time, Unset):
49
+ request_duration_over_time = UNSET
50
+ else:
51
+ request_duration_over_time = RequestDurationOverTimeMetric.from_dict(_request_duration_over_time)
52
+
53
+ request_duration_over_time_metrics = cls(
54
+ request_duration_over_time=request_duration_over_time,
55
+ )
56
+
57
+ request_duration_over_time_metrics.additional_properties = d
58
+ return request_duration_over_time_metrics
59
+
60
+ @property
61
+ def additional_keys(self) -> list[str]:
62
+ return list(self.additional_properties.keys())
63
+
64
+ def __getitem__(self, key: str) -> Any:
65
+ return self.additional_properties[key]
66
+
67
+ def __setitem__(self, key: str, value: Any) -> None:
68
+ self.additional_properties[key] = value
69
+
70
+ def __delitem__(self, key: str) -> None:
71
+ del self.additional_properties[key]
72
+
73
+ def __contains__(self, key: str) -> bool:
74
+ return key in self.additional_properties
@@ -0,0 +1,103 @@
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.request_total_by_origin_metric_request_total_by_origin import (
10
+ RequestTotalByOriginMetricRequestTotalByOrigin,
11
+ )
12
+ from ..models.request_total_by_origin_metric_request_total_by_origin_and_code import (
13
+ RequestTotalByOriginMetricRequestTotalByOriginAndCode,
14
+ )
15
+
16
+
17
+ T = TypeVar("T", bound="RequestTotalByOriginMetric")
18
+
19
+
20
+ @_attrs_define
21
+ class RequestTotalByOriginMetric:
22
+ """Request total by origin metric
23
+
24
+ Attributes:
25
+ request_total_by_origin (Union[Unset, RequestTotalByOriginMetricRequestTotalByOrigin]): Request total by origin
26
+ request_total_by_origin_and_code (Union[Unset, RequestTotalByOriginMetricRequestTotalByOriginAndCode]): Request
27
+ total by origin and code
28
+ """
29
+
30
+ request_total_by_origin: Union[Unset, "RequestTotalByOriginMetricRequestTotalByOrigin"] = UNSET
31
+ request_total_by_origin_and_code: Union[Unset, "RequestTotalByOriginMetricRequestTotalByOriginAndCode"] = UNSET
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ request_total_by_origin: Union[Unset, dict[str, Any]] = UNSET
36
+ if self.request_total_by_origin and not isinstance(self.request_total_by_origin, Unset):
37
+ request_total_by_origin = self.request_total_by_origin.to_dict()
38
+
39
+ request_total_by_origin_and_code: Union[Unset, dict[str, Any]] = UNSET
40
+ if self.request_total_by_origin_and_code and not isinstance(self.request_total_by_origin_and_code, Unset):
41
+ request_total_by_origin_and_code = self.request_total_by_origin_and_code.to_dict()
42
+
43
+ field_dict: dict[str, Any] = {}
44
+ field_dict.update(self.additional_properties)
45
+ field_dict.update({})
46
+ if request_total_by_origin is not UNSET:
47
+ field_dict["requestTotalByOrigin"] = request_total_by_origin
48
+ if request_total_by_origin_and_code is not UNSET:
49
+ field_dict["requestTotalByOriginAndCode"] = request_total_by_origin_and_code
50
+
51
+ return field_dict
52
+
53
+ @classmethod
54
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
55
+ from ..models.request_total_by_origin_metric_request_total_by_origin import (
56
+ RequestTotalByOriginMetricRequestTotalByOrigin,
57
+ )
58
+ from ..models.request_total_by_origin_metric_request_total_by_origin_and_code import (
59
+ RequestTotalByOriginMetricRequestTotalByOriginAndCode,
60
+ )
61
+
62
+ if not src_dict:
63
+ return None
64
+ d = src_dict.copy()
65
+ _request_total_by_origin = d.pop("requestTotalByOrigin", UNSET)
66
+ request_total_by_origin: Union[Unset, RequestTotalByOriginMetricRequestTotalByOrigin]
67
+ if isinstance(_request_total_by_origin, Unset):
68
+ request_total_by_origin = UNSET
69
+ else:
70
+ request_total_by_origin = RequestTotalByOriginMetricRequestTotalByOrigin.from_dict(_request_total_by_origin)
71
+
72
+ _request_total_by_origin_and_code = d.pop("requestTotalByOriginAndCode", UNSET)
73
+ request_total_by_origin_and_code: Union[Unset, RequestTotalByOriginMetricRequestTotalByOriginAndCode]
74
+ if isinstance(_request_total_by_origin_and_code, Unset):
75
+ request_total_by_origin_and_code = UNSET
76
+ else:
77
+ request_total_by_origin_and_code = RequestTotalByOriginMetricRequestTotalByOriginAndCode.from_dict(
78
+ _request_total_by_origin_and_code
79
+ )
80
+
81
+ request_total_by_origin_metric = cls(
82
+ request_total_by_origin=request_total_by_origin,
83
+ request_total_by_origin_and_code=request_total_by_origin_and_code,
84
+ )
85
+
86
+ request_total_by_origin_metric.additional_properties = d
87
+ return request_total_by_origin_metric
88
+
89
+ @property
90
+ def additional_keys(self) -> list[str]:
91
+ return list(self.additional_properties.keys())
92
+
93
+ def __getitem__(self, key: str) -> Any:
94
+ return self.additional_properties[key]
95
+
96
+ def __setitem__(self, key: str, value: Any) -> None:
97
+ self.additional_properties[key] = value
98
+
99
+ def __delitem__(self, key: str) -> None:
100
+ del self.additional_properties[key]
101
+
102
+ def __contains__(self, key: str) -> bool:
103
+ return key in self.additional_properties
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RequestTotalByOriginMetricRequestTotalByOrigin")
7
+
8
+
9
+ @_attrs_define
10
+ class RequestTotalByOriginMetricRequestTotalByOrigin:
11
+ """Request total by origin"""
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
+ request_total_by_origin_metric_request_total_by_origin = cls()
27
+
28
+ request_total_by_origin_metric_request_total_by_origin.additional_properties = d
29
+ return request_total_by_origin_metric_request_total_by_origin
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
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RequestTotalByOriginMetricRequestTotalByOriginAndCode")
7
+
8
+
9
+ @_attrs_define
10
+ class RequestTotalByOriginMetricRequestTotalByOriginAndCode:
11
+ """Request total by origin and code"""
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
+ request_total_by_origin_metric_request_total_by_origin_and_code = cls()
27
+
28
+ request_total_by_origin_metric_request_total_by_origin_and_code.additional_properties = d
29
+ return request_total_by_origin_metric_request_total_by_origin_and_code
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
@@ -0,0 +1,115 @@
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.request_total_metric_request_total_per_code import (
10
+ RequestTotalMetricRequestTotalPerCode,
11
+ )
12
+ from ..models.request_total_metric_rps_per_code import RequestTotalMetricRpsPerCode
13
+
14
+
15
+ T = TypeVar("T", bound="RequestTotalMetric")
16
+
17
+
18
+ @_attrs_define
19
+ class RequestTotalMetric:
20
+ """Metrics for request total
21
+
22
+ Attributes:
23
+ request_total (Union[Unset, float]): Number of requests for all resources globally
24
+ request_total_per_code (Union[Unset, RequestTotalMetricRequestTotalPerCode]): Number of requests for all
25
+ resources globally per code
26
+ rps (Union[Unset, float]): Number of requests per second for all resources globally
27
+ rps_per_code (Union[Unset, RequestTotalMetricRpsPerCode]): Number of requests for all resources globally
28
+ """
29
+
30
+ request_total: Union[Unset, float] = UNSET
31
+ request_total_per_code: Union[Unset, "RequestTotalMetricRequestTotalPerCode"] = UNSET
32
+ rps: Union[Unset, float] = UNSET
33
+ rps_per_code: Union[Unset, "RequestTotalMetricRpsPerCode"] = UNSET
34
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
35
+
36
+ def to_dict(self) -> dict[str, Any]:
37
+ request_total = self.request_total
38
+
39
+ request_total_per_code: Union[Unset, dict[str, Any]] = UNSET
40
+ if self.request_total_per_code and not isinstance(self.request_total_per_code, Unset):
41
+ request_total_per_code = self.request_total_per_code.to_dict()
42
+
43
+ rps = self.rps
44
+
45
+ rps_per_code: Union[Unset, dict[str, Any]] = UNSET
46
+ if self.rps_per_code and not isinstance(self.rps_per_code, Unset):
47
+ rps_per_code = self.rps_per_code.to_dict()
48
+
49
+ field_dict: dict[str, Any] = {}
50
+ field_dict.update(self.additional_properties)
51
+ field_dict.update({})
52
+ if request_total is not UNSET:
53
+ field_dict["requestTotal"] = request_total
54
+ if request_total_per_code is not UNSET:
55
+ field_dict["requestTotalPerCode"] = request_total_per_code
56
+ if rps is not UNSET:
57
+ field_dict["rps"] = rps
58
+ if rps_per_code is not UNSET:
59
+ field_dict["rpsPerCode"] = rps_per_code
60
+
61
+ return field_dict
62
+
63
+ @classmethod
64
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
65
+ from ..models.request_total_metric_request_total_per_code import (
66
+ RequestTotalMetricRequestTotalPerCode,
67
+ )
68
+ from ..models.request_total_metric_rps_per_code import RequestTotalMetricRpsPerCode
69
+
70
+ if not src_dict:
71
+ return None
72
+ d = src_dict.copy()
73
+ request_total = d.pop("requestTotal", UNSET)
74
+
75
+ _request_total_per_code = d.pop("requestTotalPerCode", UNSET)
76
+ request_total_per_code: Union[Unset, RequestTotalMetricRequestTotalPerCode]
77
+ if isinstance(_request_total_per_code, Unset):
78
+ request_total_per_code = UNSET
79
+ else:
80
+ request_total_per_code = RequestTotalMetricRequestTotalPerCode.from_dict(_request_total_per_code)
81
+
82
+ rps = d.pop("rps", UNSET)
83
+
84
+ _rps_per_code = d.pop("rpsPerCode", UNSET)
85
+ rps_per_code: Union[Unset, RequestTotalMetricRpsPerCode]
86
+ if isinstance(_rps_per_code, Unset):
87
+ rps_per_code = UNSET
88
+ else:
89
+ rps_per_code = RequestTotalMetricRpsPerCode.from_dict(_rps_per_code)
90
+
91
+ request_total_metric = cls(
92
+ request_total=request_total,
93
+ request_total_per_code=request_total_per_code,
94
+ rps=rps,
95
+ rps_per_code=rps_per_code,
96
+ )
97
+
98
+ request_total_metric.additional_properties = d
99
+ return request_total_metric
100
+
101
+ @property
102
+ def additional_keys(self) -> list[str]:
103
+ return list(self.additional_properties.keys())
104
+
105
+ def __getitem__(self, key: str) -> Any:
106
+ return self.additional_properties[key]
107
+
108
+ def __setitem__(self, key: str, value: Any) -> None:
109
+ self.additional_properties[key] = value
110
+
111
+ def __delitem__(self, key: str) -> None:
112
+ del self.additional_properties[key]
113
+
114
+ def __contains__(self, key: str) -> bool:
115
+ return key in self.additional_properties
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RequestTotalMetricRequestTotalPerCode")
7
+
8
+
9
+ @_attrs_define
10
+ class RequestTotalMetricRequestTotalPerCode:
11
+ """Number of requests for all resources globally per code"""
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
+ request_total_metric_request_total_per_code = cls()
27
+
28
+ request_total_metric_request_total_per_code.additional_properties = d
29
+ return request_total_metric_request_total_per_code
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
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RequestTotalMetricRpsPerCode")
7
+
8
+
9
+ @_attrs_define
10
+ class RequestTotalMetricRpsPerCode:
11
+ """Number of requests for all resources globally"""
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
+ request_total_metric_rps_per_code = cls()
27
+
28
+ request_total_metric_rps_per_code.additional_properties = d
29
+ return request_total_metric_rps_per_code
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
@@ -55,21 +55,23 @@ class ResourceDeploymentMetrics:
55
55
  inference_per_second_global.append(componentsschemas_array_metric_item)
56
56
 
57
57
  inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
58
- if not isinstance(self.inference_per_second_per_region, Unset):
58
+ if self.inference_per_second_per_region and not isinstance(self.inference_per_second_per_region, Unset):
59
59
  inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
60
60
 
61
61
  query_per_second_global = self.query_per_second_global
62
62
 
63
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):
64
+ if self.query_per_second_per_code_global and not isinstance(self.query_per_second_per_code_global, Unset):
65
65
  query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
66
66
 
67
67
  query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
68
- if not isinstance(self.query_per_second_per_region, Unset):
68
+ if self.query_per_second_per_region and not isinstance(self.query_per_second_per_region, Unset):
69
69
  query_per_second_per_region = self.query_per_second_per_region.to_dict()
70
70
 
71
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):
72
+ if self.query_per_second_per_region_per_code and not isinstance(
73
+ self.query_per_second_per_region_per_code, Unset
74
+ ):
73
75
  query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
74
76
 
75
77
  field_dict: dict[str, Any] = {}
@@ -26,7 +26,7 @@ class ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode:
26
26
 
27
27
  def to_dict(self) -> dict[str, Any]:
28
28
  region: Union[Unset, dict[str, Any]] = UNSET
29
- if not isinstance(self.region, Unset):
29
+ if self.region and not isinstance(self.region, Unset):
30
30
  region = self.region.to_dict()
31
31
 
32
32
  field_dict: dict[str, Any] = {}