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.
- beamlit/agents/decorator.py +3 -3
- beamlit/api/{model_providers/delete_model_provider.py → accounts/delete_account.py} +42 -35
- beamlit/api/{model_providers/get_model_provider.py → accounts/get_account.py} +34 -34
- beamlit/api/{model_providers/list_model_providers.py → accounts/list_accounts.py} +21 -21
- beamlit/api/{model_providers/update_model_provider.py → accounts/update_account.py} +43 -43
- beamlit/api/agents/get_agent_metrics.py +12 -12
- beamlit/api/{model_providers/create_model_provider.py → default/create_account.py} +30 -30
- beamlit/api/functions/get_function_metrics.py +12 -12
- beamlit/api/models/get_model_metrics.py +12 -12
- beamlit/functions/common.py +0 -1
- beamlit/functions/mcp/mcp.py +3 -2
- beamlit/models/__init__.py +16 -30
- beamlit/models/{model_metadata.py → account.py} +93 -15
- beamlit/models/{agent_metadata.py → account_metadata.py} +16 -41
- beamlit/models/account_spec.py +123 -0
- beamlit/models/{agent_render.py → account_spec_address.py} +6 -6
- beamlit/models/agent.py +6 -2
- beamlit/models/agent_spec.py +30 -6
- beamlit/models/billing_address.py +133 -0
- beamlit/models/core_spec.py +27 -5
- beamlit/models/core_spec_configurations.py +3 -1
- beamlit/models/environment.py +6 -2
- beamlit/models/environment_metadata.py +3 -1
- beamlit/models/function.py +6 -2
- beamlit/models/function_spec.py +27 -5
- beamlit/models/integration_connection.py +6 -2
- beamlit/models/integration_connection_spec.py +18 -14
- beamlit/models/{function_render.py → integration_connection_spec_config.py} +6 -6
- beamlit/models/{core_status.py → integration_connection_spec_secret.py} +6 -6
- beamlit/models/latency_metric.py +24 -4
- beamlit/models/metadata.py +3 -1
- beamlit/models/metrics.py +13 -3
- beamlit/models/model.py +6 -2
- beamlit/models/model_spec.py +27 -5
- beamlit/models/pending_invitation_accept.py +3 -1
- beamlit/models/pending_invitation_render.py +13 -3
- beamlit/models/policy.py +6 -2
- beamlit/models/policy_max_tokens.py +106 -0
- beamlit/models/policy_spec.py +30 -0
- beamlit/models/request_duration_over_time_metrics.py +7 -1
- beamlit/models/request_total_by_origin_metric.py +14 -2
- beamlit/models/request_total_metric.py +10 -2
- beamlit/models/resource_environment_metrics.py +33 -7
- beamlit/models/resource_log.py +9 -0
- beamlit/models/runtime.py +10 -2
- beamlit/models/store_agent.py +3 -1
- beamlit/models/store_function.py +3 -1
- beamlit/models/token_rate_metrics.py +17 -3
- beamlit/models/trace_ids_response.py +3 -21
- beamlit/models/workspace.py +12 -1
- {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/METADATA +1 -1
- {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/RECORD +55 -70
- beamlit/models/function_metadata.py +0 -146
- beamlit/models/increase_and_rate_metric.py +0 -61
- beamlit/models/integration_config.py +0 -45
- beamlit/models/integration_connection_config.py +0 -45
- beamlit/models/integration_connection_secret.py +0 -61
- beamlit/models/model_provider.py +0 -173
- beamlit/models/model_render.py +0 -45
- beamlit/models/provider_config.py +0 -94
- beamlit/models/qps.py +0 -61
- beamlit/models/repository_type_0.py +0 -70
- beamlit/models/resource_deployment_metrics.py +0 -176
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +0 -75
- beamlit/models/resource_environment_metrics_inference_per_region.py +0 -77
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +0 -77
- beamlit/models/resource_environment_metrics_query_per_region_per_code.py +0 -75
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +0 -75
- beamlit/models/resource_metrics.py +0 -96
- /beamlit/api/{model_providers → accounts}/__init__.py +0 -0
- {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/WHEEL +0 -0
- {beamlit-0.0.47rc93.dist-info → beamlit-0.0.48.dist-info}/licenses/LICENSE +0 -0
beamlit/models/agent_spec.py
CHANGED
@@ -62,8 +62,14 @@ class AgentSpec:
|
|
62
62
|
|
63
63
|
def to_dict(self) -> dict[str, Any]:
|
64
64
|
configurations: Union[Unset, dict[str, Any]] = UNSET
|
65
|
-
if
|
65
|
+
if (
|
66
|
+
self.configurations
|
67
|
+
and not isinstance(self.configurations, Unset)
|
68
|
+
and not isinstance(self.configurations, dict)
|
69
|
+
):
|
66
70
|
configurations = self.configurations.to_dict()
|
71
|
+
elif self.configurations and isinstance(self.configurations, dict):
|
72
|
+
configurations = self.configurations
|
67
73
|
|
68
74
|
enabled = self.enabled
|
69
75
|
|
@@ -79,26 +85,42 @@ class AgentSpec:
|
|
79
85
|
integration_connections = self.integration_connections
|
80
86
|
|
81
87
|
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
82
|
-
if self.pod_template and not isinstance(self.pod_template, Unset):
|
88
|
+
if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
|
83
89
|
pod_template = self.pod_template.to_dict()
|
90
|
+
elif self.pod_template and isinstance(self.pod_template, dict):
|
91
|
+
pod_template = self.pod_template
|
84
92
|
|
85
93
|
policies: Union[Unset, list[str]] = UNSET
|
86
94
|
if not isinstance(self.policies, Unset):
|
87
95
|
policies = self.policies
|
88
96
|
|
89
97
|
private_clusters: Union[Unset, dict[str, Any]] = UNSET
|
90
|
-
if
|
98
|
+
if (
|
99
|
+
self.private_clusters
|
100
|
+
and not isinstance(self.private_clusters, Unset)
|
101
|
+
and not isinstance(self.private_clusters, dict)
|
102
|
+
):
|
91
103
|
private_clusters = self.private_clusters.to_dict()
|
104
|
+
elif self.private_clusters and isinstance(self.private_clusters, dict):
|
105
|
+
private_clusters = self.private_clusters
|
92
106
|
|
93
107
|
runtime: Union[Unset, dict[str, Any]] = UNSET
|
94
|
-
if self.runtime and not isinstance(self.runtime, Unset):
|
108
|
+
if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
|
95
109
|
runtime = self.runtime.to_dict()
|
110
|
+
elif self.runtime and isinstance(self.runtime, dict):
|
111
|
+
runtime = self.runtime
|
96
112
|
|
97
113
|
sandbox = self.sandbox
|
98
114
|
|
99
115
|
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
100
|
-
if
|
116
|
+
if (
|
117
|
+
self.serverless_config
|
118
|
+
and not isinstance(self.serverless_config, Unset)
|
119
|
+
and not isinstance(self.serverless_config, dict)
|
120
|
+
):
|
101
121
|
serverless_config = self.serverless_config.to_dict()
|
122
|
+
elif self.serverless_config and isinstance(self.serverless_config, dict):
|
123
|
+
serverless_config = self.serverless_config
|
102
124
|
|
103
125
|
agent_chain: Union[Unset, list[dict[str, Any]]] = UNSET
|
104
126
|
if not isinstance(self.agent_chain, Unset):
|
@@ -116,8 +138,10 @@ class AgentSpec:
|
|
116
138
|
model = self.model
|
117
139
|
|
118
140
|
repository: Union[Unset, dict[str, Any]] = UNSET
|
119
|
-
if self.repository and not isinstance(self.repository, Unset):
|
141
|
+
if self.repository and not isinstance(self.repository, Unset) and not isinstance(self.repository, dict):
|
120
142
|
repository = self.repository.to_dict()
|
143
|
+
elif self.repository and isinstance(self.repository, dict):
|
144
|
+
repository = self.repository
|
121
145
|
|
122
146
|
store_id = self.store_id
|
123
147
|
|
@@ -0,0 +1,133 @@
|
|
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="BillingAddress")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class BillingAddress:
|
13
|
+
"""BillingAddress
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
city (Union[Unset, str]): City
|
17
|
+
country (Union[Unset, str]): Country
|
18
|
+
first_name (Union[Unset, str]): First name
|
19
|
+
last_name (Union[Unset, str]): Last name
|
20
|
+
phone_number (Union[Unset, str]): Phone number
|
21
|
+
postal_code (Union[Unset, str]): Postal code
|
22
|
+
state (Union[Unset, str]): State/Province/Region
|
23
|
+
street1 (Union[Unset, str]): Street 1
|
24
|
+
street2 (Union[Unset, str]): Street 2
|
25
|
+
"""
|
26
|
+
|
27
|
+
city: Union[Unset, str] = UNSET
|
28
|
+
country: Union[Unset, str] = UNSET
|
29
|
+
first_name: Union[Unset, str] = UNSET
|
30
|
+
last_name: Union[Unset, str] = UNSET
|
31
|
+
phone_number: Union[Unset, str] = UNSET
|
32
|
+
postal_code: Union[Unset, str] = UNSET
|
33
|
+
state: Union[Unset, str] = UNSET
|
34
|
+
street1: Union[Unset, str] = UNSET
|
35
|
+
street2: Union[Unset, str] = UNSET
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
37
|
+
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
39
|
+
city = self.city
|
40
|
+
|
41
|
+
country = self.country
|
42
|
+
|
43
|
+
first_name = self.first_name
|
44
|
+
|
45
|
+
last_name = self.last_name
|
46
|
+
|
47
|
+
phone_number = self.phone_number
|
48
|
+
|
49
|
+
postal_code = self.postal_code
|
50
|
+
|
51
|
+
state = self.state
|
52
|
+
|
53
|
+
street1 = self.street1
|
54
|
+
|
55
|
+
street2 = self.street2
|
56
|
+
|
57
|
+
field_dict: dict[str, Any] = {}
|
58
|
+
field_dict.update(self.additional_properties)
|
59
|
+
field_dict.update({})
|
60
|
+
if city is not UNSET:
|
61
|
+
field_dict["city"] = city
|
62
|
+
if country is not UNSET:
|
63
|
+
field_dict["country"] = country
|
64
|
+
if first_name is not UNSET:
|
65
|
+
field_dict["firstName"] = first_name
|
66
|
+
if last_name is not UNSET:
|
67
|
+
field_dict["lastName"] = last_name
|
68
|
+
if phone_number is not UNSET:
|
69
|
+
field_dict["phoneNumber"] = phone_number
|
70
|
+
if postal_code is not UNSET:
|
71
|
+
field_dict["postalCode"] = postal_code
|
72
|
+
if state is not UNSET:
|
73
|
+
field_dict["state"] = state
|
74
|
+
if street1 is not UNSET:
|
75
|
+
field_dict["street1"] = street1
|
76
|
+
if street2 is not UNSET:
|
77
|
+
field_dict["street2"] = street2
|
78
|
+
|
79
|
+
return field_dict
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
83
|
+
if not src_dict:
|
84
|
+
return None
|
85
|
+
d = src_dict.copy()
|
86
|
+
city = d.pop("city", UNSET)
|
87
|
+
|
88
|
+
country = d.pop("country", UNSET)
|
89
|
+
|
90
|
+
first_name = d.pop("firstName", UNSET)
|
91
|
+
|
92
|
+
last_name = d.pop("lastName", UNSET)
|
93
|
+
|
94
|
+
phone_number = d.pop("phoneNumber", UNSET)
|
95
|
+
|
96
|
+
postal_code = d.pop("postalCode", UNSET)
|
97
|
+
|
98
|
+
state = d.pop("state", UNSET)
|
99
|
+
|
100
|
+
street1 = d.pop("street1", UNSET)
|
101
|
+
|
102
|
+
street2 = d.pop("street2", UNSET)
|
103
|
+
|
104
|
+
billing_address = cls(
|
105
|
+
city=city,
|
106
|
+
country=country,
|
107
|
+
first_name=first_name,
|
108
|
+
last_name=last_name,
|
109
|
+
phone_number=phone_number,
|
110
|
+
postal_code=postal_code,
|
111
|
+
state=state,
|
112
|
+
street1=street1,
|
113
|
+
street2=street2,
|
114
|
+
)
|
115
|
+
|
116
|
+
billing_address.additional_properties = d
|
117
|
+
return billing_address
|
118
|
+
|
119
|
+
@property
|
120
|
+
def additional_keys(self) -> list[str]:
|
121
|
+
return list(self.additional_properties.keys())
|
122
|
+
|
123
|
+
def __getitem__(self, key: str) -> Any:
|
124
|
+
return self.additional_properties[key]
|
125
|
+
|
126
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
127
|
+
self.additional_properties[key] = value
|
128
|
+
|
129
|
+
def __delitem__(self, key: str) -> None:
|
130
|
+
del self.additional_properties[key]
|
131
|
+
|
132
|
+
def __contains__(self, key: str) -> bool:
|
133
|
+
return key in self.additional_properties
|
beamlit/models/core_spec.py
CHANGED
@@ -48,8 +48,14 @@ class CoreSpec:
|
|
48
48
|
|
49
49
|
def to_dict(self) -> dict[str, Any]:
|
50
50
|
configurations: Union[Unset, dict[str, Any]] = UNSET
|
51
|
-
if
|
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 CoreSpec:
|
|
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
|
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
|
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)
|
@@ -26,8 +26,10 @@ class CoreSpecConfigurations:
|
|
26
26
|
|
27
27
|
def to_dict(self) -> dict[str, Any]:
|
28
28
|
key: Union[Unset, dict[str, Any]] = UNSET
|
29
|
-
if self.key and not isinstance(self.key, Unset):
|
29
|
+
if self.key and not isinstance(self.key, Unset) and not isinstance(self.key, dict):
|
30
30
|
key = self.key.to_dict()
|
31
|
+
elif self.key and isinstance(self.key, dict):
|
32
|
+
key = self.key
|
31
33
|
|
32
34
|
field_dict: dict[str, Any] = {}
|
33
35
|
field_dict.update(self.additional_properties)
|
beamlit/models/environment.py
CHANGED
@@ -28,12 +28,16 @@ class Environment:
|
|
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)
|
@@ -51,8 +51,10 @@ class EnvironmentMetadata:
|
|
51
51
|
display_name = self.display_name
|
52
52
|
|
53
53
|
labels: Union[Unset, dict[str, Any]] = UNSET
|
54
|
-
if self.labels and not isinstance(self.labels, Unset):
|
54
|
+
if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
|
55
55
|
labels = self.labels.to_dict()
|
56
|
+
elif self.labels and isinstance(self.labels, dict):
|
57
|
+
labels = self.labels
|
56
58
|
|
57
59
|
name = self.name
|
58
60
|
|
beamlit/models/function.py
CHANGED
@@ -40,12 +40,16 @@ class Function:
|
|
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
|
|
beamlit/models/function_spec.py
CHANGED
@@ -59,8 +59,14 @@ class FunctionSpec:
|
|
59
59
|
|
60
60
|
def to_dict(self) -> dict[str, Any]:
|
61
61
|
configurations: Union[Unset, dict[str, Any]] = UNSET
|
62
|
-
if
|
62
|
+
if (
|
63
|
+
self.configurations
|
64
|
+
and not isinstance(self.configurations, Unset)
|
65
|
+
and not isinstance(self.configurations, dict)
|
66
|
+
):
|
63
67
|
configurations = self.configurations.to_dict()
|
68
|
+
elif self.configurations and isinstance(self.configurations, dict):
|
69
|
+
configurations = self.configurations
|
64
70
|
|
65
71
|
enabled = self.enabled
|
66
72
|
|
@@ -76,26 +82,42 @@ class FunctionSpec:
|
|
76
82
|
integration_connections = self.integration_connections
|
77
83
|
|
78
84
|
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
79
|
-
if self.pod_template and not isinstance(self.pod_template, Unset):
|
85
|
+
if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
|
80
86
|
pod_template = self.pod_template.to_dict()
|
87
|
+
elif self.pod_template and isinstance(self.pod_template, dict):
|
88
|
+
pod_template = self.pod_template
|
81
89
|
|
82
90
|
policies: Union[Unset, list[str]] = UNSET
|
83
91
|
if not isinstance(self.policies, Unset):
|
84
92
|
policies = self.policies
|
85
93
|
|
86
94
|
private_clusters: Union[Unset, dict[str, Any]] = UNSET
|
87
|
-
if
|
95
|
+
if (
|
96
|
+
self.private_clusters
|
97
|
+
and not isinstance(self.private_clusters, Unset)
|
98
|
+
and not isinstance(self.private_clusters, dict)
|
99
|
+
):
|
88
100
|
private_clusters = self.private_clusters.to_dict()
|
101
|
+
elif self.private_clusters and isinstance(self.private_clusters, dict):
|
102
|
+
private_clusters = self.private_clusters
|
89
103
|
|
90
104
|
runtime: Union[Unset, dict[str, Any]] = UNSET
|
91
|
-
if self.runtime and not isinstance(self.runtime, Unset):
|
105
|
+
if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
|
92
106
|
runtime = self.runtime.to_dict()
|
107
|
+
elif self.runtime and isinstance(self.runtime, dict):
|
108
|
+
runtime = self.runtime
|
93
109
|
|
94
110
|
sandbox = self.sandbox
|
95
111
|
|
96
112
|
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
97
|
-
if
|
113
|
+
if (
|
114
|
+
self.serverless_config
|
115
|
+
and not isinstance(self.serverless_config, Unset)
|
116
|
+
and not isinstance(self.serverless_config, dict)
|
117
|
+
):
|
98
118
|
serverless_config = self.serverless_config.to_dict()
|
119
|
+
elif self.serverless_config and isinstance(self.serverless_config, dict):
|
120
|
+
serverless_config = self.serverless_config
|
99
121
|
|
100
122
|
description = self.description
|
101
123
|
|
@@ -28,12 +28,16 @@ class IntegrationConnection:
|
|
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)
|
@@ -6,8 +6,8 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.
|
10
|
-
from ..models.
|
9
|
+
from ..models.integration_connection_spec_config import IntegrationConnectionSpecConfig
|
10
|
+
from ..models.integration_connection_spec_secret import IntegrationConnectionSpecSecret
|
11
11
|
|
12
12
|
|
13
13
|
T = TypeVar("T", bound="IntegrationConnectionSpec")
|
@@ -18,30 +18,34 @@ class IntegrationConnectionSpec:
|
|
18
18
|
"""Integration connection specification
|
19
19
|
|
20
20
|
Attributes:
|
21
|
-
config (Union[Unset,
|
21
|
+
config (Union[Unset, IntegrationConnectionSpecConfig]): Additional configuration for the integration
|
22
22
|
integration (Union[Unset, str]): Integration type
|
23
23
|
sandbox (Union[Unset, bool]): Sandbox mode
|
24
|
-
secret (Union[Unset,
|
24
|
+
secret (Union[Unset, IntegrationConnectionSpecSecret]): Integration secret
|
25
25
|
"""
|
26
26
|
|
27
|
-
config: Union[Unset, "
|
27
|
+
config: Union[Unset, "IntegrationConnectionSpecConfig"] = UNSET
|
28
28
|
integration: Union[Unset, str] = UNSET
|
29
29
|
sandbox: Union[Unset, bool] = UNSET
|
30
|
-
secret: Union[Unset, "
|
30
|
+
secret: Union[Unset, "IntegrationConnectionSpecSecret"] = UNSET
|
31
31
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
32
32
|
|
33
33
|
def to_dict(self) -> dict[str, Any]:
|
34
34
|
config: Union[Unset, dict[str, Any]] = UNSET
|
35
|
-
if self.config and not isinstance(self.config, Unset):
|
35
|
+
if self.config and not isinstance(self.config, Unset) and not isinstance(self.config, dict):
|
36
36
|
config = self.config.to_dict()
|
37
|
+
elif self.config and isinstance(self.config, dict):
|
38
|
+
config = self.config
|
37
39
|
|
38
40
|
integration = self.integration
|
39
41
|
|
40
42
|
sandbox = self.sandbox
|
41
43
|
|
42
44
|
secret: Union[Unset, dict[str, Any]] = UNSET
|
43
|
-
if self.secret and not isinstance(self.secret, Unset):
|
45
|
+
if self.secret and not isinstance(self.secret, Unset) and not isinstance(self.secret, dict):
|
44
46
|
secret = self.secret.to_dict()
|
47
|
+
elif self.secret and isinstance(self.secret, dict):
|
48
|
+
secret = self.secret
|
45
49
|
|
46
50
|
field_dict: dict[str, Any] = {}
|
47
51
|
field_dict.update(self.additional_properties)
|
@@ -59,29 +63,29 @@ class IntegrationConnectionSpec:
|
|
59
63
|
|
60
64
|
@classmethod
|
61
65
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
62
|
-
from ..models.
|
63
|
-
from ..models.
|
66
|
+
from ..models.integration_connection_spec_config import IntegrationConnectionSpecConfig
|
67
|
+
from ..models.integration_connection_spec_secret import IntegrationConnectionSpecSecret
|
64
68
|
|
65
69
|
if not src_dict:
|
66
70
|
return None
|
67
71
|
d = src_dict.copy()
|
68
72
|
_config = d.pop("config", UNSET)
|
69
|
-
config: Union[Unset,
|
73
|
+
config: Union[Unset, IntegrationConnectionSpecConfig]
|
70
74
|
if isinstance(_config, Unset):
|
71
75
|
config = UNSET
|
72
76
|
else:
|
73
|
-
config =
|
77
|
+
config = IntegrationConnectionSpecConfig.from_dict(_config)
|
74
78
|
|
75
79
|
integration = d.pop("integration", UNSET)
|
76
80
|
|
77
81
|
sandbox = d.pop("sandbox", UNSET)
|
78
82
|
|
79
83
|
_secret = d.pop("secret", UNSET)
|
80
|
-
secret: Union[Unset,
|
84
|
+
secret: Union[Unset, IntegrationConnectionSpecSecret]
|
81
85
|
if isinstance(_secret, Unset):
|
82
86
|
secret = UNSET
|
83
87
|
else:
|
84
|
-
secret =
|
88
|
+
secret = IntegrationConnectionSpecSecret.from_dict(_secret)
|
85
89
|
|
86
90
|
integration_connection_spec = cls(
|
87
91
|
config=config,
|
@@ -3,12 +3,12 @@ from typing import Any, TypeVar
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
-
T = TypeVar("T", bound="
|
6
|
+
T = TypeVar("T", bound="IntegrationConnectionSpecConfig")
|
7
7
|
|
8
8
|
|
9
9
|
@_attrs_define
|
10
|
-
class
|
11
|
-
"""
|
10
|
+
class IntegrationConnectionSpecConfig:
|
11
|
+
"""Additional configuration for the integration"""
|
12
12
|
|
13
13
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
14
|
|
@@ -23,10 +23,10 @@ class FunctionRender:
|
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
26
|
-
|
26
|
+
integration_connection_spec_config = cls()
|
27
27
|
|
28
|
-
|
29
|
-
return
|
28
|
+
integration_connection_spec_config.additional_properties = d
|
29
|
+
return integration_connection_spec_config
|
30
30
|
|
31
31
|
@property
|
32
32
|
def additional_keys(self) -> list[str]:
|
@@ -3,12 +3,12 @@ from typing import Any, TypeVar
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
-
T = TypeVar("T", bound="
|
6
|
+
T = TypeVar("T", bound="IntegrationConnectionSpecSecret")
|
7
7
|
|
8
8
|
|
9
9
|
@_attrs_define
|
10
|
-
class
|
11
|
-
"""
|
10
|
+
class IntegrationConnectionSpecSecret:
|
11
|
+
"""Integration secret"""
|
12
12
|
|
13
13
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
14
|
|
@@ -23,10 +23,10 @@ class CoreStatus:
|
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
26
|
-
|
26
|
+
integration_connection_spec_secret = cls()
|
27
27
|
|
28
|
-
|
29
|
-
return
|
28
|
+
integration_connection_spec_secret.additional_properties = d
|
29
|
+
return integration_connection_spec_secret
|
30
30
|
|
31
31
|
@property
|
32
32
|
def additional_keys(self) -> list[str]:
|
beamlit/models/latency_metric.py
CHANGED
@@ -32,20 +32,40 @@ class LatencyMetric:
|
|
32
32
|
|
33
33
|
def to_dict(self) -> dict[str, Any]:
|
34
34
|
global_histogram: Union[Unset, dict[str, Any]] = UNSET
|
35
|
-
if
|
35
|
+
if (
|
36
|
+
self.global_histogram
|
37
|
+
and not isinstance(self.global_histogram, Unset)
|
38
|
+
and not isinstance(self.global_histogram, dict)
|
39
|
+
):
|
36
40
|
global_histogram = self.global_histogram.to_dict()
|
41
|
+
elif self.global_histogram and isinstance(self.global_histogram, dict):
|
42
|
+
global_histogram = self.global_histogram
|
37
43
|
|
38
44
|
global_stats: Union[Unset, dict[str, Any]] = UNSET
|
39
|
-
if self.global_stats and not isinstance(self.global_stats, Unset):
|
45
|
+
if self.global_stats and not isinstance(self.global_stats, Unset) and not isinstance(self.global_stats, dict):
|
40
46
|
global_stats = self.global_stats.to_dict()
|
47
|
+
elif self.global_stats and isinstance(self.global_stats, dict):
|
48
|
+
global_stats = self.global_stats
|
41
49
|
|
42
50
|
histogram_per_code: Union[Unset, dict[str, Any]] = UNSET
|
43
|
-
if
|
51
|
+
if (
|
52
|
+
self.histogram_per_code
|
53
|
+
and not isinstance(self.histogram_per_code, Unset)
|
54
|
+
and not isinstance(self.histogram_per_code, dict)
|
55
|
+
):
|
44
56
|
histogram_per_code = self.histogram_per_code.to_dict()
|
57
|
+
elif self.histogram_per_code and isinstance(self.histogram_per_code, dict):
|
58
|
+
histogram_per_code = self.histogram_per_code
|
45
59
|
|
46
60
|
stats_per_code: Union[Unset, dict[str, Any]] = UNSET
|
47
|
-
if
|
61
|
+
if (
|
62
|
+
self.stats_per_code
|
63
|
+
and not isinstance(self.stats_per_code, Unset)
|
64
|
+
and not isinstance(self.stats_per_code, dict)
|
65
|
+
):
|
48
66
|
stats_per_code = self.stats_per_code.to_dict()
|
67
|
+
elif self.stats_per_code and isinstance(self.stats_per_code, dict):
|
68
|
+
stats_per_code = self.stats_per_code
|
49
69
|
|
50
70
|
field_dict: dict[str, Any] = {}
|
51
71
|
field_dict.update(self.additional_properties)
|
beamlit/models/metadata.py
CHANGED
@@ -49,8 +49,10 @@ class Metadata:
|
|
49
49
|
display_name = self.display_name
|
50
50
|
|
51
51
|
labels: Union[Unset, dict[str, Any]] = UNSET
|
52
|
-
if self.labels and not isinstance(self.labels, Unset):
|
52
|
+
if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
|
53
53
|
labels = self.labels.to_dict()
|
54
|
+
elif self.labels and isinstance(self.labels, dict):
|
55
|
+
labels = self.labels
|
54
56
|
|
55
57
|
name = self.name
|
56
58
|
|
beamlit/models/metrics.py
CHANGED
@@ -51,20 +51,30 @@ class Metrics:
|
|
51
51
|
inference_global = self.inference_global
|
52
52
|
|
53
53
|
models: Union[Unset, dict[str, Any]] = UNSET
|
54
|
-
if self.models and not isinstance(self.models, Unset):
|
54
|
+
if self.models and not isinstance(self.models, Unset) and not isinstance(self.models, dict):
|
55
55
|
models = self.models.to_dict()
|
56
|
+
elif self.models and isinstance(self.models, dict):
|
57
|
+
models = self.models
|
56
58
|
|
57
59
|
request_total = self.request_total
|
58
60
|
|
59
61
|
request_total_per_code: Union[Unset, dict[str, Any]] = UNSET
|
60
|
-
if
|
62
|
+
if (
|
63
|
+
self.request_total_per_code
|
64
|
+
and not isinstance(self.request_total_per_code, Unset)
|
65
|
+
and not isinstance(self.request_total_per_code, dict)
|
66
|
+
):
|
61
67
|
request_total_per_code = self.request_total_per_code.to_dict()
|
68
|
+
elif self.request_total_per_code and isinstance(self.request_total_per_code, dict):
|
69
|
+
request_total_per_code = self.request_total_per_code
|
62
70
|
|
63
71
|
rps = self.rps
|
64
72
|
|
65
73
|
rps_per_code: Union[Unset, dict[str, Any]] = UNSET
|
66
|
-
if self.rps_per_code and not isinstance(self.rps_per_code, Unset):
|
74
|
+
if self.rps_per_code and not isinstance(self.rps_per_code, Unset) and not isinstance(self.rps_per_code, dict):
|
67
75
|
rps_per_code = self.rps_per_code.to_dict()
|
76
|
+
elif self.rps_per_code and isinstance(self.rps_per_code, dict):
|
77
|
+
rps_per_code = self.rps_per_code
|
68
78
|
|
69
79
|
field_dict: dict[str, Any] = {}
|
70
80
|
field_dict.update(self.additional_properties)
|