beamlit 0.0.33rc50__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 (79) 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/instrumentation.py +202 -34
  9. beamlit/common/settings.py +3 -1
  10. beamlit/deploy/deploy.py +64 -60
  11. beamlit/deploy/format.py +10 -0
  12. beamlit/functions/__init__.py +2 -2
  13. beamlit/functions/decorator.py +149 -1
  14. beamlit/functions/github/github.py +0 -1
  15. beamlit/models/__init__.py +51 -11
  16. beamlit/models/agent.py +27 -15
  17. beamlit/models/agent_metadata.py +1 -1
  18. beamlit/models/agent_render.py +45 -0
  19. beamlit/models/agent_spec.py +32 -5
  20. beamlit/models/core_event.py +88 -0
  21. beamlit/models/core_spec.py +14 -5
  22. beamlit/models/core_spec_configurations.py +1 -1
  23. beamlit/models/core_status.py +3 -20
  24. beamlit/models/environment.py +2 -2
  25. beamlit/models/environment_metadata.py +1 -1
  26. beamlit/models/function.py +27 -15
  27. beamlit/models/function_metadata.py +1 -1
  28. beamlit/models/function_render.py +45 -0
  29. beamlit/models/function_spec.py +14 -5
  30. beamlit/models/histogram_bucket.py +79 -0
  31. beamlit/models/histogram_stats.py +88 -0
  32. beamlit/models/increase_and_rate_metric.py +0 -9
  33. beamlit/models/integration_connection.py +2 -2
  34. beamlit/models/integration_connection_spec.py +11 -2
  35. beamlit/models/integration_repository.py +88 -0
  36. beamlit/models/last_n_requests_metric.py +88 -0
  37. beamlit/models/latency_metric.py +124 -0
  38. beamlit/models/metadata.py +1 -1
  39. beamlit/models/metric.py +18 -9
  40. beamlit/models/metrics.py +81 -46
  41. beamlit/models/metrics_models.py +45 -0
  42. beamlit/models/metrics_request_total_per_code.py +45 -0
  43. beamlit/models/metrics_rps_per_code.py +45 -0
  44. beamlit/models/model.py +27 -15
  45. beamlit/models/model_metadata.py +1 -1
  46. beamlit/models/model_provider.py +2 -2
  47. beamlit/models/model_render.py +45 -0
  48. beamlit/models/model_spec.py +14 -14
  49. beamlit/models/pending_invitation_accept.py +1 -1
  50. beamlit/models/pending_invitation_render.py +3 -3
  51. beamlit/models/policy.py +2 -2
  52. beamlit/models/provider_config.py +1 -1
  53. beamlit/models/repository.py +70 -0
  54. beamlit/models/repository_type_0.py +70 -0
  55. beamlit/models/request_duration_over_time_metric.py +97 -0
  56. beamlit/models/request_duration_over_time_metrics.py +74 -0
  57. beamlit/models/request_total_by_origin_metric.py +103 -0
  58. beamlit/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
  59. beamlit/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
  60. beamlit/models/request_total_metric.py +115 -0
  61. beamlit/models/request_total_metric_request_total_per_code.py +45 -0
  62. beamlit/models/request_total_metric_rps_per_code.py +45 -0
  63. beamlit/models/resource_deployment_metrics.py +6 -4
  64. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +1 -1
  65. beamlit/models/resource_environment_metrics.py +155 -75
  66. beamlit/models/resource_environment_metrics_request_total_per_code.py +45 -0
  67. beamlit/models/resource_environment_metrics_rps_per_code.py +45 -0
  68. beamlit/models/resource_metrics.py +1 -1
  69. beamlit/models/runtime.py +2 -2
  70. beamlit/models/store_agent.py +1 -1
  71. beamlit/models/store_function.py +1 -1
  72. beamlit/models/token_rate_metric.py +88 -0
  73. beamlit/models/token_rate_metrics.py +106 -0
  74. beamlit/models/token_total_metric.py +106 -0
  75. beamlit/models/workspace.py +17 -8
  76. beamlit/serve/app.py +9 -13
  77. {beamlit-0.0.33rc50.dist-info → beamlit-0.0.34.dist-info}/METADATA +21 -3
  78. {beamlit-0.0.33rc50.dist-info → beamlit-0.0.34.dist-info}/RECORD +79 -50
  79. {beamlit-0.0.33rc50.dist-info → beamlit-0.0.34.dist-info}/WHEEL +0 -0
@@ -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="CoreEvent")
9
+
10
+
11
+ @_attrs_define
12
+ class CoreEvent:
13
+ """Core event
14
+
15
+ Attributes:
16
+ message (Union[Unset, str]): Event message
17
+ status (Union[Unset, str]): Event status
18
+ time (Union[Unset, str]): Event time
19
+ type_ (Union[Unset, str]): Event type
20
+ """
21
+
22
+ message: Union[Unset, str] = UNSET
23
+ status: Union[Unset, str] = UNSET
24
+ time: Union[Unset, str] = UNSET
25
+ type_: Union[Unset, str] = UNSET
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ message = self.message
30
+
31
+ status = self.status
32
+
33
+ time = self.time
34
+
35
+ type_ = self.type_
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update({})
40
+ if message is not UNSET:
41
+ field_dict["message"] = message
42
+ if status is not UNSET:
43
+ field_dict["status"] = status
44
+ if time is not UNSET:
45
+ field_dict["time"] = time
46
+ if type_ is not UNSET:
47
+ field_dict["type"] = type_
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
+ message = d.pop("message", UNSET)
57
+
58
+ status = d.pop("status", UNSET)
59
+
60
+ time = d.pop("time", UNSET)
61
+
62
+ type_ = d.pop("type", UNSET)
63
+
64
+ core_event = cls(
65
+ message=message,
66
+ status=status,
67
+ time=time,
68
+ type_=type_,
69
+ )
70
+
71
+ core_event.additional_properties = d
72
+ return core_event
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
@@ -30,6 +30,7 @@ class CoreSpec:
30
30
  policies (Union[Unset, list[str]]):
31
31
  private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
32
32
  runtime (Union[Unset, Runtime]): Set of configurations for a deployment
33
+ sandbox (Union[Unset, bool]): Sandbox mode
33
34
  serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
34
35
  """
35
36
 
@@ -41,12 +42,13 @@ class CoreSpec:
41
42
  policies: Union[Unset, list[str]] = UNSET
42
43
  private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
43
44
  runtime: Union[Unset, "Runtime"] = UNSET
45
+ sandbox: Union[Unset, bool] = UNSET
44
46
  serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
45
47
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
48
 
47
49
  def to_dict(self) -> dict[str, Any]:
48
50
  configurations: Union[Unset, dict[str, Any]] = UNSET
49
- if not isinstance(self.configurations, Unset):
51
+ if self.configurations and not isinstance(self.configurations, Unset):
50
52
  configurations = self.configurations.to_dict()
51
53
 
52
54
  enabled = self.enabled
@@ -63,7 +65,7 @@ class CoreSpec:
63
65
  integration_connections = self.integration_connections
64
66
 
65
67
  pod_template: Union[Unset, dict[str, Any]] = UNSET
66
- if not isinstance(self.pod_template, Unset):
68
+ if self.pod_template and not isinstance(self.pod_template, Unset):
67
69
  pod_template = self.pod_template.to_dict()
68
70
 
69
71
  policies: Union[Unset, list[str]] = UNSET
@@ -71,15 +73,17 @@ class CoreSpec:
71
73
  policies = self.policies
72
74
 
73
75
  private_clusters: Union[Unset, dict[str, Any]] = UNSET
74
- if not isinstance(self.private_clusters, Unset):
76
+ if self.private_clusters and not isinstance(self.private_clusters, Unset):
75
77
  private_clusters = self.private_clusters.to_dict()
76
78
 
77
79
  runtime: Union[Unset, dict[str, Any]] = UNSET
78
- if not isinstance(self.runtime, Unset):
80
+ if self.runtime and not isinstance(self.runtime, Unset):
79
81
  runtime = self.runtime.to_dict()
80
82
 
83
+ sandbox = self.sandbox
84
+
81
85
  serverless_config: Union[Unset, dict[str, Any]] = UNSET
82
- if not isinstance(self.serverless_config, Unset):
86
+ if self.serverless_config and not isinstance(self.serverless_config, Unset):
83
87
  serverless_config = self.serverless_config.to_dict()
84
88
 
85
89
  field_dict: dict[str, Any] = {}
@@ -101,6 +105,8 @@ class CoreSpec:
101
105
  field_dict["privateClusters"] = private_clusters
102
106
  if runtime is not UNSET:
103
107
  field_dict["runtime"] = runtime
108
+ if sandbox is not UNSET:
109
+ field_dict["sandbox"] = sandbox
104
110
  if serverless_config is not UNSET:
105
111
  field_dict["serverlessConfig"] = serverless_config
106
112
 
@@ -159,6 +165,8 @@ class CoreSpec:
159
165
  else:
160
166
  runtime = Runtime.from_dict(_runtime)
161
167
 
168
+ sandbox = d.pop("sandbox", UNSET)
169
+
162
170
  _serverless_config = d.pop("serverlessConfig", UNSET)
163
171
  serverless_config: Union[Unset, ServerlessConfig]
164
172
  if isinstance(_serverless_config, Unset):
@@ -175,6 +183,7 @@ class CoreSpec:
175
183
  policies=policies,
176
184
  private_clusters=private_clusters,
177
185
  runtime=runtime,
186
+ sandbox=sandbox,
178
187
  serverless_config=serverless_config,
179
188
  )
180
189
 
@@ -26,7 +26,7 @@ class CoreSpecConfigurations:
26
26
 
27
27
  def to_dict(self) -> dict[str, Any]:
28
28
  key: Union[Unset, dict[str, Any]] = UNSET
29
- if not isinstance(self.key, Unset):
29
+ if self.key and not isinstance(self.key, Unset):
30
30
  key = self.key.to_dict()
31
31
 
32
32
  field_dict: dict[str, Any] = {}
@@ -1,33 +1,20 @@
1
- from typing import Any, TypeVar, Union
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
- from ..types import UNSET, Unset
7
-
8
6
  T = TypeVar("T", bound="CoreStatus")
9
7
 
10
8
 
11
9
  @_attrs_define
12
10
  class CoreStatus:
13
- """Core status
14
-
15
- Attributes:
16
- deployment_status (Union[Unset, str]): The status of the core, can be CREATED, UPDATED, DELETED, DEPLOYED,
17
- DISABLED, or FAILED
18
- """
11
+ """Core status"""
19
12
 
20
- deployment_status: Union[Unset, str] = UNSET
21
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
14
 
23
15
  def to_dict(self) -> dict[str, Any]:
24
- deployment_status = self.deployment_status
25
-
26
16
  field_dict: dict[str, Any] = {}
27
17
  field_dict.update(self.additional_properties)
28
- field_dict.update({})
29
- if deployment_status is not UNSET:
30
- field_dict["deploymentStatus"] = deployment_status
31
18
 
32
19
  return field_dict
33
20
 
@@ -36,11 +23,7 @@ class CoreStatus:
36
23
  if not src_dict:
37
24
  return None
38
25
  d = src_dict.copy()
39
- deployment_status = d.pop("deploymentStatus", UNSET)
40
-
41
- core_status = cls(
42
- deployment_status=deployment_status,
43
- )
26
+ core_status = cls()
44
27
 
45
28
  core_status.additional_properties = d
46
29
  return core_status
@@ -28,11 +28,11 @@ class Environment:
28
28
 
29
29
  def to_dict(self) -> dict[str, Any]:
30
30
  metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if not isinstance(self.metadata, Unset):
31
+ if self.metadata and not isinstance(self.metadata, Unset):
32
32
  metadata = self.metadata.to_dict()
33
33
 
34
34
  spec: Union[Unset, dict[str, Any]] = UNSET
35
- if not isinstance(self.spec, Unset):
35
+ if self.spec and not isinstance(self.spec, Unset):
36
36
  spec = self.spec.to_dict()
37
37
 
38
38
  field_dict: dict[str, Any] = {}
@@ -51,7 +51,7 @@ class EnvironmentMetadata:
51
51
  display_name = self.display_name
52
52
 
53
53
  labels: Union[Unset, dict[str, Any]] = UNSET
54
- if not isinstance(self.labels, Unset):
54
+ if self.labels and not isinstance(self.labels, Unset):
55
55
  labels = self.labels.to_dict()
56
56
 
57
57
  name = self.name
@@ -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.core_status import CoreStatus
9
+ from ..models.core_event import CoreEvent
10
10
  from ..models.environment_metadata import EnvironmentMetadata
11
11
  from ..models.function_spec import FunctionSpec
12
12
 
@@ -19,32 +19,41 @@ class Function:
19
19
  """Function
20
20
 
21
21
  Attributes:
22
+ events (Union[Unset, list['CoreEvent']]): Core events
22
23
  metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
23
24
  spec (Union[Unset, FunctionSpec]): Function specification
24
- status (Union[Unset, CoreStatus]): Core status
25
+ status (Union[Unset, str]): Function status
25
26
  """
26
27
 
28
+ events: Union[Unset, list["CoreEvent"]] = UNSET
27
29
  metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
28
30
  spec: Union[Unset, "FunctionSpec"] = UNSET
29
- status: Union[Unset, "CoreStatus"] = UNSET
31
+ status: Union[Unset, str] = UNSET
30
32
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
33
 
32
34
  def to_dict(self) -> dict[str, Any]:
35
+ events: Union[Unset, list[dict[str, Any]]] = UNSET
36
+ if not isinstance(self.events, Unset):
37
+ events = []
38
+ for componentsschemas_core_events_item_data in self.events:
39
+ componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
40
+ events.append(componentsschemas_core_events_item)
41
+
33
42
  metadata: Union[Unset, dict[str, Any]] = UNSET
34
- if not isinstance(self.metadata, Unset):
43
+ if self.metadata and not isinstance(self.metadata, Unset):
35
44
  metadata = self.metadata.to_dict()
36
45
 
37
46
  spec: Union[Unset, dict[str, Any]] = UNSET
38
- if not isinstance(self.spec, Unset):
47
+ if self.spec and not isinstance(self.spec, Unset):
39
48
  spec = self.spec.to_dict()
40
49
 
41
- status: Union[Unset, dict[str, Any]] = UNSET
42
- if not isinstance(self.status, Unset):
43
- status = self.status.to_dict()
50
+ status = self.status
44
51
 
45
52
  field_dict: dict[str, Any] = {}
46
53
  field_dict.update(self.additional_properties)
47
54
  field_dict.update({})
55
+ if events is not UNSET:
56
+ field_dict["events"] = events
48
57
  if metadata is not UNSET:
49
58
  field_dict["metadata"] = metadata
50
59
  if spec is not UNSET:
@@ -56,13 +65,20 @@ class Function:
56
65
 
57
66
  @classmethod
58
67
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
59
- from ..models.core_status import CoreStatus
68
+ from ..models.core_event import CoreEvent
60
69
  from ..models.environment_metadata import EnvironmentMetadata
61
70
  from ..models.function_spec import FunctionSpec
62
71
 
63
72
  if not src_dict:
64
73
  return None
65
74
  d = src_dict.copy()
75
+ events = []
76
+ _events = d.pop("events", UNSET)
77
+ for componentsschemas_core_events_item_data in _events or []:
78
+ componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
79
+
80
+ events.append(componentsschemas_core_events_item)
81
+
66
82
  _metadata = d.pop("metadata", UNSET)
67
83
  metadata: Union[Unset, EnvironmentMetadata]
68
84
  if isinstance(_metadata, Unset):
@@ -77,14 +93,10 @@ class Function:
77
93
  else:
78
94
  spec = FunctionSpec.from_dict(_spec)
79
95
 
80
- _status = d.pop("status", UNSET)
81
- status: Union[Unset, CoreStatus]
82
- if isinstance(_status, Unset):
83
- status = UNSET
84
- else:
85
- status = CoreStatus.from_dict(_status)
96
+ status = d.pop("status", UNSET)
86
97
 
87
98
  function = cls(
99
+ events=events,
88
100
  metadata=metadata,
89
101
  spec=spec,
90
102
  status=status,
@@ -51,7 +51,7 @@ class FunctionMetadata:
51
51
  display_name = self.display_name
52
52
 
53
53
  labels: Union[Unset, dict[str, Any]] = UNSET
54
- if not isinstance(self.labels, Unset):
54
+ if self.labels and not isinstance(self.labels, Unset):
55
55
  labels = self.labels.to_dict()
56
56
 
57
57
  name = self.name
@@ -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="FunctionRender")
7
+
8
+
9
+ @_attrs_define
10
+ class FunctionRender:
11
+ """FunctionRender"""
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
+ function_render = cls()
27
+
28
+ function_render.additional_properties = d
29
+ return function_render
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
@@ -32,6 +32,7 @@ class FunctionSpec:
32
32
  policies (Union[Unset, list[str]]):
33
33
  private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
34
34
  runtime (Union[Unset, Runtime]): Set of configurations for a deployment
35
+ sandbox (Union[Unset, bool]): Sandbox mode
35
36
  serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
36
37
  description (Union[Unset, str]): Function description, very important for the agent function to work with an LLM
37
38
  kit (Union[Unset, list['FunctionKit']]): The kit of the function deployment
@@ -48,6 +49,7 @@ class FunctionSpec:
48
49
  policies: Union[Unset, list[str]] = UNSET
49
50
  private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
50
51
  runtime: Union[Unset, "Runtime"] = UNSET
52
+ sandbox: Union[Unset, bool] = UNSET
51
53
  serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
52
54
  description: Union[Unset, str] = UNSET
53
55
  kit: Union[Unset, list["FunctionKit"]] = UNSET
@@ -57,7 +59,7 @@ class FunctionSpec:
57
59
 
58
60
  def to_dict(self) -> dict[str, Any]:
59
61
  configurations: Union[Unset, dict[str, Any]] = UNSET
60
- if not isinstance(self.configurations, Unset):
62
+ if self.configurations and not isinstance(self.configurations, Unset):
61
63
  configurations = self.configurations.to_dict()
62
64
 
63
65
  enabled = self.enabled
@@ -74,7 +76,7 @@ class FunctionSpec:
74
76
  integration_connections = self.integration_connections
75
77
 
76
78
  pod_template: Union[Unset, dict[str, Any]] = UNSET
77
- if not isinstance(self.pod_template, Unset):
79
+ if self.pod_template and not isinstance(self.pod_template, Unset):
78
80
  pod_template = self.pod_template.to_dict()
79
81
 
80
82
  policies: Union[Unset, list[str]] = UNSET
@@ -82,15 +84,17 @@ class FunctionSpec:
82
84
  policies = self.policies
83
85
 
84
86
  private_clusters: Union[Unset, dict[str, Any]] = UNSET
85
- if not isinstance(self.private_clusters, Unset):
87
+ if self.private_clusters and not isinstance(self.private_clusters, Unset):
86
88
  private_clusters = self.private_clusters.to_dict()
87
89
 
88
90
  runtime: Union[Unset, dict[str, Any]] = UNSET
89
- if not isinstance(self.runtime, Unset):
91
+ if self.runtime and not isinstance(self.runtime, Unset):
90
92
  runtime = self.runtime.to_dict()
91
93
 
94
+ sandbox = self.sandbox
95
+
92
96
  serverless_config: Union[Unset, dict[str, Any]] = UNSET
93
- if not isinstance(self.serverless_config, Unset):
97
+ if self.serverless_config and not isinstance(self.serverless_config, Unset):
94
98
  serverless_config = self.serverless_config.to_dict()
95
99
 
96
100
  description = self.description
@@ -130,6 +134,8 @@ class FunctionSpec:
130
134
  field_dict["privateClusters"] = private_clusters
131
135
  if runtime is not UNSET:
132
136
  field_dict["runtime"] = runtime
137
+ if sandbox is not UNSET:
138
+ field_dict["sandbox"] = sandbox
133
139
  if serverless_config is not UNSET:
134
140
  field_dict["serverlessConfig"] = serverless_config
135
141
  if description is not UNSET:
@@ -198,6 +204,8 @@ class FunctionSpec:
198
204
  else:
199
205
  runtime = Runtime.from_dict(_runtime)
200
206
 
207
+ sandbox = d.pop("sandbox", UNSET)
208
+
201
209
  _serverless_config = d.pop("serverlessConfig", UNSET)
202
210
  serverless_config: Union[Unset, ServerlessConfig]
203
211
  if isinstance(_serverless_config, Unset):
@@ -232,6 +240,7 @@ class FunctionSpec:
232
240
  policies=policies,
233
241
  private_clusters=private_clusters,
234
242
  runtime=runtime,
243
+ sandbox=sandbox,
235
244
  serverless_config=serverless_config,
236
245
  description=description,
237
246
  kit=kit,
@@ -0,0 +1,79 @@
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="HistogramBucket")
9
+
10
+
11
+ @_attrs_define
12
+ class HistogramBucket:
13
+ """Histogram bucket
14
+
15
+ Attributes:
16
+ count (Union[Unset, int]): Count
17
+ end (Union[Unset, float]): End
18
+ start (Union[Unset, float]): Start
19
+ """
20
+
21
+ count: Union[Unset, int] = UNSET
22
+ end: Union[Unset, float] = UNSET
23
+ start: Union[Unset, float] = UNSET
24
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ count = self.count
28
+
29
+ end = self.end
30
+
31
+ start = self.start
32
+
33
+ field_dict: dict[str, Any] = {}
34
+ field_dict.update(self.additional_properties)
35
+ field_dict.update({})
36
+ if count is not UNSET:
37
+ field_dict["count"] = count
38
+ if end is not UNSET:
39
+ field_dict["end"] = end
40
+ if start is not UNSET:
41
+ field_dict["start"] = start
42
+
43
+ return field_dict
44
+
45
+ @classmethod
46
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
47
+ if not src_dict:
48
+ return None
49
+ d = src_dict.copy()
50
+ count = d.pop("count", UNSET)
51
+
52
+ end = d.pop("end", UNSET)
53
+
54
+ start = d.pop("start", UNSET)
55
+
56
+ histogram_bucket = cls(
57
+ count=count,
58
+ end=end,
59
+ start=start,
60
+ )
61
+
62
+ histogram_bucket.additional_properties = d
63
+ return histogram_bucket
64
+
65
+ @property
66
+ def additional_keys(self) -> list[str]:
67
+ return list(self.additional_properties.keys())
68
+
69
+ def __getitem__(self, key: str) -> Any:
70
+ return self.additional_properties[key]
71
+
72
+ def __setitem__(self, key: str, value: Any) -> None:
73
+ self.additional_properties[key] = value
74
+
75
+ def __delitem__(self, key: str) -> None:
76
+ del self.additional_properties[key]
77
+
78
+ def __contains__(self, key: str) -> bool:
79
+ return key in self.additional_properties
@@ -0,0 +1,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="HistogramStats")
9
+
10
+
11
+ @_attrs_define
12
+ class HistogramStats:
13
+ """Histogram stats
14
+
15
+ Attributes:
16
+ average (Union[Unset, float]): Average request duration
17
+ p50 (Union[Unset, float]): P50 request duration
18
+ p90 (Union[Unset, float]): P90 request duration
19
+ p99 (Union[Unset, float]): P99 request duration
20
+ """
21
+
22
+ average: Union[Unset, float] = UNSET
23
+ p50: Union[Unset, float] = UNSET
24
+ p90: Union[Unset, float] = UNSET
25
+ p99: 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
+ average = self.average
30
+
31
+ p50 = self.p50
32
+
33
+ p90 = self.p90
34
+
35
+ p99 = self.p99
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update({})
40
+ if average is not UNSET:
41
+ field_dict["average"] = average
42
+ if p50 is not UNSET:
43
+ field_dict["p50"] = p50
44
+ if p90 is not UNSET:
45
+ field_dict["p90"] = p90
46
+ if p99 is not UNSET:
47
+ field_dict["p99"] = p99
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
+ average = d.pop("average", UNSET)
57
+
58
+ p50 = d.pop("p50", UNSET)
59
+
60
+ p90 = d.pop("p90", UNSET)
61
+
62
+ p99 = d.pop("p99", UNSET)
63
+
64
+ histogram_stats = cls(
65
+ average=average,
66
+ p50=p50,
67
+ p90=p90,
68
+ p99=p99,
69
+ )
70
+
71
+ histogram_stats.additional_properties = d
72
+ return histogram_stats
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
@@ -14,25 +14,19 @@ class IncreaseAndRateMetric:
14
14
 
15
15
  Attributes:
16
16
  inference_global (Union[Unset, Any]): Historical requests for all resources globally
17
- query (Union[Unset, Any]): Number of requests for all resources globally
18
17
  """
19
18
 
20
19
  inference_global: Union[Unset, Any] = UNSET
21
- query: Union[Unset, Any] = UNSET
22
20
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
21
 
24
22
  def to_dict(self) -> dict[str, Any]:
25
23
  inference_global = self.inference_global
26
24
 
27
- query = self.query
28
-
29
25
  field_dict: dict[str, Any] = {}
30
26
  field_dict.update(self.additional_properties)
31
27
  field_dict.update({})
32
28
  if inference_global is not UNSET:
33
29
  field_dict["inferenceGlobal"] = inference_global
34
- if query is not UNSET:
35
- field_dict["query"] = query
36
30
 
37
31
  return field_dict
38
32
 
@@ -43,11 +37,8 @@ class IncreaseAndRateMetric:
43
37
  d = src_dict.copy()
44
38
  inference_global = d.pop("inferenceGlobal", UNSET)
45
39
 
46
- query = d.pop("query", UNSET)
47
-
48
40
  increase_and_rate_metric = cls(
49
41
  inference_global=inference_global,
50
- query=query,
51
42
  )
52
43
 
53
44
  increase_and_rate_metric.additional_properties = d