beamlit 0.0.34rc71__py3-none-any.whl → 0.0.34rc73__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.
- beamlit/authentication/clientcredentials.py +5 -3
- beamlit/authentication/device_mode.py +4 -4
- beamlit/models/__init__.py +40 -2
- beamlit/models/agent.py +4 -13
- beamlit/models/core_event.py +9 -0
- beamlit/models/function.py +4 -13
- beamlit/models/histogram_bucket.py +79 -0
- beamlit/models/histogram_stats.py +88 -0
- beamlit/models/latency_metric.py +82 -3
- beamlit/models/metric.py +4 -4
- beamlit/models/metrics.py +56 -21
- beamlit/models/metrics_models.py +45 -0
- beamlit/models/metrics_request_total_per_code.py +45 -0
- beamlit/models/metrics_rps_per_code.py +45 -0
- beamlit/models/model.py +4 -13
- beamlit/models/request_duration_over_time_metric.py +97 -0
- beamlit/models/request_duration_over_time_metrics.py +74 -0
- beamlit/models/request_total_by_origin_metric.py +103 -0
- beamlit/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
- beamlit/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
- beamlit/models/request_total_metric.py +40 -13
- beamlit/models/request_total_metric_request_total_per_code.py +45 -0
- beamlit/models/request_total_metric_rps_per_code.py +45 -0
- beamlit/models/resource_environment_metrics.py +112 -12
- beamlit/models/resource_environment_metrics_request_total_per_code.py +45 -0
- beamlit/models/resource_environment_metrics_rps_per_code.py +45 -0
- beamlit/models/token_rate_metric.py +88 -0
- beamlit/models/token_rate_metrics.py +106 -0
- beamlit/models/token_total_metric.py +106 -0
- {beamlit-0.0.34rc71.dist-info → beamlit-0.0.34rc73.dist-info}/METADATA +1 -1
- {beamlit-0.0.34rc71.dist-info → beamlit-0.0.34rc73.dist-info}/RECORD +32 -15
- {beamlit-0.0.34rc71.dist-info → beamlit-0.0.34rc73.dist-info}/WHEEL +0 -0
@@ -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
|
@@ -1,10 +1,17 @@
|
|
1
|
-
from typing import Any, TypeVar, Union
|
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
|
5
5
|
|
6
6
|
from ..types import UNSET, Unset
|
7
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
|
+
|
8
15
|
T = TypeVar("T", bound="RequestTotalMetric")
|
9
16
|
|
10
17
|
|
@@ -13,26 +20,31 @@ class RequestTotalMetric:
|
|
13
20
|
"""Metrics for request total
|
14
21
|
|
15
22
|
Attributes:
|
16
|
-
request_total (Union[Unset,
|
17
|
-
request_total_per_code (Union[Unset,
|
18
|
-
|
19
|
-
|
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
|
20
28
|
"""
|
21
29
|
|
22
|
-
request_total: Union[Unset,
|
23
|
-
request_total_per_code: Union[Unset,
|
24
|
-
rps: Union[Unset,
|
25
|
-
rps_per_code: Union[Unset,
|
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
|
26
34
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
35
|
|
28
36
|
def to_dict(self) -> dict[str, Any]:
|
29
37
|
request_total = self.request_total
|
30
38
|
|
31
|
-
request_total_per_code =
|
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()
|
32
42
|
|
33
43
|
rps = self.rps
|
34
44
|
|
35
|
-
rps_per_code =
|
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()
|
36
48
|
|
37
49
|
field_dict: dict[str, Any] = {}
|
38
50
|
field_dict.update(self.additional_properties)
|
@@ -50,16 +62,31 @@ class RequestTotalMetric:
|
|
50
62
|
|
51
63
|
@classmethod
|
52
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
|
+
|
53
70
|
if not src_dict:
|
54
71
|
return None
|
55
72
|
d = src_dict.copy()
|
56
73
|
request_total = d.pop("requestTotal", UNSET)
|
57
74
|
|
58
|
-
|
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)
|
59
81
|
|
60
82
|
rps = d.pop("rps", UNSET)
|
61
83
|
|
62
|
-
|
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)
|
63
90
|
|
64
91
|
request_total_metric = cls(
|
65
92
|
request_total=request_total,
|
@@ -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
|
@@ -8,6 +8,16 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.latency_metric import LatencyMetric
|
10
10
|
from ..models.metric import Metric
|
11
|
+
from ..models.request_duration_over_time_metrics import RequestDurationOverTimeMetrics
|
12
|
+
from ..models.request_total_by_origin_metric import RequestTotalByOriginMetric
|
13
|
+
from ..models.resource_environment_metrics_request_total_per_code import (
|
14
|
+
ResourceEnvironmentMetricsRequestTotalPerCode,
|
15
|
+
)
|
16
|
+
from ..models.resource_environment_metrics_rps_per_code import (
|
17
|
+
ResourceEnvironmentMetricsRpsPerCode,
|
18
|
+
)
|
19
|
+
from ..models.token_rate_metrics import TokenRateMetrics
|
20
|
+
from ..models.token_total_metric import TokenTotalMetric
|
11
21
|
|
12
22
|
|
13
23
|
T = TypeVar("T", bound="ResourceEnvironmentMetrics")
|
@@ -21,19 +31,29 @@ class ResourceEnvironmentMetrics:
|
|
21
31
|
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
22
32
|
last_n_requests (Union[Unset, list['Metric']]): Array of metrics
|
23
33
|
latency (Union[Unset, LatencyMetric]): Latency metrics
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
request_duration_over_time (Union[Unset, RequestDurationOverTimeMetrics]): Request duration over time metrics
|
35
|
+
request_total (Union[Unset, float]): Number of requests for the resource globally
|
36
|
+
request_total_by_origin (Union[Unset, RequestTotalByOriginMetric]): Request total by origin metric
|
37
|
+
request_total_per_code (Union[Unset, ResourceEnvironmentMetricsRequestTotalPerCode]): Number of requests for the
|
38
|
+
resource globally per code
|
39
|
+
rps (Union[Unset, float]): Number of requests per second for the resource globally
|
40
|
+
rps_per_code (Union[Unset, ResourceEnvironmentMetricsRpsPerCode]): Number of requests per second for the
|
41
|
+
resource globally per code
|
42
|
+
token_rate (Union[Unset, TokenRateMetrics]): Token rate metrics
|
43
|
+
token_total (Union[Unset, TokenTotalMetric]): Token total metric
|
28
44
|
"""
|
29
45
|
|
30
46
|
inference_global: Union[Unset, list["Metric"]] = UNSET
|
31
47
|
last_n_requests: Union[Unset, list["Metric"]] = UNSET
|
32
48
|
latency: Union[Unset, "LatencyMetric"] = UNSET
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
49
|
+
request_duration_over_time: Union[Unset, "RequestDurationOverTimeMetrics"] = UNSET
|
50
|
+
request_total: Union[Unset, float] = UNSET
|
51
|
+
request_total_by_origin: Union[Unset, "RequestTotalByOriginMetric"] = UNSET
|
52
|
+
request_total_per_code: Union[Unset, "ResourceEnvironmentMetricsRequestTotalPerCode"] = UNSET
|
53
|
+
rps: Union[Unset, float] = UNSET
|
54
|
+
rps_per_code: Union[Unset, "ResourceEnvironmentMetricsRpsPerCode"] = UNSET
|
55
|
+
token_rate: Union[Unset, "TokenRateMetrics"] = UNSET
|
56
|
+
token_total: Union[Unset, "TokenTotalMetric"] = UNSET
|
37
57
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
38
58
|
|
39
59
|
def to_dict(self) -> dict[str, Any]:
|
@@ -55,13 +75,33 @@ class ResourceEnvironmentMetrics:
|
|
55
75
|
if self.latency and not isinstance(self.latency, Unset):
|
56
76
|
latency = self.latency.to_dict()
|
57
77
|
|
78
|
+
request_duration_over_time: Union[Unset, dict[str, Any]] = UNSET
|
79
|
+
if self.request_duration_over_time and not isinstance(self.request_duration_over_time, Unset):
|
80
|
+
request_duration_over_time = self.request_duration_over_time.to_dict()
|
81
|
+
|
58
82
|
request_total = self.request_total
|
59
83
|
|
60
|
-
|
84
|
+
request_total_by_origin: Union[Unset, dict[str, Any]] = UNSET
|
85
|
+
if self.request_total_by_origin and not isinstance(self.request_total_by_origin, Unset):
|
86
|
+
request_total_by_origin = self.request_total_by_origin.to_dict()
|
87
|
+
|
88
|
+
request_total_per_code: Union[Unset, dict[str, Any]] = UNSET
|
89
|
+
if self.request_total_per_code and not isinstance(self.request_total_per_code, Unset):
|
90
|
+
request_total_per_code = self.request_total_per_code.to_dict()
|
61
91
|
|
62
92
|
rps = self.rps
|
63
93
|
|
64
|
-
rps_per_code =
|
94
|
+
rps_per_code: Union[Unset, dict[str, Any]] = UNSET
|
95
|
+
if self.rps_per_code and not isinstance(self.rps_per_code, Unset):
|
96
|
+
rps_per_code = self.rps_per_code.to_dict()
|
97
|
+
|
98
|
+
token_rate: Union[Unset, dict[str, Any]] = UNSET
|
99
|
+
if self.token_rate and not isinstance(self.token_rate, Unset):
|
100
|
+
token_rate = self.token_rate.to_dict()
|
101
|
+
|
102
|
+
token_total: Union[Unset, dict[str, Any]] = UNSET
|
103
|
+
if self.token_total and not isinstance(self.token_total, Unset):
|
104
|
+
token_total = self.token_total.to_dict()
|
65
105
|
|
66
106
|
field_dict: dict[str, Any] = {}
|
67
107
|
field_dict.update(self.additional_properties)
|
@@ -72,14 +112,22 @@ class ResourceEnvironmentMetrics:
|
|
72
112
|
field_dict["lastNRequests"] = last_n_requests
|
73
113
|
if latency is not UNSET:
|
74
114
|
field_dict["latency"] = latency
|
115
|
+
if request_duration_over_time is not UNSET:
|
116
|
+
field_dict["requestDurationOverTime"] = request_duration_over_time
|
75
117
|
if request_total is not UNSET:
|
76
118
|
field_dict["requestTotal"] = request_total
|
119
|
+
if request_total_by_origin is not UNSET:
|
120
|
+
field_dict["requestTotalByOrigin"] = request_total_by_origin
|
77
121
|
if request_total_per_code is not UNSET:
|
78
122
|
field_dict["requestTotalPerCode"] = request_total_per_code
|
79
123
|
if rps is not UNSET:
|
80
124
|
field_dict["rps"] = rps
|
81
125
|
if rps_per_code is not UNSET:
|
82
126
|
field_dict["rpsPerCode"] = rps_per_code
|
127
|
+
if token_rate is not UNSET:
|
128
|
+
field_dict["tokenRate"] = token_rate
|
129
|
+
if token_total is not UNSET:
|
130
|
+
field_dict["tokenTotal"] = token_total
|
83
131
|
|
84
132
|
return field_dict
|
85
133
|
|
@@ -87,6 +135,16 @@ class ResourceEnvironmentMetrics:
|
|
87
135
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
88
136
|
from ..models.latency_metric import LatencyMetric
|
89
137
|
from ..models.metric import Metric
|
138
|
+
from ..models.request_duration_over_time_metrics import RequestDurationOverTimeMetrics
|
139
|
+
from ..models.request_total_by_origin_metric import RequestTotalByOriginMetric
|
140
|
+
from ..models.resource_environment_metrics_request_total_per_code import (
|
141
|
+
ResourceEnvironmentMetricsRequestTotalPerCode,
|
142
|
+
)
|
143
|
+
from ..models.resource_environment_metrics_rps_per_code import (
|
144
|
+
ResourceEnvironmentMetricsRpsPerCode,
|
145
|
+
)
|
146
|
+
from ..models.token_rate_metrics import TokenRateMetrics
|
147
|
+
from ..models.token_total_metric import TokenTotalMetric
|
90
148
|
|
91
149
|
if not src_dict:
|
92
150
|
return None
|
@@ -112,22 +170,64 @@ class ResourceEnvironmentMetrics:
|
|
112
170
|
else:
|
113
171
|
latency = LatencyMetric.from_dict(_latency)
|
114
172
|
|
173
|
+
_request_duration_over_time = d.pop("requestDurationOverTime", UNSET)
|
174
|
+
request_duration_over_time: Union[Unset, RequestDurationOverTimeMetrics]
|
175
|
+
if isinstance(_request_duration_over_time, Unset):
|
176
|
+
request_duration_over_time = UNSET
|
177
|
+
else:
|
178
|
+
request_duration_over_time = RequestDurationOverTimeMetrics.from_dict(_request_duration_over_time)
|
179
|
+
|
115
180
|
request_total = d.pop("requestTotal", UNSET)
|
116
181
|
|
117
|
-
|
182
|
+
_request_total_by_origin = d.pop("requestTotalByOrigin", UNSET)
|
183
|
+
request_total_by_origin: Union[Unset, RequestTotalByOriginMetric]
|
184
|
+
if isinstance(_request_total_by_origin, Unset):
|
185
|
+
request_total_by_origin = UNSET
|
186
|
+
else:
|
187
|
+
request_total_by_origin = RequestTotalByOriginMetric.from_dict(_request_total_by_origin)
|
188
|
+
|
189
|
+
_request_total_per_code = d.pop("requestTotalPerCode", UNSET)
|
190
|
+
request_total_per_code: Union[Unset, ResourceEnvironmentMetricsRequestTotalPerCode]
|
191
|
+
if isinstance(_request_total_per_code, Unset):
|
192
|
+
request_total_per_code = UNSET
|
193
|
+
else:
|
194
|
+
request_total_per_code = ResourceEnvironmentMetricsRequestTotalPerCode.from_dict(_request_total_per_code)
|
118
195
|
|
119
196
|
rps = d.pop("rps", UNSET)
|
120
197
|
|
121
|
-
|
198
|
+
_rps_per_code = d.pop("rpsPerCode", UNSET)
|
199
|
+
rps_per_code: Union[Unset, ResourceEnvironmentMetricsRpsPerCode]
|
200
|
+
if isinstance(_rps_per_code, Unset):
|
201
|
+
rps_per_code = UNSET
|
202
|
+
else:
|
203
|
+
rps_per_code = ResourceEnvironmentMetricsRpsPerCode.from_dict(_rps_per_code)
|
204
|
+
|
205
|
+
_token_rate = d.pop("tokenRate", UNSET)
|
206
|
+
token_rate: Union[Unset, TokenRateMetrics]
|
207
|
+
if isinstance(_token_rate, Unset):
|
208
|
+
token_rate = UNSET
|
209
|
+
else:
|
210
|
+
token_rate = TokenRateMetrics.from_dict(_token_rate)
|
211
|
+
|
212
|
+
_token_total = d.pop("tokenTotal", UNSET)
|
213
|
+
token_total: Union[Unset, TokenTotalMetric]
|
214
|
+
if isinstance(_token_total, Unset):
|
215
|
+
token_total = UNSET
|
216
|
+
else:
|
217
|
+
token_total = TokenTotalMetric.from_dict(_token_total)
|
122
218
|
|
123
219
|
resource_environment_metrics = cls(
|
124
220
|
inference_global=inference_global,
|
125
221
|
last_n_requests=last_n_requests,
|
126
222
|
latency=latency,
|
223
|
+
request_duration_over_time=request_duration_over_time,
|
127
224
|
request_total=request_total,
|
225
|
+
request_total_by_origin=request_total_by_origin,
|
128
226
|
request_total_per_code=request_total_per_code,
|
129
227
|
rps=rps,
|
130
228
|
rps_per_code=rps_per_code,
|
229
|
+
token_rate=token_rate,
|
230
|
+
token_total=token_total,
|
131
231
|
)
|
132
232
|
|
133
233
|
resource_environment_metrics.additional_properties = d
|
@@ -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="ResourceEnvironmentMetricsRequestTotalPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class ResourceEnvironmentMetricsRequestTotalPerCode:
|
11
|
+
"""Number of requests for the resource 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
|
+
resource_environment_metrics_request_total_per_code = cls()
|
27
|
+
|
28
|
+
resource_environment_metrics_request_total_per_code.additional_properties = d
|
29
|
+
return resource_environment_metrics_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="ResourceEnvironmentMetricsRpsPerCode")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class ResourceEnvironmentMetricsRpsPerCode:
|
11
|
+
"""Number of requests per second for the resource 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
|
+
resource_environment_metrics_rps_per_code = cls()
|
27
|
+
|
28
|
+
resource_environment_metrics_rps_per_code.additional_properties = d
|
29
|
+
return resource_environment_metrics_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
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from typing import 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
|
+
T = TypeVar("T", bound="TokenRateMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class TokenRateMetric:
|
13
|
+
"""Token rate metric
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
model (Union[Unset, str]): Model ID
|
17
|
+
timestamp (Union[Unset, str]): Timestamp
|
18
|
+
token_total (Union[Unset, float]): Total tokens
|
19
|
+
trend (Union[Unset, float]): Trend
|
20
|
+
"""
|
21
|
+
|
22
|
+
model: Union[Unset, str] = UNSET
|
23
|
+
timestamp: Union[Unset, str] = UNSET
|
24
|
+
token_total: Union[Unset, float] = UNSET
|
25
|
+
trend: Union[Unset, float] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
model = self.model
|
30
|
+
|
31
|
+
timestamp = self.timestamp
|
32
|
+
|
33
|
+
token_total = self.token_total
|
34
|
+
|
35
|
+
trend = self.trend
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update({})
|
40
|
+
if model is not UNSET:
|
41
|
+
field_dict["model"] = model
|
42
|
+
if timestamp is not UNSET:
|
43
|
+
field_dict["timestamp"] = timestamp
|
44
|
+
if token_total is not UNSET:
|
45
|
+
field_dict["tokenTotal"] = token_total
|
46
|
+
if trend is not UNSET:
|
47
|
+
field_dict["trend"] = trend
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
|
+
if not src_dict:
|
54
|
+
return None
|
55
|
+
d = src_dict.copy()
|
56
|
+
model = d.pop("model", UNSET)
|
57
|
+
|
58
|
+
timestamp = d.pop("timestamp", UNSET)
|
59
|
+
|
60
|
+
token_total = d.pop("tokenTotal", UNSET)
|
61
|
+
|
62
|
+
trend = d.pop("trend", UNSET)
|
63
|
+
|
64
|
+
token_rate_metric = cls(
|
65
|
+
model=model,
|
66
|
+
timestamp=timestamp,
|
67
|
+
token_total=token_total,
|
68
|
+
trend=trend,
|
69
|
+
)
|
70
|
+
|
71
|
+
token_rate_metric.additional_properties = d
|
72
|
+
return token_rate_metric
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|