beamlit 0.0.47rc93__py3-none-any.whl → 0.0.48__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 (73) hide show
  1. beamlit/agents/decorator.py +3 -3
  2. beamlit/api/{model_providers/delete_model_provider.py → accounts/delete_account.py} +42 -35
  3. beamlit/api/{model_providers/get_model_provider.py → accounts/get_account.py} +34 -34
  4. beamlit/api/{model_providers/list_model_providers.py → accounts/list_accounts.py} +21 -21
  5. beamlit/api/{model_providers/update_model_provider.py → accounts/update_account.py} +43 -43
  6. beamlit/api/agents/get_agent_metrics.py +12 -12
  7. beamlit/api/{model_providers/create_model_provider.py → default/create_account.py} +30 -30
  8. beamlit/api/functions/get_function_metrics.py +12 -12
  9. beamlit/api/models/get_model_metrics.py +12 -12
  10. beamlit/functions/common.py +0 -1
  11. beamlit/functions/mcp/mcp.py +3 -2
  12. beamlit/models/__init__.py +16 -30
  13. beamlit/models/{model_metadata.py → account.py} +93 -15
  14. beamlit/models/{agent_metadata.py → account_metadata.py} +16 -41
  15. beamlit/models/account_spec.py +123 -0
  16. beamlit/models/{agent_render.py → account_spec_address.py} +6 -6
  17. beamlit/models/agent.py +6 -2
  18. beamlit/models/agent_spec.py +30 -6
  19. beamlit/models/billing_address.py +133 -0
  20. beamlit/models/core_spec.py +27 -5
  21. beamlit/models/core_spec_configurations.py +3 -1
  22. beamlit/models/environment.py +6 -2
  23. beamlit/models/environment_metadata.py +3 -1
  24. beamlit/models/function.py +6 -2
  25. beamlit/models/function_spec.py +27 -5
  26. beamlit/models/integration_connection.py +6 -2
  27. beamlit/models/integration_connection_spec.py +18 -14
  28. beamlit/models/{function_render.py → integration_connection_spec_config.py} +6 -6
  29. beamlit/models/{core_status.py → integration_connection_spec_secret.py} +6 -6
  30. beamlit/models/latency_metric.py +24 -4
  31. beamlit/models/metadata.py +3 -1
  32. beamlit/models/metrics.py +13 -3
  33. beamlit/models/model.py +6 -2
  34. beamlit/models/model_spec.py +27 -5
  35. beamlit/models/pending_invitation_accept.py +3 -1
  36. beamlit/models/pending_invitation_render.py +13 -3
  37. beamlit/models/policy.py +6 -2
  38. beamlit/models/policy_max_tokens.py +106 -0
  39. beamlit/models/policy_spec.py +30 -0
  40. beamlit/models/request_duration_over_time_metrics.py +7 -1
  41. beamlit/models/request_total_by_origin_metric.py +14 -2
  42. beamlit/models/request_total_metric.py +10 -2
  43. beamlit/models/resource_environment_metrics.py +33 -7
  44. beamlit/models/resource_log.py +9 -0
  45. beamlit/models/runtime.py +10 -2
  46. beamlit/models/store_agent.py +3 -1
  47. beamlit/models/store_function.py +3 -1
  48. beamlit/models/token_rate_metrics.py +17 -3
  49. beamlit/models/trace_ids_response.py +3 -21
  50. beamlit/models/workspace.py +12 -1
  51. {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/METADATA +1 -1
  52. {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/RECORD +55 -70
  53. beamlit/models/function_metadata.py +0 -146
  54. beamlit/models/increase_and_rate_metric.py +0 -61
  55. beamlit/models/integration_config.py +0 -45
  56. beamlit/models/integration_connection_config.py +0 -45
  57. beamlit/models/integration_connection_secret.py +0 -61
  58. beamlit/models/model_provider.py +0 -173
  59. beamlit/models/model_render.py +0 -45
  60. beamlit/models/provider_config.py +0 -94
  61. beamlit/models/qps.py +0 -61
  62. beamlit/models/repository_type_0.py +0 -70
  63. beamlit/models/resource_deployment_metrics.py +0 -176
  64. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +0 -77
  65. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +0 -75
  66. beamlit/models/resource_environment_metrics_inference_per_region.py +0 -77
  67. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +0 -77
  68. beamlit/models/resource_environment_metrics_query_per_region_per_code.py +0 -75
  69. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +0 -75
  70. beamlit/models/resource_metrics.py +0 -96
  71. /beamlit/api/{model_providers → accounts}/__init__.py +0 -0
  72. {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/WHEEL +0 -0
  73. {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/licenses/LICENSE +0 -0
beamlit/models/model.py CHANGED
@@ -40,12 +40,16 @@ class Model:
40
40
  events.append(componentsschemas_core_events_item)
41
41
 
42
42
  metadata: Union[Unset, dict[str, Any]] = UNSET
43
- if self.metadata and not isinstance(self.metadata, Unset):
43
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
44
44
  metadata = self.metadata.to_dict()
45
+ elif self.metadata and isinstance(self.metadata, dict):
46
+ metadata = self.metadata
45
47
 
46
48
  spec: Union[Unset, dict[str, Any]] = UNSET
47
- if self.spec and not isinstance(self.spec, Unset):
49
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
48
50
  spec = self.spec.to_dict()
51
+ elif self.spec and isinstance(self.spec, dict):
52
+ spec = self.spec
49
53
 
50
54
  status = self.status
51
55
 
@@ -48,8 +48,14 @@ class ModelSpec:
48
48
 
49
49
  def to_dict(self) -> dict[str, Any]:
50
50
  configurations: Union[Unset, dict[str, Any]] = UNSET
51
- if self.configurations and not isinstance(self.configurations, Unset):
51
+ if (
52
+ self.configurations
53
+ and not isinstance(self.configurations, Unset)
54
+ and not isinstance(self.configurations, dict)
55
+ ):
52
56
  configurations = self.configurations.to_dict()
57
+ elif self.configurations and isinstance(self.configurations, dict):
58
+ configurations = self.configurations
53
59
 
54
60
  enabled = self.enabled
55
61
 
@@ -65,26 +71,42 @@ class ModelSpec:
65
71
  integration_connections = self.integration_connections
66
72
 
67
73
  pod_template: Union[Unset, dict[str, Any]] = UNSET
68
- if self.pod_template and not isinstance(self.pod_template, Unset):
74
+ if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
69
75
  pod_template = self.pod_template.to_dict()
76
+ elif self.pod_template and isinstance(self.pod_template, dict):
77
+ pod_template = self.pod_template
70
78
 
71
79
  policies: Union[Unset, list[str]] = UNSET
72
80
  if not isinstance(self.policies, Unset):
73
81
  policies = self.policies
74
82
 
75
83
  private_clusters: Union[Unset, dict[str, Any]] = UNSET
76
- if self.private_clusters and not isinstance(self.private_clusters, Unset):
84
+ if (
85
+ self.private_clusters
86
+ and not isinstance(self.private_clusters, Unset)
87
+ and not isinstance(self.private_clusters, dict)
88
+ ):
77
89
  private_clusters = self.private_clusters.to_dict()
90
+ elif self.private_clusters and isinstance(self.private_clusters, dict):
91
+ private_clusters = self.private_clusters
78
92
 
79
93
  runtime: Union[Unset, dict[str, Any]] = UNSET
80
- if self.runtime and not isinstance(self.runtime, Unset):
94
+ if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
81
95
  runtime = self.runtime.to_dict()
96
+ elif self.runtime and isinstance(self.runtime, dict):
97
+ runtime = self.runtime
82
98
 
83
99
  sandbox = self.sandbox
84
100
 
85
101
  serverless_config: Union[Unset, dict[str, Any]] = UNSET
86
- if self.serverless_config and not isinstance(self.serverless_config, Unset):
102
+ if (
103
+ self.serverless_config
104
+ and not isinstance(self.serverless_config, Unset)
105
+ and not isinstance(self.serverless_config, dict)
106
+ ):
87
107
  serverless_config = self.serverless_config.to_dict()
108
+ elif self.serverless_config and isinstance(self.serverless_config, dict):
109
+ serverless_config = self.serverless_config
88
110
 
89
111
  field_dict: dict[str, Any] = {}
90
112
  field_dict.update(self.additional_properties)
@@ -29,8 +29,10 @@ class PendingInvitationAccept:
29
29
  email = self.email
30
30
 
31
31
  workspace: Union[Unset, dict[str, Any]] = UNSET
32
- if self.workspace and not isinstance(self.workspace, Unset):
32
+ if self.workspace and not isinstance(self.workspace, Unset) and not isinstance(self.workspace, dict):
33
33
  workspace = self.workspace.to_dict()
34
+ elif self.workspace and isinstance(self.workspace, dict):
35
+ workspace = self.workspace
34
36
 
35
37
  field_dict: dict[str, Any] = {}
36
38
  field_dict.update(self.additional_properties)
@@ -41,18 +41,28 @@ class PendingInvitationRender:
41
41
  invited_at = self.invited_at
42
42
 
43
43
  invited_by: Union[Unset, dict[str, Any]] = UNSET
44
- if self.invited_by and not isinstance(self.invited_by, Unset):
44
+ if self.invited_by and not isinstance(self.invited_by, Unset) and not isinstance(self.invited_by, dict):
45
45
  invited_by = self.invited_by.to_dict()
46
+ elif self.invited_by and isinstance(self.invited_by, dict):
47
+ invited_by = self.invited_by
46
48
 
47
49
  role = self.role
48
50
 
49
51
  workspace: Union[Unset, dict[str, Any]] = UNSET
50
- if self.workspace and not isinstance(self.workspace, Unset):
52
+ if self.workspace and not isinstance(self.workspace, Unset) and not isinstance(self.workspace, dict):
51
53
  workspace = self.workspace.to_dict()
54
+ elif self.workspace and isinstance(self.workspace, dict):
55
+ workspace = self.workspace
52
56
 
53
57
  workspace_details: Union[Unset, dict[str, Any]] = UNSET
54
- if self.workspace_details and not isinstance(self.workspace_details, Unset):
58
+ if (
59
+ self.workspace_details
60
+ and not isinstance(self.workspace_details, Unset)
61
+ and not isinstance(self.workspace_details, dict)
62
+ ):
55
63
  workspace_details = self.workspace_details.to_dict()
64
+ elif self.workspace_details and isinstance(self.workspace_details, dict):
65
+ workspace_details = self.workspace_details
56
66
 
57
67
  field_dict: dict[str, Any] = {}
58
68
  field_dict.update(self.additional_properties)
beamlit/models/policy.py CHANGED
@@ -28,12 +28,16 @@ class Policy:
28
28
 
29
29
  def to_dict(self) -> dict[str, Any]:
30
30
  metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if self.metadata and not isinstance(self.metadata, Unset):
31
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
32
32
  metadata = self.metadata.to_dict()
33
+ elif self.metadata and isinstance(self.metadata, dict):
34
+ metadata = self.metadata
33
35
 
34
36
  spec: Union[Unset, dict[str, Any]] = UNSET
35
- if self.spec and not isinstance(self.spec, Unset):
37
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
36
38
  spec = self.spec.to_dict()
39
+ elif self.spec and isinstance(self.spec, dict):
40
+ spec = self.spec
37
41
 
38
42
  field_dict: dict[str, Any] = {}
39
43
  field_dict.update(self.additional_properties)
@@ -0,0 +1,106 @@
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="PolicyMaxTokens")
9
+
10
+
11
+ @_attrs_define
12
+ class PolicyMaxTokens:
13
+ """PolicyMaxTokens is a local type that wraps a slice of PolicyMaxTokens
14
+
15
+ Attributes:
16
+ granularity (Union[Unset, str]): Granularity
17
+ input_ (Union[Unset, int]): Input
18
+ output (Union[Unset, int]): Output
19
+ ratio_input_over_output (Union[Unset, int]): RatioInputOverOutput
20
+ step (Union[Unset, int]): Step
21
+ total (Union[Unset, int]): Total
22
+ """
23
+
24
+ granularity: Union[Unset, str] = UNSET
25
+ input_: Union[Unset, int] = UNSET
26
+ output: Union[Unset, int] = UNSET
27
+ ratio_input_over_output: Union[Unset, int] = UNSET
28
+ step: Union[Unset, int] = UNSET
29
+ total: Union[Unset, int] = UNSET
30
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
31
+
32
+ def to_dict(self) -> dict[str, Any]:
33
+ granularity = self.granularity
34
+
35
+ input_ = self.input_
36
+
37
+ output = self.output
38
+
39
+ ratio_input_over_output = self.ratio_input_over_output
40
+
41
+ step = self.step
42
+
43
+ total = self.total
44
+
45
+ field_dict: dict[str, Any] = {}
46
+ field_dict.update(self.additional_properties)
47
+ field_dict.update({})
48
+ if granularity is not UNSET:
49
+ field_dict["granularity"] = granularity
50
+ if input_ is not UNSET:
51
+ field_dict["input"] = input_
52
+ if output is not UNSET:
53
+ field_dict["output"] = output
54
+ if ratio_input_over_output is not UNSET:
55
+ field_dict["ratioInputOverOutput"] = ratio_input_over_output
56
+ if step is not UNSET:
57
+ field_dict["step"] = step
58
+ if total is not UNSET:
59
+ field_dict["total"] = total
60
+
61
+ return field_dict
62
+
63
+ @classmethod
64
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
65
+ if not src_dict:
66
+ return None
67
+ d = src_dict.copy()
68
+ granularity = d.pop("granularity", UNSET)
69
+
70
+ input_ = d.pop("input", UNSET)
71
+
72
+ output = d.pop("output", UNSET)
73
+
74
+ ratio_input_over_output = d.pop("ratioInputOverOutput", UNSET)
75
+
76
+ step = d.pop("step", UNSET)
77
+
78
+ total = d.pop("total", UNSET)
79
+
80
+ policy_max_tokens = cls(
81
+ granularity=granularity,
82
+ input_=input_,
83
+ output=output,
84
+ ratio_input_over_output=ratio_input_over_output,
85
+ step=step,
86
+ total=total,
87
+ )
88
+
89
+ policy_max_tokens.additional_properties = d
90
+ return policy_max_tokens
91
+
92
+ @property
93
+ def additional_keys(self) -> list[str]:
94
+ return list(self.additional_properties.keys())
95
+
96
+ def __getitem__(self, key: str) -> Any:
97
+ return self.additional_properties[key]
98
+
99
+ def __setitem__(self, key: str, value: Any) -> None:
100
+ self.additional_properties[key] = value
101
+
102
+ def __delitem__(self, key: str) -> None:
103
+ del self.additional_properties[key]
104
+
105
+ def __contains__(self, key: str) -> bool:
106
+ return key in self.additional_properties
@@ -8,6 +8,7 @@ from ..types import UNSET, Unset
8
8
  if TYPE_CHECKING:
9
9
  from ..models.flavor import Flavor
10
10
  from ..models.policy_location import PolicyLocation
11
+ from ..models.policy_max_tokens import PolicyMaxTokens
11
12
 
12
13
 
13
14
  T = TypeVar("T", bound="PolicySpec")
@@ -20,14 +21,19 @@ class PolicySpec:
20
21
  Attributes:
21
22
  flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
22
23
  locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
24
+ max_tokens (Union[Unset, PolicyMaxTokens]): PolicyMaxTokens is a local type that wraps a slice of
25
+ PolicyMaxTokens
23
26
  resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
24
27
  PolicyResourceType
28
+ sandbox (Union[Unset, bool]): Sandbox mode
25
29
  type_ (Union[Unset, str]): Policy type, can be location or flavor
26
30
  """
27
31
 
28
32
  flavors: Union[Unset, list["Flavor"]] = UNSET
29
33
  locations: Union[Unset, list["PolicyLocation"]] = UNSET
34
+ max_tokens: Union[Unset, "PolicyMaxTokens"] = UNSET
30
35
  resource_types: Union[Unset, list[str]] = UNSET
36
+ sandbox: Union[Unset, bool] = UNSET
31
37
  type_: Union[Unset, str] = UNSET
32
38
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
39
 
@@ -46,10 +52,18 @@ class PolicySpec:
46
52
  componentsschemas_policy_locations_item = componentsschemas_policy_locations_item_data.to_dict()
47
53
  locations.append(componentsschemas_policy_locations_item)
48
54
 
55
+ max_tokens: Union[Unset, dict[str, Any]] = UNSET
56
+ if self.max_tokens and not isinstance(self.max_tokens, Unset) and not isinstance(self.max_tokens, dict):
57
+ max_tokens = self.max_tokens.to_dict()
58
+ elif self.max_tokens and isinstance(self.max_tokens, dict):
59
+ max_tokens = self.max_tokens
60
+
49
61
  resource_types: Union[Unset, list[str]] = UNSET
50
62
  if not isinstance(self.resource_types, Unset):
51
63
  resource_types = self.resource_types
52
64
 
65
+ sandbox = self.sandbox
66
+
53
67
  type_ = self.type_
54
68
 
55
69
  field_dict: dict[str, Any] = {}
@@ -59,8 +73,12 @@ class PolicySpec:
59
73
  field_dict["flavors"] = flavors
60
74
  if locations is not UNSET:
61
75
  field_dict["locations"] = locations
76
+ if max_tokens is not UNSET:
77
+ field_dict["maxTokens"] = max_tokens
62
78
  if resource_types is not UNSET:
63
79
  field_dict["resourceTypes"] = resource_types
80
+ if sandbox is not UNSET:
81
+ field_dict["sandbox"] = sandbox
64
82
  if type_ is not UNSET:
65
83
  field_dict["type"] = type_
66
84
 
@@ -70,6 +88,7 @@ class PolicySpec:
70
88
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
71
89
  from ..models.flavor import Flavor
72
90
  from ..models.policy_location import PolicyLocation
91
+ from ..models.policy_max_tokens import PolicyMaxTokens
73
92
 
74
93
  if not src_dict:
75
94
  return None
@@ -90,14 +109,25 @@ class PolicySpec:
90
109
 
91
110
  locations.append(componentsschemas_policy_locations_item)
92
111
 
112
+ _max_tokens = d.pop("maxTokens", UNSET)
113
+ max_tokens: Union[Unset, PolicyMaxTokens]
114
+ if isinstance(_max_tokens, Unset):
115
+ max_tokens = UNSET
116
+ else:
117
+ max_tokens = PolicyMaxTokens.from_dict(_max_tokens)
118
+
93
119
  resource_types = cast(list[str], d.pop("resourceTypes", UNSET))
94
120
 
121
+ sandbox = d.pop("sandbox", UNSET)
122
+
95
123
  type_ = d.pop("type", UNSET)
96
124
 
97
125
  policy_spec = cls(
98
126
  flavors=flavors,
99
127
  locations=locations,
128
+ max_tokens=max_tokens,
100
129
  resource_types=resource_types,
130
+ sandbox=sandbox,
101
131
  type_=type_,
102
132
  )
103
133
 
@@ -25,8 +25,14 @@ class RequestDurationOverTimeMetrics:
25
25
 
26
26
  def to_dict(self) -> dict[str, Any]:
27
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):
28
+ if (
29
+ self.request_duration_over_time
30
+ and not isinstance(self.request_duration_over_time, Unset)
31
+ and not isinstance(self.request_duration_over_time, dict)
32
+ ):
29
33
  request_duration_over_time = self.request_duration_over_time.to_dict()
34
+ elif self.request_duration_over_time and isinstance(self.request_duration_over_time, dict):
35
+ request_duration_over_time = self.request_duration_over_time
30
36
 
31
37
  field_dict: dict[str, Any] = {}
32
38
  field_dict.update(self.additional_properties)
@@ -33,12 +33,24 @@ class RequestTotalByOriginMetric:
33
33
 
34
34
  def to_dict(self) -> dict[str, Any]:
35
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):
36
+ if (
37
+ self.request_total_by_origin
38
+ and not isinstance(self.request_total_by_origin, Unset)
39
+ and not isinstance(self.request_total_by_origin, dict)
40
+ ):
37
41
  request_total_by_origin = self.request_total_by_origin.to_dict()
42
+ elif self.request_total_by_origin and isinstance(self.request_total_by_origin, dict):
43
+ request_total_by_origin = self.request_total_by_origin
38
44
 
39
45
  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):
46
+ if (
47
+ self.request_total_by_origin_and_code
48
+ and not isinstance(self.request_total_by_origin_and_code, Unset)
49
+ and not isinstance(self.request_total_by_origin_and_code, dict)
50
+ ):
41
51
  request_total_by_origin_and_code = self.request_total_by_origin_and_code.to_dict()
52
+ elif self.request_total_by_origin_and_code and isinstance(self.request_total_by_origin_and_code, dict):
53
+ request_total_by_origin_and_code = self.request_total_by_origin_and_code
42
54
 
43
55
  field_dict: dict[str, Any] = {}
44
56
  field_dict.update(self.additional_properties)
@@ -37,14 +37,22 @@ class RequestTotalMetric:
37
37
  request_total = self.request_total
38
38
 
39
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):
40
+ if (
41
+ self.request_total_per_code
42
+ and not isinstance(self.request_total_per_code, Unset)
43
+ and not isinstance(self.request_total_per_code, dict)
44
+ ):
41
45
  request_total_per_code = self.request_total_per_code.to_dict()
46
+ elif self.request_total_per_code and isinstance(self.request_total_per_code, dict):
47
+ request_total_per_code = self.request_total_per_code
42
48
 
43
49
  rps = self.rps
44
50
 
45
51
  rps_per_code: Union[Unset, dict[str, Any]] = UNSET
46
- if self.rps_per_code and not isinstance(self.rps_per_code, Unset):
52
+ if self.rps_per_code and not isinstance(self.rps_per_code, Unset) and not isinstance(self.rps_per_code, dict):
47
53
  rps_per_code = self.rps_per_code.to_dict()
54
+ elif self.rps_per_code and isinstance(self.rps_per_code, dict):
55
+ rps_per_code = self.rps_per_code
48
56
 
49
57
  field_dict: dict[str, Any] = {}
50
58
  field_dict.update(self.additional_properties)
@@ -72,36 +72,62 @@ class ResourceEnvironmentMetrics:
72
72
  last_n_requests.append(componentsschemas_array_metric_item)
73
73
 
74
74
  latency: Union[Unset, dict[str, Any]] = UNSET
75
- if self.latency and not isinstance(self.latency, Unset):
75
+ if self.latency and not isinstance(self.latency, Unset) and not isinstance(self.latency, dict):
76
76
  latency = self.latency.to_dict()
77
+ elif self.latency and isinstance(self.latency, dict):
78
+ latency = self.latency
77
79
 
78
80
  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):
81
+ if (
82
+ self.request_duration_over_time
83
+ and not isinstance(self.request_duration_over_time, Unset)
84
+ and not isinstance(self.request_duration_over_time, dict)
85
+ ):
80
86
  request_duration_over_time = self.request_duration_over_time.to_dict()
87
+ elif self.request_duration_over_time and isinstance(self.request_duration_over_time, dict):
88
+ request_duration_over_time = self.request_duration_over_time
81
89
 
82
90
  request_total = self.request_total
83
91
 
84
92
  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):
93
+ if (
94
+ self.request_total_by_origin
95
+ and not isinstance(self.request_total_by_origin, Unset)
96
+ and not isinstance(self.request_total_by_origin, dict)
97
+ ):
86
98
  request_total_by_origin = self.request_total_by_origin.to_dict()
99
+ elif self.request_total_by_origin and isinstance(self.request_total_by_origin, dict):
100
+ request_total_by_origin = self.request_total_by_origin
87
101
 
88
102
  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):
103
+ if (
104
+ self.request_total_per_code
105
+ and not isinstance(self.request_total_per_code, Unset)
106
+ and not isinstance(self.request_total_per_code, dict)
107
+ ):
90
108
  request_total_per_code = self.request_total_per_code.to_dict()
109
+ elif self.request_total_per_code and isinstance(self.request_total_per_code, dict):
110
+ request_total_per_code = self.request_total_per_code
91
111
 
92
112
  rps = self.rps
93
113
 
94
114
  rps_per_code: Union[Unset, dict[str, Any]] = UNSET
95
- if self.rps_per_code and not isinstance(self.rps_per_code, Unset):
115
+ if self.rps_per_code and not isinstance(self.rps_per_code, Unset) and not isinstance(self.rps_per_code, dict):
96
116
  rps_per_code = self.rps_per_code.to_dict()
117
+ elif self.rps_per_code and isinstance(self.rps_per_code, dict):
118
+ rps_per_code = self.rps_per_code
97
119
 
98
120
  token_rate: Union[Unset, dict[str, Any]] = UNSET
99
- if self.token_rate and not isinstance(self.token_rate, Unset):
121
+ if self.token_rate and not isinstance(self.token_rate, Unset) and not isinstance(self.token_rate, dict):
100
122
  token_rate = self.token_rate.to_dict()
123
+ elif self.token_rate and isinstance(self.token_rate, dict):
124
+ token_rate = self.token_rate
101
125
 
102
126
  token_total: Union[Unset, dict[str, Any]] = UNSET
103
- if self.token_total and not isinstance(self.token_total, Unset):
127
+ if self.token_total and not isinstance(self.token_total, Unset) and not isinstance(self.token_total, dict):
104
128
  token_total = self.token_total.to_dict()
129
+ elif self.token_total and isinstance(self.token_total, dict):
130
+ token_total = self.token_total
105
131
 
106
132
  field_dict: dict[str, Any] = {}
107
133
  field_dict.update(self.additional_properties)
@@ -14,16 +14,20 @@ class ResourceLog:
14
14
 
15
15
  Attributes:
16
16
  message (Union[Unset, str]): Content of the log
17
+ severity (Union[Unset, int]): Severity of the log
17
18
  timestamp (Union[Unset, str]): The timestamp of the log
18
19
  """
19
20
 
20
21
  message: Union[Unset, str] = UNSET
22
+ severity: Union[Unset, int] = UNSET
21
23
  timestamp: Union[Unset, str] = UNSET
22
24
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
25
 
24
26
  def to_dict(self) -> dict[str, Any]:
25
27
  message = self.message
26
28
 
29
+ severity = self.severity
30
+
27
31
  timestamp = self.timestamp
28
32
 
29
33
  field_dict: dict[str, Any] = {}
@@ -31,6 +35,8 @@ class ResourceLog:
31
35
  field_dict.update({})
32
36
  if message is not UNSET:
33
37
  field_dict["message"] = message
38
+ if severity is not UNSET:
39
+ field_dict["severity"] = severity
34
40
  if timestamp is not UNSET:
35
41
  field_dict["timestamp"] = timestamp
36
42
 
@@ -43,10 +49,13 @@ class ResourceLog:
43
49
  d = src_dict.copy()
44
50
  message = d.pop("message", UNSET)
45
51
 
52
+ severity = d.pop("severity", UNSET)
53
+
46
54
  timestamp = d.pop("timestamp", UNSET)
47
55
 
48
56
  resource_log = cls(
49
57
  message=message,
58
+ severity=severity,
50
59
  timestamp=timestamp,
51
60
  )
52
61
 
beamlit/models/runtime.py CHANGED
@@ -64,12 +64,20 @@ class Runtime:
64
64
  model = self.model
65
65
 
66
66
  readiness_probe: Union[Unset, dict[str, Any]] = UNSET
67
- if self.readiness_probe and not isinstance(self.readiness_probe, Unset):
67
+ if (
68
+ self.readiness_probe
69
+ and not isinstance(self.readiness_probe, Unset)
70
+ and not isinstance(self.readiness_probe, dict)
71
+ ):
68
72
  readiness_probe = self.readiness_probe.to_dict()
73
+ elif self.readiness_probe and isinstance(self.readiness_probe, dict):
74
+ readiness_probe = self.readiness_probe
69
75
 
70
76
  resources: Union[Unset, dict[str, Any]] = UNSET
71
- if self.resources and not isinstance(self.resources, Unset):
77
+ if self.resources and not isinstance(self.resources, Unset) and not isinstance(self.resources, dict):
72
78
  resources = self.resources.to_dict()
79
+ elif self.resources and isinstance(self.resources, dict):
80
+ resources = self.resources
73
81
 
74
82
  serving_port = self.serving_port
75
83
 
@@ -65,8 +65,10 @@ class StoreAgent:
65
65
  image = self.image
66
66
 
67
67
  labels: Union[Unset, dict[str, Any]] = UNSET
68
- if self.labels and not isinstance(self.labels, Unset):
68
+ if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
69
69
  labels = self.labels.to_dict()
70
+ elif self.labels and isinstance(self.labels, dict):
71
+ labels = self.labels
70
72
 
71
73
  name = self.name
72
74
 
@@ -78,8 +78,10 @@ class StoreFunction:
78
78
  kit.append(kit_item)
79
79
 
80
80
  labels: Union[Unset, dict[str, Any]] = UNSET
81
- if self.labels and not isinstance(self.labels, Unset):
81
+ if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
82
82
  labels = self.labels.to_dict()
83
+ elif self.labels and isinstance(self.labels, dict):
84
+ labels = self.labels
83
85
 
84
86
  name = self.name
85
87
 
@@ -29,16 +29,30 @@ class TokenRateMetrics:
29
29
 
30
30
  def to_dict(self) -> dict[str, Any]:
31
31
  token_rate: Union[Unset, dict[str, Any]] = UNSET
32
- if self.token_rate and not isinstance(self.token_rate, Unset):
32
+ if self.token_rate and not isinstance(self.token_rate, Unset) and not isinstance(self.token_rate, dict):
33
33
  token_rate = self.token_rate.to_dict()
34
+ elif self.token_rate and isinstance(self.token_rate, dict):
35
+ token_rate = self.token_rate
34
36
 
35
37
  token_rate_input: Union[Unset, dict[str, Any]] = UNSET
36
- if self.token_rate_input and not isinstance(self.token_rate_input, Unset):
38
+ if (
39
+ self.token_rate_input
40
+ and not isinstance(self.token_rate_input, Unset)
41
+ and not isinstance(self.token_rate_input, dict)
42
+ ):
37
43
  token_rate_input = self.token_rate_input.to_dict()
44
+ elif self.token_rate_input and isinstance(self.token_rate_input, dict):
45
+ token_rate_input = self.token_rate_input
38
46
 
39
47
  token_rate_output: Union[Unset, dict[str, Any]] = UNSET
40
- if self.token_rate_output and not isinstance(self.token_rate_output, Unset):
48
+ if (
49
+ self.token_rate_output
50
+ and not isinstance(self.token_rate_output, Unset)
51
+ and not isinstance(self.token_rate_output, dict)
52
+ ):
41
53
  token_rate_output = self.token_rate_output.to_dict()
54
+ elif self.token_rate_output and isinstance(self.token_rate_output, dict):
55
+ token_rate_output = self.token_rate_output
42
56
 
43
57
  field_dict: dict[str, Any] = {}
44
58
  field_dict.update(self.additional_properties)
@@ -1,34 +1,20 @@
1
- from typing import Any, TypeVar, Union, cast
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="TraceIdsResponse")
9
7
 
10
8
 
11
9
  @_attrs_define
12
10
  class TraceIdsResponse:
13
- """Response containing trace IDs
14
-
15
- Attributes:
16
- trace_ids (Union[Unset, list[str]]): List of trace IDs
17
- """
11
+ """Trace IDs response"""
18
12
 
19
- trace_ids: Union[Unset, list[str]] = UNSET
20
13
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
14
 
22
15
  def to_dict(self) -> dict[str, Any]:
23
- trace_ids: Union[Unset, list[str]] = UNSET
24
- if not isinstance(self.trace_ids, Unset):
25
- trace_ids = self.trace_ids
26
-
27
16
  field_dict: dict[str, Any] = {}
28
17
  field_dict.update(self.additional_properties)
29
- field_dict.update({})
30
- if trace_ids is not UNSET:
31
- field_dict["trace_ids"] = trace_ids
32
18
 
33
19
  return field_dict
34
20
 
@@ -37,11 +23,7 @@ class TraceIdsResponse:
37
23
  if not src_dict:
38
24
  return None
39
25
  d = src_dict.copy()
40
- trace_ids = cast(list[str], d.pop("trace_ids", UNSET))
41
-
42
- trace_ids_response = cls(
43
- trace_ids=trace_ids,
44
- )
26
+ trace_ids_response = cls()
45
27
 
46
28
  trace_ids_response.additional_properties = d
47
29
  return trace_ids_response