beamlit 0.0.19__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.19.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.19.dist-info/RECORD +0 -211
  220. /beamlit/api/{authentication_providers → integrations}/__init__.py +0 -0
  221. {beamlit-0.0.19.dist-info → beamlit-0.0.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,176 @@
1
+ from typing import TYPE_CHECKING, Any, 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.agent_deployment import AgentDeployment
10
+ from ..models.labels_type_0 import LabelsType0
11
+
12
+
13
+ T = TypeVar("T", bound="AgentWithDeployments")
14
+
15
+
16
+ @_attrs_define
17
+ class AgentWithDeployments:
18
+ """Logical object representing an agent but with deployment definition inside
19
+
20
+ Attributes:
21
+ created_at (Union[Unset, str]): The date and time when the resource was created
22
+ created_by (Union[Unset, str]): The user or service account who created the resource
23
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
24
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
25
+ display_name (Union[Unset, str]): Agent display name
26
+ labels (Union['LabelsType0', None, Unset]): Labels
27
+ name (Union[Unset, str]): Agent name
28
+ workspace (Union[Unset, str]): Workspace name
29
+ deployments (Union[Unset, list['AgentDeployment']]):
30
+ """
31
+
32
+ created_at: Union[Unset, str] = UNSET
33
+ created_by: Union[Unset, str] = UNSET
34
+ updated_at: Union[Unset, str] = UNSET
35
+ updated_by: Union[Unset, str] = UNSET
36
+ display_name: Union[Unset, str] = UNSET
37
+ labels: Union["LabelsType0", None, Unset] = UNSET
38
+ name: Union[Unset, str] = UNSET
39
+ workspace: Union[Unset, str] = UNSET
40
+ deployments: Union[Unset, list["AgentDeployment"]] = UNSET
41
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
42
+
43
+ def to_dict(self) -> dict[str, Any]:
44
+ from ..models.labels_type_0 import LabelsType0
45
+
46
+ created_at = self.created_at
47
+
48
+ created_by = self.created_by
49
+
50
+ updated_at = self.updated_at
51
+
52
+ updated_by = self.updated_by
53
+
54
+ display_name = self.display_name
55
+
56
+ labels: Union[None, Unset, dict[str, Any]]
57
+ if isinstance(self.labels, Unset):
58
+ labels = UNSET
59
+ elif isinstance(self.labels, LabelsType0):
60
+ labels = self.labels.to_dict()
61
+ else:
62
+ labels = self.labels
63
+
64
+ name = self.name
65
+
66
+ workspace = self.workspace
67
+
68
+ deployments: Union[Unset, list[dict[str, Any]]] = UNSET
69
+ if not isinstance(self.deployments, Unset):
70
+ deployments = []
71
+ for componentsschemas_agent_deployments_item_data in self.deployments:
72
+ componentsschemas_agent_deployments_item = componentsschemas_agent_deployments_item_data.to_dict()
73
+ deployments.append(componentsschemas_agent_deployments_item)
74
+
75
+ field_dict: dict[str, Any] = {}
76
+ field_dict.update(self.additional_properties)
77
+ field_dict.update({})
78
+ if created_at is not UNSET:
79
+ field_dict["created_at"] = created_at
80
+ if created_by is not UNSET:
81
+ field_dict["created_by"] = created_by
82
+ if updated_at is not UNSET:
83
+ field_dict["updated_at"] = updated_at
84
+ if updated_by is not UNSET:
85
+ field_dict["updated_by"] = updated_by
86
+ if display_name is not UNSET:
87
+ field_dict["display_name"] = display_name
88
+ if labels is not UNSET:
89
+ field_dict["labels"] = labels
90
+ if name is not UNSET:
91
+ field_dict["name"] = name
92
+ if workspace is not UNSET:
93
+ field_dict["workspace"] = workspace
94
+ if deployments is not UNSET:
95
+ field_dict["deployments"] = deployments
96
+
97
+ return field_dict
98
+
99
+ @classmethod
100
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
101
+ from ..models.agent_deployment import AgentDeployment
102
+ from ..models.labels_type_0 import LabelsType0
103
+
104
+ if not src_dict:
105
+ return None
106
+ d = src_dict.copy()
107
+ created_at = d.pop("created_at", UNSET)
108
+
109
+ created_by = d.pop("created_by", UNSET)
110
+
111
+ updated_at = d.pop("updated_at", UNSET)
112
+
113
+ updated_by = d.pop("updated_by", UNSET)
114
+
115
+ display_name = d.pop("display_name", UNSET)
116
+
117
+ def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
118
+ if data is None:
119
+ return data
120
+ if isinstance(data, Unset):
121
+ return data
122
+ try:
123
+ if not isinstance(data, dict):
124
+ raise TypeError()
125
+ componentsschemas_labels_type_0 = LabelsType0.from_dict(data)
126
+
127
+ return componentsschemas_labels_type_0
128
+ except: # noqa: E722
129
+ pass
130
+ return cast(Union["LabelsType0", None, Unset], data)
131
+
132
+ labels = _parse_labels(d.pop("labels", UNSET))
133
+
134
+ name = d.pop("name", UNSET)
135
+
136
+ workspace = d.pop("workspace", UNSET)
137
+
138
+ deployments = []
139
+ _deployments = d.pop("deployments", UNSET)
140
+ for componentsschemas_agent_deployments_item_data in _deployments or []:
141
+ componentsschemas_agent_deployments_item = AgentDeployment.from_dict(
142
+ componentsschemas_agent_deployments_item_data
143
+ )
144
+
145
+ deployments.append(componentsschemas_agent_deployments_item)
146
+
147
+ agent_with_deployments = cls(
148
+ created_at=created_at,
149
+ created_by=created_by,
150
+ updated_at=updated_at,
151
+ updated_by=updated_by,
152
+ display_name=display_name,
153
+ labels=labels,
154
+ name=name,
155
+ workspace=workspace,
156
+ deployments=deployments,
157
+ )
158
+
159
+ agent_with_deployments.additional_properties = d
160
+ return agent_with_deployments
161
+
162
+ @property
163
+ def additional_keys(self) -> list[str]:
164
+ return list(self.additional_properties.keys())
165
+
166
+ def __getitem__(self, key: str) -> Any:
167
+ return self.additional_properties[key]
168
+
169
+ def __setitem__(self, key: str, value: Any) -> None:
170
+ self.additional_properties[key] = value
171
+
172
+ def __delitem__(self, key: str) -> None:
173
+ del self.additional_properties[key]
174
+
175
+ def __contains__(self, key: str) -> bool:
176
+ return key in self.additional_properties
beamlit/models/api_key.py CHANGED
@@ -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
@@ -85,7 +85,9 @@ class ApiKey:
85
85
  return field_dict
86
86
 
87
87
  @classmethod
88
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
88
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
89
+ if not src_dict:
90
+ return None
89
91
  d = src_dict.copy()
90
92
  created_at = d.pop("created_at", UNSET)
91
93
 
@@ -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
@@ -21,7 +21,7 @@ class AuthenticationProviderModel:
21
21
  name (Union[Unset, str]): Provider model name
22
22
  pipeline_tag (Union[Unset, str]): Provider model pipeline tag
23
23
  private (Union[Unset, bool]): Provider model private
24
- tags (Union[Unset, List[str]]): Provider model tags
24
+ tags (Union[Unset, list[str]]): Provider model tags
25
25
  trending_score (Union[Unset, int]): Provider model trending score
26
26
  """
27
27
 
@@ -33,7 +33,7 @@ class AuthenticationProviderModel:
33
33
  name: Union[Unset, str] = UNSET
34
34
  pipeline_tag: Union[Unset, str] = UNSET
35
35
  private: Union[Unset, bool] = UNSET
36
- tags: Union[Unset, List[str]] = UNSET
36
+ tags: Union[Unset, list[str]] = UNSET
37
37
  trending_score: Union[Unset, int] = UNSET
38
38
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
39
 
@@ -54,7 +54,7 @@ class AuthenticationProviderModel:
54
54
 
55
55
  private = self.private
56
56
 
57
- tags: Union[Unset, List[str]] = UNSET
57
+ tags: Union[Unset, list[str]] = UNSET
58
58
  if not isinstance(self.tags, Unset):
59
59
  tags = self.tags
60
60
 
@@ -87,7 +87,9 @@ class AuthenticationProviderModel:
87
87
  return field_dict
88
88
 
89
89
  @classmethod
90
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
90
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
91
+ if not src_dict:
92
+ return None
91
93
  d = src_dict.copy()
92
94
  created_at = d.pop("created_at", UNSET)
93
95
 
@@ -105,7 +107,7 @@ class AuthenticationProviderModel:
105
107
 
106
108
  private = d.pop("private", UNSET)
107
109
 
108
- tags = cast(List[str], d.pop("tags", UNSET))
110
+ tags = cast(list[str], d.pop("tags", UNSET))
109
111
 
110
112
  trending_score = d.pop("trending_score", UNSET)
111
113
 
@@ -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 AuthenticationProviderOrganization:
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
  avatar_url = d.pop("avatar_url", UNSET)
55
57
 
@@ -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,20 +13,20 @@ class Configuration:
13
13
  """Configuration
14
14
 
15
15
  Attributes:
16
- continents (Union[Unset, List[Any]]): Continents
17
- countries (Union[Unset, List[Any]]): Countries
16
+ continents (Union[Unset, list[Any]]): Continents
17
+ countries (Union[Unset, list[Any]]): Countries
18
18
  """
19
19
 
20
- continents: Union[Unset, List[Any]] = UNSET
21
- countries: Union[Unset, List[Any]] = UNSET
20
+ continents: Union[Unset, list[Any]] = UNSET
21
+ countries: Union[Unset, list[Any]] = 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
- continents: Union[Unset, List[Any]] = UNSET
25
+ continents: Union[Unset, list[Any]] = UNSET
26
26
  if not isinstance(self.continents, Unset):
27
27
  continents = self.continents
28
28
 
29
- countries: Union[Unset, List[Any]] = UNSET
29
+ countries: Union[Unset, list[Any]] = UNSET
30
30
  if not isinstance(self.countries, Unset):
31
31
  countries = self.countries
32
32
 
@@ -41,11 +41,13 @@ class Configuration:
41
41
  return field_dict
42
42
 
43
43
  @classmethod
44
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
44
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
45
+ if not src_dict:
46
+ return None
45
47
  d = src_dict.copy()
46
- continents = cast(List[Any], d.pop("continents", UNSET))
48
+ continents = cast(list[Any], d.pop("continents", UNSET))
47
49
 
48
- countries = cast(List[Any], d.pop("countries", UNSET))
50
+ countries = cast(list[Any], d.pop("countries", UNSET))
49
51
 
50
52
  configuration = cls(
51
53
  continents=continents,
@@ -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 Continent:
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
 
@@ -0,0 +1,185 @@
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="CoreSpec")
17
+
18
+
19
+ @_attrs_define
20
+ class CoreSpec:
21
+ """Core 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
+ """
34
+
35
+ configurations: Union[Unset, "SpecConfiguration"] = UNSET
36
+ enabled: Union[Unset, bool] = UNSET
37
+ flavors: Union[Unset, List["Flavor"]] = UNSET
38
+ integration_connections: Union[Unset, List[str]] = UNSET
39
+ pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
40
+ policies: Union[Unset, List[str]] = UNSET
41
+ runtime: Union[Unset, "Runtime"] = UNSET
42
+ serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
43
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
44
+
45
+ def to_dict(self) -> dict[str, Any]:
46
+ configurations: Union[Unset, Dict[str, Any]] = UNSET
47
+ if not isinstance(self.configurations, Unset):
48
+ configurations = self.configurations.to_dict()
49
+
50
+ enabled = self.enabled
51
+
52
+ flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
53
+ if not isinstance(self.flavors, Unset):
54
+ flavors = []
55
+ for componentsschemas_flavors_item_data in self.flavors:
56
+ componentsschemas_flavors_item = (
57
+ componentsschemas_flavors_item_data.to_dict()
58
+ )
59
+ flavors.append(componentsschemas_flavors_item)
60
+
61
+ integration_connections: Union[Unset, List[str]] = UNSET
62
+ if not isinstance(self.integration_connections, Unset):
63
+ integration_connections = self.integration_connections
64
+
65
+ pod_template: Union[Unset, Dict[str, Any]] = UNSET
66
+ if not isinstance(self.pod_template, Unset):
67
+ pod_template = self.pod_template.to_dict()
68
+
69
+ policies: Union[Unset, List[str]] = UNSET
70
+ if not isinstance(self.policies, Unset):
71
+ policies = self.policies
72
+
73
+ runtime: Union[Unset, Dict[str, Any]] = UNSET
74
+ if not isinstance(self.runtime, Unset):
75
+ runtime = self.runtime.to_dict()
76
+
77
+ serverless_config: Union[Unset, Dict[str, Any]] = UNSET
78
+ if not isinstance(self.serverless_config, Unset):
79
+ serverless_config = self.serverless_config.to_dict()
80
+
81
+ field_dict: dict[str, Any] = {}
82
+ field_dict.update(self.additional_properties)
83
+ field_dict.update({})
84
+ if configurations is not UNSET:
85
+ field_dict["configurations"] = configurations
86
+ if enabled is not UNSET:
87
+ field_dict["enabled"] = enabled
88
+ if flavors is not UNSET:
89
+ field_dict["flavors"] = flavors
90
+ if integration_connections is not UNSET:
91
+ field_dict["integrationConnections"] = integration_connections
92
+ if pod_template is not UNSET:
93
+ field_dict["podTemplate"] = pod_template
94
+ if policies is not UNSET:
95
+ field_dict["policies"] = policies
96
+ if runtime is not UNSET:
97
+ field_dict["runtime"] = runtime
98
+ if serverless_config is not UNSET:
99
+ field_dict["serverlessConfig"] = serverless_config
100
+
101
+ return field_dict
102
+
103
+ @classmethod
104
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
105
+ from ..models.flavor import Flavor
106
+ from ..models.pod_template_spec import PodTemplateSpec
107
+ from ..models.runtime import Runtime
108
+ from ..models.serverless_config import ServerlessConfig
109
+ from ..models.spec_configuration import SpecConfiguration
110
+
111
+ d = src_dict.copy()
112
+ _configurations = d.pop("configurations", UNSET)
113
+ configurations: Union[Unset, SpecConfiguration]
114
+ if isinstance(_configurations, Unset):
115
+ configurations = UNSET
116
+ else:
117
+ configurations = SpecConfiguration.from_dict(_configurations)
118
+
119
+ enabled = d.pop("enabled", UNSET)
120
+
121
+ flavors = []
122
+ _flavors = d.pop("flavors", UNSET)
123
+ for componentsschemas_flavors_item_data in _flavors or []:
124
+ componentsschemas_flavors_item = Flavor.from_dict(
125
+ componentsschemas_flavors_item_data
126
+ )
127
+
128
+ flavors.append(componentsschemas_flavors_item)
129
+
130
+ integration_connections = cast(
131
+ List[str], d.pop("integrationConnections", UNSET)
132
+ )
133
+
134
+ _pod_template = d.pop("podTemplate", UNSET)
135
+ pod_template: Union[Unset, PodTemplateSpec]
136
+ if isinstance(_pod_template, Unset):
137
+ pod_template = UNSET
138
+ else:
139
+ pod_template = PodTemplateSpec.from_dict(_pod_template)
140
+
141
+ policies = cast(List[str], d.pop("policies", UNSET))
142
+
143
+ _runtime = d.pop("runtime", UNSET)
144
+ runtime: Union[Unset, Runtime]
145
+ if isinstance(_runtime, Unset):
146
+ runtime = UNSET
147
+ else:
148
+ runtime = Runtime.from_dict(_runtime)
149
+
150
+ _serverless_config = d.pop("serverlessConfig", UNSET)
151
+ serverless_config: Union[Unset, ServerlessConfig]
152
+ if isinstance(_serverless_config, Unset):
153
+ serverless_config = UNSET
154
+ else:
155
+ serverless_config = ServerlessConfig.from_dict(_serverless_config)
156
+
157
+ core_spec = cls(
158
+ configurations=configurations,
159
+ enabled=enabled,
160
+ flavors=flavors,
161
+ integration_connections=integration_connections,
162
+ pod_template=pod_template,
163
+ policies=policies,
164
+ runtime=runtime,
165
+ serverless_config=serverless_config,
166
+ )
167
+
168
+ core_spec.additional_properties = d
169
+ return core_spec
170
+
171
+ @property
172
+ def additional_keys(self) -> list[str]:
173
+ return list(self.additional_properties.keys())
174
+
175
+ def __getitem__(self, key: str) -> Any:
176
+ return self.additional_properties[key]
177
+
178
+ def __setitem__(self, key: str, value: Any) -> None:
179
+ self.additional_properties[key] = value
180
+
181
+ def __delitem__(self, key: str) -> None:
182
+ del self.additional_properties[key]
183
+
184
+ def __contains__(self, key: str) -> bool:
185
+ return key in self.additional_properties
beamlit/models/country.py CHANGED
@@ -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 Country:
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, 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
@@ -36,7 +36,9 @@ class CreateApiKeyForServiceAccountBody:
36
36
  return field_dict
37
37
 
38
38
  @classmethod
39
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
39
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
40
+ if not src_dict:
41
+ return None
40
42
  d = src_dict.copy()
41
43
  expires_in = d.pop("expires_in", UNSET)
42
44
 
@@ -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
@@ -38,7 +38,9 @@ class CreateWorkspaceServiceAccountBody:
38
38
  return field_dict
39
39
 
40
40
  @classmethod
41
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
41
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
42
+ if not src_dict:
43
+ return None
42
44
  d = src_dict.copy()
43
45
  name = d.pop("name")
44
46
 
@@ -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
@@ -60,7 +60,9 @@ class CreateWorkspaceServiceAccountResponse200:
60
60
  return field_dict
61
61
 
62
62
  @classmethod
63
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
63
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
64
+ if not src_dict:
65
+ return None
64
66
  d = src_dict.copy()
65
67
  client_id = d.pop("client_id", UNSET)
66
68
 
@@ -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
@@ -54,7 +54,9 @@ class DeleteWorkspaceServiceAccountResponse200:
54
54
  return field_dict
55
55
 
56
56
  @classmethod
57
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
57
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
58
+ if not src_dict:
59
+ return None
58
60
  d = src_dict.copy()
59
61
  client_id = d.pop("client_id", UNSET)
60
62
 
@@ -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 DeploymentConfiguration:
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
  secret = d.pop("secret", UNSET)
43
45
 
@@ -1,8 +1,12 @@
1
- from typing import Any, Type, TypeVar
1
+ from typing import TYPE_CHECKING, Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
5
5
 
6
+ if TYPE_CHECKING:
7
+ from ..models.deployment_configuration import DeploymentConfiguration
8
+
9
+
6
10
  T = TypeVar("T", bound="DeploymentConfigurations")
7
11
 
8
12
 
@@ -10,30 +14,41 @@ T = TypeVar("T", bound="DeploymentConfigurations")
10
14
  class DeploymentConfigurations:
11
15
  """Deployment configurations key value and also a boolean secret to specify if it should be stored in secret manager"""
12
16
 
13
- additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
17
+ additional_properties: dict[str, "DeploymentConfiguration"] = _attrs_field(init=False, factory=dict)
14
18
 
15
19
  def to_dict(self) -> dict[str, Any]:
16
20
  field_dict: dict[str, Any] = {}
17
- field_dict.update(self.additional_properties)
21
+ for prop_name, prop in self.additional_properties.items():
22
+ field_dict[prop_name] = prop.to_dict()
18
23
 
19
24
  return field_dict
20
25
 
21
26
  @classmethod
22
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
27
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
28
+ from ..models.deployment_configuration import DeploymentConfiguration
29
+
30
+ if not src_dict:
31
+ return None
23
32
  d = src_dict.copy()
24
33
  deployment_configurations = cls()
25
34
 
26
- deployment_configurations.additional_properties = d
35
+ additional_properties = {}
36
+ for prop_name, prop_dict in d.items():
37
+ additional_property = DeploymentConfiguration.from_dict(prop_dict)
38
+
39
+ additional_properties[prop_name] = additional_property
40
+
41
+ deployment_configurations.additional_properties = additional_properties
27
42
  return deployment_configurations
28
43
 
29
44
  @property
30
45
  def additional_keys(self) -> list[str]:
31
46
  return list(self.additional_properties.keys())
32
47
 
33
- def __getitem__(self, key: str) -> str:
48
+ def __getitem__(self, key: str) -> "DeploymentConfiguration":
34
49
  return self.additional_properties[key]
35
50
 
36
- def __setitem__(self, key: str, value: str) -> None:
51
+ def __setitem__(self, key: str, value: "DeploymentConfiguration") -> None:
37
52
  self.additional_properties[key] = value
38
53
 
39
54
  def __delitem__(self, key: str) -> None: