beamlit 0.0.20rc3__py3-none-any.whl → 0.0.20rc4__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- beamlit/api/agents/delete_agent_history.py +155 -0
- beamlit/api/agents/get_agent_deployment.py +1 -22
- beamlit/api/agents/get_agent_environment_logs.py +151 -0
- beamlit/api/agents/get_agent_history.py +155 -0
- beamlit/api/agents/list_agent_history.py +151 -0
- beamlit/api/agents/put_agent_history.py +181 -0
- beamlit/api/functions/get_function_environment_logs.py +151 -0
- beamlit/api/models/get_model_environment_logs.py +155 -0
- beamlit/common/generate.py +8 -3
- beamlit/common/settings.py +1 -5
- beamlit/models/__init__.py +28 -30
- beamlit/models/acl.py +2 -0
- beamlit/models/agent.py +2 -0
- beamlit/models/agent_chain.py +2 -0
- beamlit/models/agent_configuration.py +2 -0
- beamlit/models/agent_deployment.py +44 -99
- beamlit/models/agent_deployment_configuration.py +45 -0
- beamlit/models/agent_deployment_history.py +15 -46
- beamlit/models/agent_deployment_history_event.py +24 -78
- beamlit/models/agent_deployment_pod_template.py +45 -0
- beamlit/models/agent_history.py +165 -0
- beamlit/models/agent_history_event.py +131 -0
- beamlit/models/agent_metadata.py +144 -0
- beamlit/models/agent_release.py +2 -0
- beamlit/models/agent_spec.py +238 -0
- beamlit/models/agent_with_deployments.py +2 -0
- beamlit/models/api_key.py +2 -0
- beamlit/models/authentication_provider_model.py +2 -0
- beamlit/models/authentication_provider_organization.py +2 -0
- beamlit/models/configuration.py +2 -0
- beamlit/models/continent.py +2 -0
- beamlit/models/core_spec.py +179 -0
- beamlit/models/country.py +2 -0
- beamlit/models/create_api_key_for_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_body.py +2 -0
- beamlit/models/create_workspace_service_account_response_200.py +2 -0
- beamlit/models/delete_workspace_service_account_response_200.py +2 -0
- beamlit/models/deployment_configuration.py +2 -0
- beamlit/models/deployment_configurations.py +2 -0
- beamlit/models/deployment_serverless_config.py +131 -0
- beamlit/models/environment.py +2 -0
- beamlit/models/environment_metrics.py +2 -0
- beamlit/models/environment_spec.py +61 -0
- beamlit/models/flavor.py +2 -0
- beamlit/models/function.py +2 -0
- beamlit/models/function_configuration.py +2 -0
- beamlit/models/function_deployment.py +44 -99
- beamlit/models/function_deployment_configuration.py +45 -0
- beamlit/models/function_deployment_pod_template.py +45 -0
- beamlit/models/function_kit.py +2 -0
- beamlit/models/function_metadata.py +144 -0
- beamlit/models/function_provider_ref.py +2 -0
- beamlit/models/function_release.py +2 -0
- beamlit/models/function_spec.py +240 -0
- beamlit/models/function_with_deployments.py +2 -0
- beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -0
- beamlit/models/increase_and_rate_metric.py +2 -0
- beamlit/models/integration.py +2 -0
- beamlit/models/integration_config.py +2 -0
- beamlit/models/integration_connection.py +2 -0
- beamlit/models/integration_connection_config.py +2 -0
- beamlit/models/integration_connection_secret.py +2 -0
- beamlit/models/integration_connection_spec.py +99 -0
- beamlit/models/integration_model.py +2 -0
- beamlit/models/integration_secret.py +2 -0
- beamlit/models/invite_workspace_user_body.py +2 -0
- beamlit/models/labels_type_0.py +2 -0
- beamlit/models/location.py +2 -0
- beamlit/models/location_response.py +2 -0
- beamlit/models/metadata.py +135 -0
- beamlit/models/metadata_labels.py +43 -0
- beamlit/models/metric.py +2 -0
- beamlit/models/metrics.py +2 -0
- beamlit/models/model.py +2 -0
- beamlit/models/model_deployment.py +66 -85
- beamlit/models/model_deployment_log.py +2 -0
- beamlit/models/model_deployment_metrics.py +2 -0
- beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +2 -0
- beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +2 -0
- beamlit/models/model_deployment_pod_template.py +45 -0
- beamlit/models/model_metadata.py +144 -0
- beamlit/models/model_metrics.py +2 -0
- beamlit/models/model_provider.py +2 -0
- beamlit/models/model_provider_ref.py +2 -0
- beamlit/models/model_release.py +2 -0
- beamlit/models/model_spec.py +188 -0
- beamlit/models/model_with_deployments.py +2 -0
- beamlit/models/owner_fields.py +68 -0
- beamlit/models/pending_invitation.py +2 -0
- beamlit/models/pending_invitation_accept.py +2 -0
- beamlit/models/pending_invitation_render.py +2 -0
- beamlit/models/pending_invitation_render_invited_by.py +2 -0
- beamlit/models/pending_invitation_render_workspace.py +2 -0
- beamlit/models/pending_invitation_workspace_details.py +2 -0
- beamlit/models/pod_template_spec.py +43 -0
- beamlit/models/policy.py +36 -8
- beamlit/models/policy_location.py +2 -0
- beamlit/models/policy_spec.py +119 -0
- beamlit/models/provider_config.py +2 -0
- beamlit/models/qps.py +2 -0
- beamlit/models/resource_deployment_log.py +2 -0
- beamlit/models/resource_deployment_metrics.py +70 -155
- beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +77 -0
- beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
- beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +75 -0
- beamlit/models/resource_environment_metrics.py +172 -0
- beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +75 -0
- beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
- beamlit/models/resource_log.py +68 -0
- beamlit/models/resource_metrics.py +2 -0
- beamlit/models/runtime.py +14 -29
- beamlit/models/runtime_readiness_probe.py +45 -0
- beamlit/models/runtime_resources.py +2 -0
- beamlit/models/runtime_type_0.py +111 -0
- beamlit/models/runtime_type_0_readiness_probe.py +43 -0
- beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
- beamlit/models/runtime_type_0_resources.py +59 -0
- beamlit/models/serverless_config.py +2 -0
- beamlit/models/spec_configuration.py +68 -0
- beamlit/models/standard_fields_dynamo_db.py +2 -0
- beamlit/models/store_agent.py +15 -29
- beamlit/models/store_agent_configuration.py +2 -0
- beamlit/models/store_agent_labels.py +45 -0
- beamlit/models/store_configuration.py +6 -15
- beamlit/models/store_configuration_option.py +7 -18
- beamlit/models/store_function.py +15 -29
- beamlit/models/store_function_configuration.py +2 -0
- beamlit/models/store_function_kit.py +2 -0
- beamlit/models/store_function_labels.py +45 -0
- beamlit/models/store_function_parameter.py +2 -0
- beamlit/models/time_fields.py +68 -0
- beamlit/models/update_workspace_service_account_body.py +2 -0
- beamlit/models/update_workspace_service_account_response_200.py +2 -0
- beamlit/models/update_workspace_user_role_body.py +2 -0
- beamlit/models/websocket_channel.py +86 -0
- beamlit/models/workspace.py +2 -0
- beamlit/models/workspace_labels.py +2 -0
- beamlit/models/workspace_user.py +2 -0
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/METADATA +1 -1
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/RECORD +142 -95
- {beamlit-0.0.20rc3.dist-info → beamlit-0.0.20rc4.dist-info}/WHEEL +0 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeType0ReadinessProbe")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeType0ReadinessProbe:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
d = src_dict.copy()
|
24
|
+
runtime_type_0_readiness_probe = cls()
|
25
|
+
|
26
|
+
runtime_type_0_readiness_probe.additional_properties = d
|
27
|
+
return runtime_type_0_readiness_probe
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -0,0 +1,43 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="RuntimeType0ReadinessProbeType0")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class RuntimeType0ReadinessProbeType0:
|
11
|
+
"""The readiness probe. Should be a Kubernetes Probe type"""
|
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
|
+
d = src_dict.copy()
|
24
|
+
runtime_type_0_readiness_probe_type_0 = cls()
|
25
|
+
|
26
|
+
runtime_type_0_readiness_probe_type_0.additional_properties = d
|
27
|
+
return runtime_type_0_readiness_probe_type_0
|
28
|
+
|
29
|
+
@property
|
30
|
+
def additional_keys(self) -> list[str]:
|
31
|
+
return list(self.additional_properties.keys())
|
32
|
+
|
33
|
+
def __getitem__(self, key: str) -> Any:
|
34
|
+
return self.additional_properties[key]
|
35
|
+
|
36
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
37
|
+
self.additional_properties[key] = value
|
38
|
+
|
39
|
+
def __delitem__(self, key: str) -> None:
|
40
|
+
del self.additional_properties[key]
|
41
|
+
|
42
|
+
def __contains__(self, key: str) -> bool:
|
43
|
+
return key in self.additional_properties
|
@@ -0,0 +1,59 @@
|
|
1
|
+
from typing import Any, Type, 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="RuntimeType0Resources")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RuntimeType0Resources:
|
13
|
+
"""The resources for the deployment. Should be a Kubernetes ResourceRequirements type
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
requests (Union[Unset, str]):
|
17
|
+
"""
|
18
|
+
|
19
|
+
requests: Union[Unset, str] = UNSET
|
20
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
21
|
+
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
23
|
+
requests = self.requests
|
24
|
+
|
25
|
+
field_dict: dict[str, Any] = {}
|
26
|
+
field_dict.update(self.additional_properties)
|
27
|
+
field_dict.update({})
|
28
|
+
if requests is not UNSET:
|
29
|
+
field_dict["requests"] = requests
|
30
|
+
|
31
|
+
return field_dict
|
32
|
+
|
33
|
+
@classmethod
|
34
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
35
|
+
d = src_dict.copy()
|
36
|
+
requests = d.pop("requests", UNSET)
|
37
|
+
|
38
|
+
runtime_type_0_resources = cls(
|
39
|
+
requests=requests,
|
40
|
+
)
|
41
|
+
|
42
|
+
runtime_type_0_resources.additional_properties = d
|
43
|
+
return runtime_type_0_resources
|
44
|
+
|
45
|
+
@property
|
46
|
+
def additional_keys(self) -> list[str]:
|
47
|
+
return list(self.additional_properties.keys())
|
48
|
+
|
49
|
+
def __getitem__(self, key: str) -> Any:
|
50
|
+
return self.additional_properties[key]
|
51
|
+
|
52
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
53
|
+
self.additional_properties[key] = value
|
54
|
+
|
55
|
+
def __delitem__(self, key: str) -> None:
|
56
|
+
del self.additional_properties[key]
|
57
|
+
|
58
|
+
def __contains__(self, key: str) -> bool:
|
59
|
+
return key in self.additional_properties
|
@@ -0,0 +1,68 @@
|
|
1
|
+
from typing import Any, Type, 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="SpecConfiguration")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class SpecConfiguration:
|
13
|
+
"""Agent configuration, this is a key value storage. In your agent you can retrieve the value with config[key]
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
secret (Union[Unset, bool]): Agent configuration secret
|
17
|
+
value (Union[Unset, str]): Agent configuration value
|
18
|
+
"""
|
19
|
+
|
20
|
+
secret: Union[Unset, bool] = UNSET
|
21
|
+
value: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
secret = self.secret
|
26
|
+
|
27
|
+
value = self.value
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if secret is not UNSET:
|
33
|
+
field_dict["secret"] = secret
|
34
|
+
if value is not UNSET:
|
35
|
+
field_dict["value"] = value
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
d = src_dict.copy()
|
42
|
+
secret = d.pop("secret", UNSET)
|
43
|
+
|
44
|
+
value = d.pop("value", UNSET)
|
45
|
+
|
46
|
+
spec_configuration = cls(
|
47
|
+
secret=secret,
|
48
|
+
value=value,
|
49
|
+
)
|
50
|
+
|
51
|
+
spec_configuration.additional_properties = d
|
52
|
+
return spec_configuration
|
53
|
+
|
54
|
+
@property
|
55
|
+
def additional_keys(self) -> list[str]:
|
56
|
+
return list(self.additional_properties.keys())
|
57
|
+
|
58
|
+
def __getitem__(self, key: str) -> Any:
|
59
|
+
return self.additional_properties[key]
|
60
|
+
|
61
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
62
|
+
self.additional_properties[key] = value
|
63
|
+
|
64
|
+
def __delitem__(self, key: str) -> None:
|
65
|
+
del self.additional_properties[key]
|
66
|
+
|
67
|
+
def __contains__(self, key: str) -> bool:
|
68
|
+
return key in self.additional_properties
|
beamlit/models/store_agent.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -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.
|
9
|
+
from ..models.store_agent_labels import StoreAgentLabels
|
10
10
|
from ..models.store_configuration import StoreConfiguration
|
11
11
|
|
12
12
|
|
@@ -26,7 +26,7 @@ class StoreAgent:
|
|
26
26
|
description (Union[Unset, str]): Store agent description
|
27
27
|
display_name (Union[Unset, str]): Store agent display name
|
28
28
|
image (Union[Unset, str]): Store agent image
|
29
|
-
labels (Union[
|
29
|
+
labels (Union[Unset, StoreAgentLabels]): Store agent labels
|
30
30
|
name (Union[Unset, str]): Store agent name
|
31
31
|
"""
|
32
32
|
|
@@ -38,13 +38,11 @@ class StoreAgent:
|
|
38
38
|
description: Union[Unset, str] = UNSET
|
39
39
|
display_name: Union[Unset, str] = UNSET
|
40
40
|
image: Union[Unset, str] = UNSET
|
41
|
-
labels: Union["
|
41
|
+
labels: Union[Unset, "StoreAgentLabels"] = UNSET
|
42
42
|
name: Union[Unset, str] = UNSET
|
43
43
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
44
44
|
|
45
45
|
def to_dict(self) -> dict[str, Any]:
|
46
|
-
from ..models.store_agent_labels_type_0 import StoreAgentLabelsType0
|
47
|
-
|
48
46
|
created_at = self.created_at
|
49
47
|
|
50
48
|
created_by = self.created_by
|
@@ -66,13 +64,9 @@ class StoreAgent:
|
|
66
64
|
|
67
65
|
image = self.image
|
68
66
|
|
69
|
-
labels: Union[Dict[str, Any]
|
70
|
-
if isinstance(self.labels, Unset):
|
71
|
-
labels = UNSET
|
72
|
-
elif isinstance(self.labels, StoreAgentLabelsType0):
|
67
|
+
labels: Union[Unset, Dict[str, Any]] = UNSET
|
68
|
+
if not isinstance(self.labels, Unset):
|
73
69
|
labels = self.labels.to_dict()
|
74
|
-
else:
|
75
|
-
labels = self.labels
|
76
70
|
|
77
71
|
name = self.name
|
78
72
|
|
@@ -104,9 +98,11 @@ class StoreAgent:
|
|
104
98
|
|
105
99
|
@classmethod
|
106
100
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
107
|
-
from ..models.
|
101
|
+
from ..models.store_agent_labels import StoreAgentLabels
|
108
102
|
from ..models.store_configuration import StoreConfiguration
|
109
103
|
|
104
|
+
if not src_dict:
|
105
|
+
return None
|
110
106
|
d = src_dict.copy()
|
111
107
|
created_at = d.pop("created_at", UNSET)
|
112
108
|
|
@@ -129,22 +125,12 @@ class StoreAgent:
|
|
129
125
|
|
130
126
|
image = d.pop("image", UNSET)
|
131
127
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
if not isinstance(data, dict):
|
139
|
-
raise TypeError()
|
140
|
-
labels_type_0 = StoreAgentLabelsType0.from_dict(data)
|
141
|
-
|
142
|
-
return labels_type_0
|
143
|
-
except: # noqa: E722
|
144
|
-
pass
|
145
|
-
return cast(Union["StoreAgentLabelsType0", None, Unset], data)
|
146
|
-
|
147
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
128
|
+
_labels = d.pop("labels", UNSET)
|
129
|
+
labels: Union[Unset, StoreAgentLabels]
|
130
|
+
if isinstance(_labels, Unset):
|
131
|
+
labels = UNSET
|
132
|
+
else:
|
133
|
+
labels = StoreAgentLabels.from_dict(_labels)
|
148
134
|
|
149
135
|
name = d.pop("name", UNSET)
|
150
136
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="StoreAgentLabels")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class StoreAgentLabels:
|
11
|
+
"""Store agent labels"""
|
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
|
+
store_agent_labels = cls()
|
27
|
+
|
28
|
+
store_agent_labels.additional_properties = d
|
29
|
+
return store_agent_labels
|
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
|
@@ -20,7 +20,7 @@ class StoreConfiguration:
|
|
20
20
|
available_models (Union[Unset, List[str]]): Available models for the configuration
|
21
21
|
description (Union[Unset, str]): Store configuration description
|
22
22
|
display_name (Union[Unset, str]): Store configuration display name
|
23
|
-
if_ (Union[
|
23
|
+
if_ (Union[Unset, str]): Conditional rendering for the configuration, example: provider === 'openai'
|
24
24
|
name (Union[Unset, str]): Store configuration name
|
25
25
|
options (Union[Unset, List['StoreConfigurationOption']]):
|
26
26
|
required (Union[Unset, bool]): Store configuration required
|
@@ -31,7 +31,7 @@ class StoreConfiguration:
|
|
31
31
|
available_models: Union[Unset, List[str]] = UNSET
|
32
32
|
description: Union[Unset, str] = UNSET
|
33
33
|
display_name: Union[Unset, str] = UNSET
|
34
|
-
if_: Union[
|
34
|
+
if_: Union[Unset, str] = UNSET
|
35
35
|
name: Union[Unset, str] = UNSET
|
36
36
|
options: Union[Unset, List["StoreConfigurationOption"]] = UNSET
|
37
37
|
required: Union[Unset, bool] = UNSET
|
@@ -48,11 +48,7 @@ class StoreConfiguration:
|
|
48
48
|
|
49
49
|
display_name = self.display_name
|
50
50
|
|
51
|
-
if_
|
52
|
-
if isinstance(self.if_, Unset):
|
53
|
-
if_ = UNSET
|
54
|
-
else:
|
55
|
-
if_ = self.if_
|
51
|
+
if_ = self.if_
|
56
52
|
|
57
53
|
name = self.name
|
58
54
|
|
@@ -97,6 +93,8 @@ class StoreConfiguration:
|
|
97
93
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
98
94
|
from ..models.store_configuration_option import StoreConfigurationOption
|
99
95
|
|
96
|
+
if not src_dict:
|
97
|
+
return None
|
100
98
|
d = src_dict.copy()
|
101
99
|
available_models = cast(List[str], d.pop("available_models", UNSET))
|
102
100
|
|
@@ -104,14 +102,7 @@ class StoreConfiguration:
|
|
104
102
|
|
105
103
|
display_name = d.pop("display_name", UNSET)
|
106
104
|
|
107
|
-
|
108
|
-
if data is None:
|
109
|
-
return data
|
110
|
-
if isinstance(data, Unset):
|
111
|
-
return data
|
112
|
-
return cast(Union[None, Unset, str], data)
|
113
|
-
|
114
|
-
if_ = _parse_if_(d.pop("if", UNSET))
|
105
|
+
if_ = d.pop("if", UNSET)
|
115
106
|
|
116
107
|
name = d.pop("name", UNSET)
|
117
108
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Any, Type, TypeVar, Union
|
1
|
+
from typing import Any, Type, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -13,23 +13,18 @@ class StoreConfigurationOption:
|
|
13
13
|
"""Store configuration options for a select type configuration
|
14
14
|
|
15
15
|
Attributes:
|
16
|
-
if_ (Union[
|
17
|
-
'openai'
|
16
|
+
if_ (Union[Unset, str]): Conditional rendering for the configuration option, example: provider === 'openai'
|
18
17
|
label (Union[Unset, str]): Store configuration option label
|
19
18
|
value (Union[Unset, str]): Store configuration option value
|
20
19
|
"""
|
21
20
|
|
22
|
-
if_: Union[
|
21
|
+
if_: Union[Unset, str] = UNSET
|
23
22
|
label: Union[Unset, str] = UNSET
|
24
23
|
value: Union[Unset, str] = UNSET
|
25
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
26
25
|
|
27
26
|
def to_dict(self) -> dict[str, Any]:
|
28
|
-
if_
|
29
|
-
if isinstance(self.if_, Unset):
|
30
|
-
if_ = UNSET
|
31
|
-
else:
|
32
|
-
if_ = self.if_
|
27
|
+
if_ = self.if_
|
33
28
|
|
34
29
|
label = self.label
|
35
30
|
|
@@ -49,16 +44,10 @@ class StoreConfigurationOption:
|
|
49
44
|
|
50
45
|
@classmethod
|
51
46
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
47
|
+
if not src_dict:
|
48
|
+
return None
|
52
49
|
d = src_dict.copy()
|
53
|
-
|
54
|
-
def _parse_if_(data: object) -> Union[None, Unset, str]:
|
55
|
-
if data is None:
|
56
|
-
return data
|
57
|
-
if isinstance(data, Unset):
|
58
|
-
return data
|
59
|
-
return cast(Union[None, Unset, str], data)
|
60
|
-
|
61
|
-
if_ = _parse_if_(d.pop("if", UNSET))
|
50
|
+
if_ = d.pop("if", UNSET)
|
62
51
|
|
63
52
|
label = d.pop("label", UNSET)
|
64
53
|
|
beamlit/models/store_function.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
@@ -8,7 +8,7 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.store_configuration import StoreConfiguration
|
10
10
|
from ..models.store_function_kit import StoreFunctionKit
|
11
|
-
from ..models.
|
11
|
+
from ..models.store_function_labels import StoreFunctionLabels
|
12
12
|
from ..models.store_function_parameter import StoreFunctionParameter
|
13
13
|
|
14
14
|
|
@@ -29,7 +29,7 @@ class StoreFunction:
|
|
29
29
|
display_name (Union[Unset, str]): Store function display name
|
30
30
|
image (Union[Unset, str]): Store function image
|
31
31
|
kit (Union[Unset, List['StoreFunctionKit']]): Store function kit
|
32
|
-
labels (Union[
|
32
|
+
labels (Union[Unset, StoreFunctionLabels]): Store function labels
|
33
33
|
name (Union[Unset, str]): Store function name
|
34
34
|
parameters (Union[Unset, List['StoreFunctionParameter']]): Store function parameters
|
35
35
|
"""
|
@@ -43,14 +43,12 @@ class StoreFunction:
|
|
43
43
|
display_name: Union[Unset, str] = UNSET
|
44
44
|
image: Union[Unset, str] = UNSET
|
45
45
|
kit: Union[Unset, List["StoreFunctionKit"]] = UNSET
|
46
|
-
labels: Union["
|
46
|
+
labels: Union[Unset, "StoreFunctionLabels"] = UNSET
|
47
47
|
name: Union[Unset, str] = UNSET
|
48
48
|
parameters: Union[Unset, List["StoreFunctionParameter"]] = UNSET
|
49
49
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
50
50
|
|
51
51
|
def to_dict(self) -> dict[str, Any]:
|
52
|
-
from ..models.store_function_labels_type_0 import StoreFunctionLabelsType0
|
53
|
-
|
54
52
|
created_at = self.created_at
|
55
53
|
|
56
54
|
created_by = self.created_by
|
@@ -79,13 +77,9 @@ class StoreFunction:
|
|
79
77
|
kit_item = kit_item_data.to_dict()
|
80
78
|
kit.append(kit_item)
|
81
79
|
|
82
|
-
labels: Union[Dict[str, Any]
|
83
|
-
if isinstance(self.labels, Unset):
|
84
|
-
labels = UNSET
|
85
|
-
elif isinstance(self.labels, StoreFunctionLabelsType0):
|
80
|
+
labels: Union[Unset, Dict[str, Any]] = UNSET
|
81
|
+
if not isinstance(self.labels, Unset):
|
86
82
|
labels = self.labels.to_dict()
|
87
|
-
else:
|
88
|
-
labels = self.labels
|
89
83
|
|
90
84
|
name = self.name
|
91
85
|
|
@@ -130,9 +124,11 @@ class StoreFunction:
|
|
130
124
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
131
125
|
from ..models.store_configuration import StoreConfiguration
|
132
126
|
from ..models.store_function_kit import StoreFunctionKit
|
133
|
-
from ..models.
|
127
|
+
from ..models.store_function_labels import StoreFunctionLabels
|
134
128
|
from ..models.store_function_parameter import StoreFunctionParameter
|
135
129
|
|
130
|
+
if not src_dict:
|
131
|
+
return None
|
136
132
|
d = src_dict.copy()
|
137
133
|
created_at = d.pop("created_at", UNSET)
|
138
134
|
|
@@ -162,22 +158,12 @@ class StoreFunction:
|
|
162
158
|
|
163
159
|
kit.append(kit_item)
|
164
160
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
if not isinstance(data, dict):
|
172
|
-
raise TypeError()
|
173
|
-
labels_type_0 = StoreFunctionLabelsType0.from_dict(data)
|
174
|
-
|
175
|
-
return labels_type_0
|
176
|
-
except: # noqa: E722
|
177
|
-
pass
|
178
|
-
return cast(Union["StoreFunctionLabelsType0", None, Unset], data)
|
179
|
-
|
180
|
-
labels = _parse_labels(d.pop("labels", UNSET))
|
161
|
+
_labels = d.pop("labels", UNSET)
|
162
|
+
labels: Union[Unset, StoreFunctionLabels]
|
163
|
+
if isinstance(_labels, Unset):
|
164
|
+
labels = UNSET
|
165
|
+
else:
|
166
|
+
labels = StoreFunctionLabels.from_dict(_labels)
|
181
167
|
|
182
168
|
name = d.pop("name", UNSET)
|
183
169
|
|
@@ -57,6 +57,8 @@ class StoreFunctionKit:
|
|
57
57
|
def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
|
58
58
|
from ..models.store_function_parameter import StoreFunctionParameter
|
59
59
|
|
60
|
+
if not src_dict:
|
61
|
+
return None
|
60
62
|
d = src_dict.copy()
|
61
63
|
description = d.pop("description", UNSET)
|
62
64
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, Type, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="StoreFunctionLabels")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class StoreFunctionLabels:
|
11
|
+
"""Store function labels"""
|
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
|
+
store_function_labels = cls()
|
27
|
+
|
28
|
+
store_function_labels.additional_properties = d
|
29
|
+
return store_function_labels
|
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
|