beamlit 0.0.18__py3-none-any.whl → 0.0.20__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. beamlit/agents/__init__.py +4 -0
  2. beamlit/agents/chat.py +87 -0
  3. beamlit/agents/decorator.py +147 -0
  4. beamlit/api/agents/create_agent.py +14 -9
  5. beamlit/api/agents/delete_agent_history.py +159 -0
  6. beamlit/api/agents/get_agent_deployment_logs.py +11 -11
  7. beamlit/api/{authentication_providers/list_organizations_for_authentication_provider.py → agents/get_agent_environment_logs.py} +30 -42
  8. beamlit/api/{authentication_providers/get_model_with_repo_for_authentication_provider.py → agents/get_agent_history.py} +43 -68
  9. beamlit/api/agents/list_agent_deployment_history.py +11 -11
  10. beamlit/api/agents/list_agent_deployments.py +11 -11
  11. beamlit/api/agents/list_agent_history.py +151 -0
  12. beamlit/api/agents/list_agents.py +11 -11
  13. beamlit/api/agents/put_agent_history.py +185 -0
  14. beamlit/api/agents/update_agent.py +14 -9
  15. beamlit/api/environments/list_environments.py +11 -11
  16. beamlit/api/functions/create_function.py +14 -9
  17. beamlit/api/functions/get_function_deployment_logs.py +11 -11
  18. beamlit/api/functions/get_function_environment_logs.py +151 -0
  19. beamlit/api/functions/list_function_deployments.py +11 -11
  20. beamlit/api/functions/list_functions.py +11 -11
  21. beamlit/api/functions/update_function.py +14 -9
  22. beamlit/api/history/get_agents_history.py +11 -11
  23. beamlit/api/history/list_agents_history.py +11 -11
  24. beamlit/api/integrations/create_integration_connection.py +167 -0
  25. beamlit/api/integrations/delete_integration_connection.py +158 -0
  26. beamlit/api/integrations/get_integration.py +97 -0
  27. beamlit/api/integrations/get_integration_connection.py +154 -0
  28. beamlit/api/integrations/get_integration_connection_model.py +97 -0
  29. beamlit/api/integrations/get_integration_model.py +97 -0
  30. beamlit/api/integrations/list_integration_connection_models.py +97 -0
  31. beamlit/api/integrations/list_integration_connections.py +139 -0
  32. beamlit/api/integrations/list_integration_models.py +97 -0
  33. beamlit/api/integrations/update_integration_connection.py +180 -0
  34. beamlit/api/invitations/list_all_pending_invitations.py +11 -11
  35. beamlit/api/locations/list_locations.py +11 -11
  36. beamlit/api/model_providers/list_model_providers.py +11 -11
  37. beamlit/api/models/get_model_deployment_logs.py +11 -11
  38. beamlit/api/{authentication_providers/list_models_for_authentication_provider.py → models/get_model_environment_logs.py} +30 -38
  39. beamlit/api/models/list_model_deployments.py +11 -11
  40. beamlit/api/models/list_models.py +11 -11
  41. beamlit/api/policies/list_policies.py +11 -11
  42. beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
  43. beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
  44. beamlit/api/store/list_store_agents.py +11 -11
  45. beamlit/api/store/list_store_functions.py +11 -11
  46. beamlit/api/workspaces/list_workspace_users.py +11 -11
  47. beamlit/api/workspaces/list_workspaces.py +11 -11
  48. beamlit/authentication/__init__.py +29 -8
  49. beamlit/authentication/apikey.py +8 -2
  50. beamlit/authentication/authentication.py +66 -3
  51. beamlit/authentication/clientcredentials.py +108 -0
  52. beamlit/authentication/credentials.py +22 -8
  53. beamlit/authentication/device_mode.py +23 -13
  54. beamlit/common/__init__.py +13 -0
  55. beamlit/common/generate.py +183 -0
  56. beamlit/common/logger.py +29 -0
  57. beamlit/common/secrets.py +11 -0
  58. beamlit/common/settings.py +156 -0
  59. beamlit/common/utils.py +15 -0
  60. beamlit/functions/__init__.py +5 -0
  61. beamlit/functions/decorator.py +90 -0
  62. beamlit/functions/github/__init__.py +3 -0
  63. beamlit/functions/github/github.py +21 -0
  64. beamlit/functions/github/kit/__init__.py +7 -0
  65. beamlit/functions/github/kit/pull_request.py +51 -0
  66. beamlit/functions/math/__init__.py +3 -0
  67. beamlit/functions/math/math.py +40 -0
  68. beamlit/functions/search/__init__.py +3 -0
  69. beamlit/functions/search/search.py +15 -0
  70. beamlit/models/__init__.py +24 -0
  71. beamlit/models/acl.py +4 -2
  72. beamlit/models/agent.py +5 -3
  73. beamlit/models/agent_chain.py +4 -2
  74. beamlit/models/agent_configuration.py +4 -2
  75. beamlit/models/agent_deployment.py +41 -28
  76. beamlit/models/agent_deployment_configuration.py +4 -2
  77. beamlit/models/agent_deployment_configuration_type_0.py +43 -0
  78. beamlit/models/agent_deployment_history.py +7 -5
  79. beamlit/models/agent_deployment_history_event.py +11 -9
  80. beamlit/models/agent_deployment_pod_template.py +4 -2
  81. beamlit/models/agent_deployment_pod_template_type_0.py +43 -0
  82. beamlit/models/agent_history.py +165 -0
  83. beamlit/models/agent_history_event.py +131 -0
  84. beamlit/models/agent_metadata.py +144 -0
  85. beamlit/models/agent_release.py +4 -2
  86. beamlit/models/agent_spec.py +248 -0
  87. beamlit/models/agent_with_deployments.py +176 -0
  88. beamlit/models/api_key.py +4 -2
  89. beamlit/models/authentication_provider_model.py +8 -6
  90. beamlit/models/authentication_provider_organization.py +4 -2
  91. beamlit/models/configuration.py +12 -10
  92. beamlit/models/continent.py +4 -2
  93. beamlit/models/core_spec.py +185 -0
  94. beamlit/models/country.py +4 -2
  95. beamlit/models/create_api_key_for_service_account_body.py +4 -2
  96. beamlit/models/create_workspace_service_account_body.py +4 -2
  97. beamlit/models/create_workspace_service_account_response_200.py +4 -2
  98. beamlit/models/delete_workspace_service_account_response_200.py +4 -2
  99. beamlit/models/deployment_configuration.py +4 -2
  100. beamlit/models/deployment_configurations.py +22 -7
  101. beamlit/models/deployment_serverless_config.py +4 -2
  102. beamlit/models/deployment_serverless_config_type_0.py +220 -0
  103. beamlit/models/environment.py +9 -7
  104. beamlit/models/environment_metrics.py +26 -5
  105. beamlit/models/environment_spec.py +61 -0
  106. beamlit/models/flavor.py +11 -9
  107. beamlit/models/function.py +5 -3
  108. beamlit/models/function_configuration.py +4 -2
  109. beamlit/models/function_deployment.py +33 -20
  110. beamlit/models/function_deployment_configuration.py +4 -2
  111. beamlit/models/function_deployment_configuration_type_0.py +43 -0
  112. beamlit/models/function_deployment_pod_template.py +4 -2
  113. beamlit/models/function_deployment_pod_template_type_0.py +43 -0
  114. beamlit/models/function_kit.py +7 -5
  115. beamlit/models/function_metadata.py +144 -0
  116. beamlit/models/function_provider_ref.py +4 -2
  117. beamlit/models/function_release.py +4 -2
  118. beamlit/models/function_spec.py +246 -0
  119. beamlit/models/function_with_deployments.py +176 -0
  120. beamlit/models/get_workspace_service_accounts_response_200_item.py +4 -2
  121. beamlit/models/increase_and_rate_metric.py +104 -0
  122. beamlit/models/integration.py +198 -0
  123. beamlit/models/integration_config.py +45 -0
  124. beamlit/models/integration_connection.py +198 -0
  125. beamlit/models/integration_connection_config.py +45 -0
  126. beamlit/models/integration_connection_secret.py +61 -0
  127. beamlit/models/integration_connection_spec.py +99 -0
  128. beamlit/models/integration_model.py +144 -0
  129. beamlit/models/integration_secret.py +61 -0
  130. beamlit/models/invite_workspace_user_body.py +4 -2
  131. beamlit/models/labels_type_0.py +4 -2
  132. beamlit/models/location.py +7 -5
  133. beamlit/models/location_response.py +7 -5
  134. beamlit/models/metadata.py +135 -0
  135. beamlit/models/{labels.py → metadata_labels.py} +5 -5
  136. beamlit/models/metric.py +4 -2
  137. beamlit/models/metrics.py +68 -25
  138. beamlit/models/model.py +5 -3
  139. beamlit/models/model_deployment.py +27 -14
  140. beamlit/models/model_deployment_log.py +4 -2
  141. beamlit/models/model_deployment_metrics.py +11 -9
  142. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +7 -5
  143. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
  144. beamlit/models/model_deployment_pod_template.py +4 -2
  145. beamlit/models/model_deployment_pod_template_type_0.py +43 -0
  146. beamlit/models/model_metadata.py +144 -0
  147. beamlit/models/model_metrics.py +8 -6
  148. beamlit/models/model_provider.py +13 -11
  149. beamlit/models/model_provider_ref.py +4 -2
  150. beamlit/models/model_release.py +4 -2
  151. beamlit/models/model_spec.py +194 -0
  152. beamlit/models/model_with_deployments.py +8 -6
  153. beamlit/models/owner_fields.py +68 -0
  154. beamlit/models/pending_invitation.py +4 -2
  155. beamlit/models/pending_invitation_accept.py +5 -3
  156. beamlit/models/pending_invitation_render.py +7 -5
  157. beamlit/models/pending_invitation_render_invited_by.py +4 -2
  158. beamlit/models/pending_invitation_render_workspace.py +4 -2
  159. beamlit/models/pending_invitation_workspace_details.py +8 -6
  160. beamlit/models/pod_template_spec.py +43 -0
  161. beamlit/models/policy.py +22 -20
  162. beamlit/models/policy_location.py +11 -9
  163. beamlit/models/policy_spec.py +125 -0
  164. beamlit/models/provider_config.py +9 -16
  165. beamlit/models/qps.py +4 -2
  166. beamlit/models/resource_deployment_log.py +4 -2
  167. beamlit/models/resource_deployment_metrics.py +119 -9
  168. beamlit/models/resource_deployment_metrics_inference_per_region.py +77 -0
  169. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +79 -0
  170. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +7 -5
  171. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +79 -0
  172. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +75 -0
  173. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +73 -0
  174. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +5 -3
  175. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +73 -0
  176. beamlit/models/resource_environment_metrics.py +210 -0
  177. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +79 -0
  178. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +73 -0
  179. beamlit/models/resource_log.py +68 -0
  180. beamlit/models/resource_metrics.py +44 -6
  181. beamlit/models/runtime.py +25 -23
  182. beamlit/models/runtime_readiness_probe.py +4 -2
  183. beamlit/models/runtime_readiness_probe_type_0.py +43 -0
  184. beamlit/models/runtime_resources.py +4 -2
  185. beamlit/models/runtime_type_0.py +111 -0
  186. beamlit/models/runtime_type_0_readiness_probe.py +43 -0
  187. beamlit/models/runtime_type_0_readiness_probe_type_0.py +43 -0
  188. beamlit/models/runtime_type_0_resources.py +59 -0
  189. beamlit/models/serverless_config.py +4 -2
  190. beamlit/models/spec_configuration.py +68 -0
  191. beamlit/models/standard_fields_dynamo_db.py +4 -2
  192. beamlit/models/store_agent.py +8 -6
  193. beamlit/models/store_agent_configuration.py +4 -2
  194. beamlit/models/store_agent_labels.py +4 -2
  195. beamlit/models/store_agent_labels_type_0.py +43 -0
  196. beamlit/models/store_configuration.py +18 -16
  197. beamlit/models/store_configuration_option.py +4 -2
  198. beamlit/models/store_function.py +14 -12
  199. beamlit/models/store_function_configuration.py +4 -2
  200. beamlit/models/store_function_kit.py +7 -5
  201. beamlit/models/store_function_labels.py +4 -2
  202. beamlit/models/store_function_labels_type_0.py +43 -0
  203. beamlit/models/store_function_parameter.py +11 -9
  204. beamlit/models/time_fields.py +68 -0
  205. beamlit/models/update_workspace_service_account_body.py +4 -2
  206. beamlit/models/update_workspace_service_account_response_200.py +4 -2
  207. beamlit/models/update_workspace_user_role_body.py +4 -2
  208. beamlit/models/websocket_channel.py +86 -0
  209. beamlit/models/workspace.py +5 -3
  210. beamlit/models/workspace_labels.py +4 -2
  211. beamlit/models/workspace_user.py +4 -2
  212. beamlit/run.py +49 -0
  213. beamlit/serve/app.py +78 -0
  214. beamlit/serve/middlewares/__init__.py +4 -0
  215. beamlit/serve/middlewares/accesslog.py +14 -0
  216. beamlit/serve/middlewares/processtime.py +12 -0
  217. {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/METADATA +11 -2
  218. beamlit-0.0.20.dist-info/RECORD +301 -0
  219. beamlit-0.0.18.dist-info/RECORD +0 -211
  220. /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
  221. {beamlit-0.0.18.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -37,7 +37,9 @@ class ModelProviderRef:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
40
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  kind = d.pop("kind", UNSET)
43
45
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -37,7 +37,9 @@ class ModelRelease:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
40
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  from_ = d.pop("from", UNSET)
43
45
 
@@ -0,0 +1,194 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
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
+ if TYPE_CHECKING:
9
+ from ..models.flavor import Flavor
10
+ from ..models.pod_template_spec import PodTemplateSpec
11
+ from ..models.runtime import Runtime
12
+ from ..models.serverless_config import ServerlessConfig
13
+ from ..models.spec_configuration import SpecConfiguration
14
+
15
+
16
+ T = TypeVar("T", bound="ModelSpec")
17
+
18
+
19
+ @_attrs_define
20
+ class ModelSpec:
21
+ """Model specification
22
+
23
+ Attributes:
24
+ configurations (Union[Unset, SpecConfiguration]): Agent configuration, this is a key value storage. In your
25
+ agent you can retrieve the value with config[key]
26
+ enabled (Union[Unset, bool]): Enable or disable the agent
27
+ flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
28
+ integration_connections (Union[Unset, List[str]]):
29
+ pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
30
+ policies (Union[Unset, List[str]]):
31
+ runtime (Union[Unset, Runtime]): Set of configurations for a deployment
32
+ serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
33
+ model_provider (Union[Unset, str]): Model provider name
34
+ """
35
+
36
+ configurations: Union[Unset, "SpecConfiguration"] = UNSET
37
+ enabled: Union[Unset, bool] = UNSET
38
+ flavors: Union[Unset, List["Flavor"]] = UNSET
39
+ integration_connections: Union[Unset, List[str]] = UNSET
40
+ pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
41
+ policies: Union[Unset, List[str]] = UNSET
42
+ runtime: Union[Unset, "Runtime"] = UNSET
43
+ serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
44
+ model_provider: Union[Unset, str] = UNSET
45
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
+
47
+ def to_dict(self) -> dict[str, Any]:
48
+ configurations: Union[Unset, Dict[str, Any]] = UNSET
49
+ if not isinstance(self.configurations, Unset):
50
+ configurations = self.configurations.to_dict()
51
+
52
+ enabled = self.enabled
53
+
54
+ flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
55
+ if not isinstance(self.flavors, Unset):
56
+ flavors = []
57
+ for componentsschemas_flavors_item_data in self.flavors:
58
+ componentsschemas_flavors_item = (
59
+ componentsschemas_flavors_item_data.to_dict()
60
+ )
61
+ flavors.append(componentsschemas_flavors_item)
62
+
63
+ integration_connections: Union[Unset, List[str]] = UNSET
64
+ if not isinstance(self.integration_connections, Unset):
65
+ integration_connections = self.integration_connections
66
+
67
+ pod_template: Union[Unset, Dict[str, Any]] = UNSET
68
+ if not isinstance(self.pod_template, Unset):
69
+ pod_template = self.pod_template.to_dict()
70
+
71
+ policies: Union[Unset, List[str]] = UNSET
72
+ if not isinstance(self.policies, Unset):
73
+ policies = self.policies
74
+
75
+ runtime: Union[Unset, Dict[str, Any]] = UNSET
76
+ if not isinstance(self.runtime, Unset):
77
+ runtime = self.runtime.to_dict()
78
+
79
+ serverless_config: Union[Unset, Dict[str, Any]] = UNSET
80
+ if not isinstance(self.serverless_config, Unset):
81
+ serverless_config = self.serverless_config.to_dict()
82
+
83
+ model_provider = self.model_provider
84
+
85
+ field_dict: dict[str, Any] = {}
86
+ field_dict.update(self.additional_properties)
87
+ field_dict.update({})
88
+ if configurations is not UNSET:
89
+ field_dict["configurations"] = configurations
90
+ if enabled is not UNSET:
91
+ field_dict["enabled"] = enabled
92
+ if flavors is not UNSET:
93
+ field_dict["flavors"] = flavors
94
+ if integration_connections is not UNSET:
95
+ field_dict["integrationConnections"] = integration_connections
96
+ if pod_template is not UNSET:
97
+ field_dict["podTemplate"] = pod_template
98
+ if policies is not UNSET:
99
+ field_dict["policies"] = policies
100
+ if runtime is not UNSET:
101
+ field_dict["runtime"] = runtime
102
+ if serverless_config is not UNSET:
103
+ field_dict["serverlessConfig"] = serverless_config
104
+ if model_provider is not UNSET:
105
+ field_dict["modelProvider"] = model_provider
106
+
107
+ return field_dict
108
+
109
+ @classmethod
110
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
111
+ from ..models.flavor import Flavor
112
+ from ..models.pod_template_spec import PodTemplateSpec
113
+ from ..models.runtime import Runtime
114
+ from ..models.serverless_config import ServerlessConfig
115
+ from ..models.spec_configuration import SpecConfiguration
116
+
117
+ d = src_dict.copy()
118
+ _configurations = d.pop("configurations", UNSET)
119
+ configurations: Union[Unset, SpecConfiguration]
120
+ if isinstance(_configurations, Unset):
121
+ configurations = UNSET
122
+ else:
123
+ configurations = SpecConfiguration.from_dict(_configurations)
124
+
125
+ enabled = d.pop("enabled", UNSET)
126
+
127
+ flavors = []
128
+ _flavors = d.pop("flavors", UNSET)
129
+ for componentsschemas_flavors_item_data in _flavors or []:
130
+ componentsschemas_flavors_item = Flavor.from_dict(
131
+ componentsschemas_flavors_item_data
132
+ )
133
+
134
+ flavors.append(componentsschemas_flavors_item)
135
+
136
+ integration_connections = cast(
137
+ List[str], d.pop("integrationConnections", UNSET)
138
+ )
139
+
140
+ _pod_template = d.pop("podTemplate", UNSET)
141
+ pod_template: Union[Unset, PodTemplateSpec]
142
+ if isinstance(_pod_template, Unset):
143
+ pod_template = UNSET
144
+ else:
145
+ pod_template = PodTemplateSpec.from_dict(_pod_template)
146
+
147
+ policies = cast(List[str], d.pop("policies", UNSET))
148
+
149
+ _runtime = d.pop("runtime", UNSET)
150
+ runtime: Union[Unset, Runtime]
151
+ if isinstance(_runtime, Unset):
152
+ runtime = UNSET
153
+ else:
154
+ runtime = Runtime.from_dict(_runtime)
155
+
156
+ _serverless_config = d.pop("serverlessConfig", UNSET)
157
+ serverless_config: Union[Unset, ServerlessConfig]
158
+ if isinstance(_serverless_config, Unset):
159
+ serverless_config = UNSET
160
+ else:
161
+ serverless_config = ServerlessConfig.from_dict(_serverless_config)
162
+
163
+ model_provider = d.pop("modelProvider", UNSET)
164
+
165
+ model_spec = cls(
166
+ configurations=configurations,
167
+ enabled=enabled,
168
+ flavors=flavors,
169
+ integration_connections=integration_connections,
170
+ pod_template=pod_template,
171
+ policies=policies,
172
+ runtime=runtime,
173
+ serverless_config=serverless_config,
174
+ model_provider=model_provider,
175
+ )
176
+
177
+ model_spec.additional_properties = d
178
+ return model_spec
179
+
180
+ @property
181
+ def additional_keys(self) -> list[str]:
182
+ return list(self.additional_properties.keys())
183
+
184
+ def __getitem__(self, key: str) -> Any:
185
+ return self.additional_properties[key]
186
+
187
+ def __setitem__(self, key: str, value: Any) -> None:
188
+ self.additional_properties[key] = value
189
+
190
+ def __delitem__(self, key: str) -> None:
191
+ del self.additional_properties[key]
192
+
193
+ def __contains__(self, key: str) -> bool:
194
+ return key in self.additional_properties
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -26,7 +26,7 @@ class ModelWithDeployments:
26
26
  labels (Union['LabelsType0', None, Unset]): Labels
27
27
  name (Union[Unset, str]): Model name
28
28
  workspace (Union[Unset, str]): The workspace the model belongs to
29
- deployments (Union[Unset, List['ModelDeployment']]):
29
+ deployments (Union[Unset, list['ModelDeployment']]):
30
30
  """
31
31
 
32
32
  created_at: Union[Unset, str] = UNSET
@@ -37,7 +37,7 @@ class ModelWithDeployments:
37
37
  labels: Union["LabelsType0", None, Unset] = UNSET
38
38
  name: Union[Unset, str] = UNSET
39
39
  workspace: Union[Unset, str] = UNSET
40
- deployments: Union[Unset, List["ModelDeployment"]] = UNSET
40
+ deployments: Union[Unset, list["ModelDeployment"]] = UNSET
41
41
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
42
42
 
43
43
  def to_dict(self) -> dict[str, Any]:
@@ -53,7 +53,7 @@ class ModelWithDeployments:
53
53
 
54
54
  display_name = self.display_name
55
55
 
56
- labels: Union[Dict[str, Any], None, Unset]
56
+ labels: Union[None, Unset, dict[str, Any]]
57
57
  if isinstance(self.labels, Unset):
58
58
  labels = UNSET
59
59
  elif isinstance(self.labels, LabelsType0):
@@ -65,7 +65,7 @@ class ModelWithDeployments:
65
65
 
66
66
  workspace = self.workspace
67
67
 
68
- deployments: Union[Unset, List[Dict[str, Any]]] = UNSET
68
+ deployments: Union[Unset, list[dict[str, Any]]] = UNSET
69
69
  if not isinstance(self.deployments, Unset):
70
70
  deployments = []
71
71
  for componentsschemas_model_deployments_item_data in self.deployments:
@@ -97,10 +97,12 @@ class ModelWithDeployments:
97
97
  return field_dict
98
98
 
99
99
  @classmethod
100
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
100
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
101
101
  from ..models.labels_type_0 import LabelsType0
102
102
  from ..models.model_deployment import ModelDeployment
103
103
 
104
+ if not src_dict:
105
+ return None
104
106
  d = src_dict.copy()
105
107
  created_at = d.pop("created_at", UNSET)
106
108
 
@@ -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="OwnerFields")
9
+
10
+
11
+ @_attrs_define
12
+ class OwnerFields:
13
+ """Owner fields for Persistance
14
+
15
+ Attributes:
16
+ created_by (Union[Unset, str]): The user or service account who created the resource
17
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
18
+ """
19
+
20
+ created_by: Union[Unset, str] = UNSET
21
+ updated_by: 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
+ created_by = self.created_by
26
+
27
+ updated_by = self.updated_by
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update({})
32
+ if created_by is not UNSET:
33
+ field_dict["createdBy"] = created_by
34
+ if updated_by is not UNSET:
35
+ field_dict["updatedBy"] = updated_by
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
+ created_by = d.pop("createdBy", UNSET)
43
+
44
+ updated_by = d.pop("updatedBy", UNSET)
45
+
46
+ owner_fields = cls(
47
+ created_by=created_by,
48
+ updated_by=updated_by,
49
+ )
50
+
51
+ owner_fields.additional_properties = d
52
+ return owner_fields
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
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -73,7 +73,9 @@ class PendingInvitation:
73
73
  return field_dict
74
74
 
75
75
  @classmethod
76
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
76
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
77
+ if not src_dict:
78
+ return None
77
79
  d = src_dict.copy()
78
80
  created_at = d.pop("created_at", UNSET)
79
81
 
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -28,7 +28,7 @@ class PendingInvitationAccept:
28
28
  def to_dict(self) -> dict[str, Any]:
29
29
  email = self.email
30
30
 
31
- workspace: Union[Unset, Dict[str, Any]] = UNSET
31
+ workspace: Union[Unset, dict[str, Any]] = UNSET
32
32
  if not isinstance(self.workspace, Unset):
33
33
  workspace = self.workspace.to_dict()
34
34
 
@@ -43,9 +43,11 @@ class PendingInvitationAccept:
43
43
  return field_dict
44
44
 
45
45
  @classmethod
46
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
46
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
47
47
  from ..models.workspace import Workspace
48
48
 
49
+ if not src_dict:
50
+ return None
49
51
  d = src_dict.copy()
50
52
  email = d.pop("email", UNSET)
51
53
 
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -40,17 +40,17 @@ class PendingInvitationRender:
40
40
 
41
41
  invited_at = self.invited_at
42
42
 
43
- invited_by: Union[Unset, Dict[str, Any]] = UNSET
43
+ invited_by: Union[Unset, dict[str, Any]] = UNSET
44
44
  if not isinstance(self.invited_by, Unset):
45
45
  invited_by = self.invited_by.to_dict()
46
46
 
47
47
  role = self.role
48
48
 
49
- workspace: Union[Unset, Dict[str, Any]] = UNSET
49
+ workspace: Union[Unset, dict[str, Any]] = UNSET
50
50
  if not isinstance(self.workspace, Unset):
51
51
  workspace = self.workspace.to_dict()
52
52
 
53
- workspace_details: Union[Unset, Dict[str, Any]] = UNSET
53
+ workspace_details: Union[Unset, dict[str, Any]] = UNSET
54
54
  if not isinstance(self.workspace_details, Unset):
55
55
  workspace_details = self.workspace_details.to_dict()
56
56
 
@@ -73,11 +73,13 @@ class PendingInvitationRender:
73
73
  return field_dict
74
74
 
75
75
  @classmethod
76
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
76
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
77
77
  from ..models.pending_invitation_render_invited_by import PendingInvitationRenderInvitedBy
78
78
  from ..models.pending_invitation_render_workspace import PendingInvitationRenderWorkspace
79
79
  from ..models.pending_invitation_workspace_details import PendingInvitationWorkspaceDetails
80
80
 
81
+ if not src_dict:
82
+ return None
81
83
  d = src_dict.copy()
82
84
  email = d.pop("email", UNSET)
83
85
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -49,7 +49,9 @@ class PendingInvitationRenderInvitedBy:
49
49
  return field_dict
50
50
 
51
51
  @classmethod
52
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
52
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
53
+ if not src_dict:
54
+ return None
53
55
  d = src_dict.copy()
54
56
  email = d.pop("email", UNSET)
55
57
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar, Union
1
+ from typing import Any, TypeVar, Union
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -37,7 +37,9 @@ class PendingInvitationRenderWorkspace:
37
37
  return field_dict
38
38
 
39
39
  @classmethod
40
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
40
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
41
43
  d = src_dict.copy()
42
44
  display_name = d.pop("display_name", UNSET)
43
45
 
@@ -1,4 +1,4 @@
1
- from typing import Any, List, Type, TypeVar, Union, cast
1
+ from typing import Any, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -13,16 +13,16 @@ class PendingInvitationWorkspaceDetails:
13
13
  """Workspace details
14
14
 
15
15
  Attributes:
16
- emails (Union[Unset, List[Any]]): List of user emails in the workspace
16
+ emails (Union[Unset, list[Any]]): List of user emails in the workspace
17
17
  user_number (Union[Unset, float]): Number of users in the workspace
18
18
  """
19
19
 
20
- emails: Union[Unset, List[Any]] = UNSET
20
+ emails: Union[Unset, list[Any]] = UNSET
21
21
  user_number: Union[Unset, float] = UNSET
22
22
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
23
 
24
24
  def to_dict(self) -> dict[str, Any]:
25
- emails: Union[Unset, List[Any]] = UNSET
25
+ emails: Union[Unset, list[Any]] = UNSET
26
26
  if not isinstance(self.emails, Unset):
27
27
  emails = self.emails
28
28
 
@@ -39,9 +39,11 @@ class PendingInvitationWorkspaceDetails:
39
39
  return field_dict
40
40
 
41
41
  @classmethod
42
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
42
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
43
+ if not src_dict:
44
+ return None
43
45
  d = src_dict.copy()
44
- emails = cast(List[Any], d.pop("emails", UNSET))
46
+ emails = cast(list[Any], d.pop("emails", UNSET))
45
47
 
46
48
  user_number = d.pop("user_number", UNSET)
47
49
 
@@ -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="PodTemplateSpec")
7
+
8
+
9
+ @_attrs_define
10
+ class PodTemplateSpec:
11
+ """Pod template specification"""
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
+ pod_template_spec = cls()
25
+
26
+ pod_template_spec.additional_properties = d
27
+ return pod_template_spec
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
beamlit/models/policy.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -24,13 +24,13 @@ class Policy:
24
24
  updated_at (Union[Unset, str]): The date and time when the resource was updated
25
25
  updated_by (Union[Unset, str]): The user or service account who updated the resource
26
26
  display_name (Union[Unset, str]): Policy display name
27
- flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
27
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
28
28
  labels (Union['LabelsType0', None, Unset]): Labels
29
- locations (Union[Unset, List['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
29
+ locations (Union[Unset, list['PolicyLocation']]): PolicyLocations is a local type that wraps a slice of Location
30
30
  name (Union[Unset, str]): Policy name
31
- resource_types (Union[Unset, List[str]]): PolicyResourceTypes is a local type that wraps a slice of
31
+ resource_types (Union[Unset, list[str]]): PolicyResourceTypes is a local type that wraps a slice of
32
32
  PolicyResourceType
33
- type (Union[Unset, str]): Policy type, can be location or flavor
33
+ type_ (Union[Unset, str]): Policy type, can be location or flavor
34
34
  workspace (Union[Unset, str]): The workspace the policy belongs to
35
35
  """
36
36
 
@@ -39,12 +39,12 @@ class Policy:
39
39
  updated_at: Union[Unset, str] = UNSET
40
40
  updated_by: Union[Unset, str] = UNSET
41
41
  display_name: Union[Unset, str] = UNSET
42
- flavors: Union[Unset, List["Flavor"]] = UNSET
42
+ flavors: Union[Unset, list["Flavor"]] = UNSET
43
43
  labels: Union["LabelsType0", None, Unset] = UNSET
44
- locations: Union[Unset, List["PolicyLocation"]] = UNSET
44
+ locations: Union[Unset, list["PolicyLocation"]] = UNSET
45
45
  name: Union[Unset, str] = UNSET
46
- resource_types: Union[Unset, List[str]] = UNSET
47
- type: Union[Unset, str] = UNSET
46
+ resource_types: Union[Unset, list[str]] = UNSET
47
+ type_: Union[Unset, str] = UNSET
48
48
  workspace: Union[Unset, str] = UNSET
49
49
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
50
50
 
@@ -61,14 +61,14 @@ class Policy:
61
61
 
62
62
  display_name = self.display_name
63
63
 
64
- flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
64
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
65
65
  if not isinstance(self.flavors, Unset):
66
66
  flavors = []
67
67
  for componentsschemas_flavors_item_data in self.flavors:
68
68
  componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
69
69
  flavors.append(componentsschemas_flavors_item)
70
70
 
71
- labels: Union[Dict[str, Any], None, Unset]
71
+ labels: Union[None, Unset, dict[str, Any]]
72
72
  if isinstance(self.labels, Unset):
73
73
  labels = UNSET
74
74
  elif isinstance(self.labels, LabelsType0):
@@ -76,7 +76,7 @@ class Policy:
76
76
  else:
77
77
  labels = self.labels
78
78
 
79
- locations: Union[Unset, List[Dict[str, Any]]] = UNSET
79
+ locations: Union[Unset, list[dict[str, Any]]] = UNSET
80
80
  if not isinstance(self.locations, Unset):
81
81
  locations = []
82
82
  for componentsschemas_policy_locations_item_data in self.locations:
@@ -85,11 +85,11 @@ class Policy:
85
85
 
86
86
  name = self.name
87
87
 
88
- resource_types: Union[Unset, List[str]] = UNSET
88
+ resource_types: Union[Unset, list[str]] = UNSET
89
89
  if not isinstance(self.resource_types, Unset):
90
90
  resource_types = self.resource_types
91
91
 
92
- type = self.type
92
+ type_ = self.type_
93
93
 
94
94
  workspace = self.workspace
95
95
 
@@ -116,19 +116,21 @@ class Policy:
116
116
  field_dict["name"] = name
117
117
  if resource_types is not UNSET:
118
118
  field_dict["resource_types"] = resource_types
119
- if type is not UNSET:
120
- field_dict["type"] = type
119
+ if type_ is not UNSET:
120
+ field_dict["type"] = type_
121
121
  if workspace is not UNSET:
122
122
  field_dict["workspace"] = workspace
123
123
 
124
124
  return field_dict
125
125
 
126
126
  @classmethod
127
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
127
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
128
128
  from ..models.flavor import Flavor
129
129
  from ..models.labels_type_0 import LabelsType0
130
130
  from ..models.policy_location import PolicyLocation
131
131
 
132
+ if not src_dict:
133
+ return None
132
134
  d = src_dict.copy()
133
135
  created_at = d.pop("created_at", UNSET)
134
136
 
@@ -175,9 +177,9 @@ class Policy:
175
177
 
176
178
  name = d.pop("name", UNSET)
177
179
 
178
- resource_types = cast(List[str], d.pop("resource_types", UNSET))
180
+ resource_types = cast(list[str], d.pop("resource_types", UNSET))
179
181
 
180
- type = d.pop("type", UNSET)
182
+ type_ = d.pop("type", UNSET)
181
183
 
182
184
  workspace = d.pop("workspace", UNSET)
183
185
 
@@ -192,7 +194,7 @@ class Policy:
192
194
  locations=locations,
193
195
  name=name,
194
196
  resource_types=resource_types,
195
- type=type,
197
+ type_=type_,
196
198
  workspace=workspace,
197
199
  )
198
200