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
beamlit/models/model.py CHANGED
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, 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
@@ -50,7 +50,7 @@ class Model:
50
50
 
51
51
  display_name = self.display_name
52
52
 
53
- labels: Union[Dict[str, Any], None, Unset]
53
+ labels: Union[None, Unset, dict[str, Any]]
54
54
  if isinstance(self.labels, Unset):
55
55
  labels = UNSET
56
56
  elif isinstance(self.labels, LabelsType0):
@@ -85,9 +85,11 @@ class Model:
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
89
  from ..models.labels_type_0 import LabelsType0
90
90
 
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
 
@@ -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
@@ -28,14 +28,15 @@ class ModelDeployment:
28
28
  updated_by (Union[Unset, str]): The user or service account who updated the resource
29
29
  enabled (Union[Unset, bool]): If false, the model deployment will not be active nor serve requests
30
30
  environment (Union[Unset, str]): The name of the environment in which the model deployment is deployed
31
- flavors (Union[Unset, List['Flavor']]): Types of hardware available for deployments
31
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
32
+ integration_connections (Union[Unset, list[str]]):
32
33
  labels (Union['LabelsType0', None, Unset]): Labels
33
34
  metric_port (Union[Unset, int]): The port to serve the metrics on
34
35
  model (Union[Unset, str]): The name of the parent model
35
36
  model_provider_ref (Union[Unset, ModelProviderRef]): Reference to a model provider
36
37
  pod_template (Union[Unset, ModelDeploymentPodTemplate]): The pod template for the deployment. Should be a
37
38
  Kubernetes PodTemplateSpec
38
- policies (Union[Unset, List[str]]):
39
+ policies (Union[Unset, list[str]]):
39
40
  runtime (Union[Unset, Runtime]): Set of configurations for a deployment
40
41
  serverless_config (Union[Unset, DeploymentServerlessConfig]): Configuration for a serverless deployment
41
42
  serving_port (Union[Unset, int]): The port to serve the model on
@@ -48,13 +49,14 @@ class ModelDeployment:
48
49
  updated_by: Union[Unset, str] = UNSET
49
50
  enabled: Union[Unset, bool] = UNSET
50
51
  environment: Union[Unset, str] = UNSET
51
- flavors: Union[Unset, List["Flavor"]] = UNSET
52
+ flavors: Union[Unset, list["Flavor"]] = UNSET
53
+ integration_connections: Union[Unset, list[str]] = UNSET
52
54
  labels: Union["LabelsType0", None, Unset] = UNSET
53
55
  metric_port: Union[Unset, int] = UNSET
54
56
  model: Union[Unset, str] = UNSET
55
57
  model_provider_ref: Union[Unset, "ModelProviderRef"] = UNSET
56
58
  pod_template: Union[Unset, "ModelDeploymentPodTemplate"] = UNSET
57
- policies: Union[Unset, List[str]] = UNSET
59
+ policies: Union[Unset, list[str]] = UNSET
58
60
  runtime: Union[Unset, "Runtime"] = UNSET
59
61
  serverless_config: Union[Unset, "DeploymentServerlessConfig"] = UNSET
60
62
  serving_port: Union[Unset, int] = UNSET
@@ -76,14 +78,18 @@ class ModelDeployment:
76
78
 
77
79
  environment = self.environment
78
80
 
79
- flavors: Union[Unset, List[Dict[str, Any]]] = UNSET
81
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
80
82
  if not isinstance(self.flavors, Unset):
81
83
  flavors = []
82
84
  for componentsschemas_flavors_item_data in self.flavors:
83
85
  componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
84
86
  flavors.append(componentsschemas_flavors_item)
85
87
 
86
- labels: Union[Dict[str, Any], None, Unset]
88
+ integration_connections: Union[Unset, list[str]] = UNSET
89
+ if not isinstance(self.integration_connections, Unset):
90
+ integration_connections = self.integration_connections
91
+
92
+ labels: Union[None, Unset, dict[str, Any]]
87
93
  if isinstance(self.labels, Unset):
88
94
  labels = UNSET
89
95
  elif isinstance(self.labels, LabelsType0):
@@ -95,23 +101,23 @@ class ModelDeployment:
95
101
 
96
102
  model = self.model
97
103
 
98
- model_provider_ref: Union[Unset, Dict[str, Any]] = UNSET
104
+ model_provider_ref: Union[Unset, dict[str, Any]] = UNSET
99
105
  if not isinstance(self.model_provider_ref, Unset):
100
106
  model_provider_ref = self.model_provider_ref.to_dict()
101
107
 
102
- pod_template: Union[Unset, Dict[str, Any]] = UNSET
108
+ pod_template: Union[Unset, dict[str, Any]] = UNSET
103
109
  if not isinstance(self.pod_template, Unset):
104
110
  pod_template = self.pod_template.to_dict()
105
111
 
106
- policies: Union[Unset, List[str]] = UNSET
112
+ policies: Union[Unset, list[str]] = UNSET
107
113
  if not isinstance(self.policies, Unset):
108
114
  policies = self.policies
109
115
 
110
- runtime: Union[Unset, Dict[str, Any]] = UNSET
116
+ runtime: Union[Unset, dict[str, Any]] = UNSET
111
117
  if not isinstance(self.runtime, Unset):
112
118
  runtime = self.runtime.to_dict()
113
119
 
114
- serverless_config: Union[Unset, Dict[str, Any]] = UNSET
120
+ serverless_config: Union[Unset, dict[str, Any]] = UNSET
115
121
  if not isinstance(self.serverless_config, Unset):
116
122
  serverless_config = self.serverless_config.to_dict()
117
123
 
@@ -136,6 +142,8 @@ class ModelDeployment:
136
142
  field_dict["environment"] = environment
137
143
  if flavors is not UNSET:
138
144
  field_dict["flavors"] = flavors
145
+ if integration_connections is not UNSET:
146
+ field_dict["integration_connections"] = integration_connections
139
147
  if labels is not UNSET:
140
148
  field_dict["labels"] = labels
141
149
  if metric_port is not UNSET:
@@ -160,7 +168,7 @@ class ModelDeployment:
160
168
  return field_dict
161
169
 
162
170
  @classmethod
163
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
171
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
164
172
  from ..models.deployment_serverless_config import DeploymentServerlessConfig
165
173
  from ..models.flavor import Flavor
166
174
  from ..models.labels_type_0 import LabelsType0
@@ -168,6 +176,8 @@ class ModelDeployment:
168
176
  from ..models.model_provider_ref import ModelProviderRef
169
177
  from ..models.runtime import Runtime
170
178
 
179
+ if not src_dict:
180
+ return None
171
181
  d = src_dict.copy()
172
182
  created_at = d.pop("created_at", UNSET)
173
183
 
@@ -188,6 +198,8 @@ class ModelDeployment:
188
198
 
189
199
  flavors.append(componentsschemas_flavors_item)
190
200
 
201
+ integration_connections = cast(list[str], d.pop("integration_connections", UNSET))
202
+
191
203
  def _parse_labels(data: object) -> Union["LabelsType0", None, Unset]:
192
204
  if data is None:
193
205
  return data
@@ -223,7 +235,7 @@ class ModelDeployment:
223
235
  else:
224
236
  pod_template = ModelDeploymentPodTemplate.from_dict(_pod_template)
225
237
 
226
- policies = cast(List[str], d.pop("policies", UNSET))
238
+ policies = cast(list[str], d.pop("policies", UNSET))
227
239
 
228
240
  _runtime = d.pop("runtime", UNSET)
229
241
  runtime: Union[Unset, Runtime]
@@ -251,6 +263,7 @@ class ModelDeployment:
251
263
  enabled=enabled,
252
264
  environment=environment,
253
265
  flavors=flavors,
266
+ integration_connections=integration_connections,
254
267
  labels=labels,
255
268
  metric_port=metric_port,
256
269
  model=model,
@@ -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 ModelDeploymentLog:
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
  message = d.pop("message", UNSET)
43
45
 
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, 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
@@ -24,7 +24,7 @@ class ModelDeploymentMetrics:
24
24
  """Metrics for a single model deployment
25
25
 
26
26
  Attributes:
27
- inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
27
+ inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
28
28
  inference_per_second_per_region (Union[Unset, ModelDeploymentMetricsInferencePerSecondPerRegion]): Historical
29
29
  requests per second (RPS) per location, for the model deployment
30
30
  query_per_second_global (Union[Unset, float]): RPS value (in last 24 hours) for the model deployment globally
@@ -36,7 +36,7 @@ class ModelDeploymentMetrics:
36
36
  value (in last 24 hours) per response status code per location, for the model deployment
37
37
  """
38
38
 
39
- inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
39
+ inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
40
40
  inference_per_second_per_region: Union[Unset, "ModelDeploymentMetricsInferencePerSecondPerRegion"] = UNSET
41
41
  query_per_second_global: Union[Unset, float] = UNSET
42
42
  query_per_second_per_code_global: Union[Unset, "QPS"] = UNSET
@@ -45,28 +45,28 @@ class ModelDeploymentMetrics:
45
45
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
46
 
47
47
  def to_dict(self) -> dict[str, Any]:
48
- inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
48
+ inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
49
49
  if not isinstance(self.inference_per_second_global, Unset):
50
50
  inference_per_second_global = []
51
51
  for componentsschemas_array_metric_item_data in self.inference_per_second_global:
52
52
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
53
53
  inference_per_second_global.append(componentsschemas_array_metric_item)
54
54
 
55
- inference_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
55
+ inference_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
56
56
  if not isinstance(self.inference_per_second_per_region, Unset):
57
57
  inference_per_second_per_region = self.inference_per_second_per_region.to_dict()
58
58
 
59
59
  query_per_second_global = self.query_per_second_global
60
60
 
61
- query_per_second_per_code_global: Union[Unset, Dict[str, Any]] = UNSET
61
+ query_per_second_per_code_global: Union[Unset, dict[str, Any]] = UNSET
62
62
  if not isinstance(self.query_per_second_per_code_global, Unset):
63
63
  query_per_second_per_code_global = self.query_per_second_per_code_global.to_dict()
64
64
 
65
- query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
65
+ query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
66
66
  if not isinstance(self.query_per_second_per_region, Unset):
67
67
  query_per_second_per_region = self.query_per_second_per_region.to_dict()
68
68
 
69
- query_per_second_per_region_per_code: Union[Unset, Dict[str, Any]] = UNSET
69
+ query_per_second_per_region_per_code: Union[Unset, dict[str, Any]] = UNSET
70
70
  if not isinstance(self.query_per_second_per_region_per_code, Unset):
71
71
  query_per_second_per_region_per_code = self.query_per_second_per_region_per_code.to_dict()
72
72
 
@@ -89,7 +89,7 @@ class ModelDeploymentMetrics:
89
89
  return field_dict
90
90
 
91
91
  @classmethod
92
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
92
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
93
93
  from ..models.metric import Metric
94
94
  from ..models.model_deployment_metrics_inference_per_second_per_region import (
95
95
  ModelDeploymentMetricsInferencePerSecondPerRegion,
@@ -99,6 +99,8 @@ class ModelDeploymentMetrics:
99
99
  )
100
100
  from ..models.qps import QPS
101
101
 
102
+ if not src_dict:
103
+ return None
102
104
  d = src_dict.copy()
103
105
  inference_per_second_global = []
104
106
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, 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
@@ -17,14 +17,14 @@ class ModelDeploymentMetricsInferencePerSecondPerRegion:
17
17
  """Historical requests per second (RPS) per location, for the model deployment
18
18
 
19
19
  Attributes:
20
- region (Union[Unset, List['Metric']]): Array of metrics
20
+ region (Union[Unset, list['Metric']]): Array of metrics
21
21
  """
22
22
 
23
- region: Union[Unset, List["Metric"]] = UNSET
23
+ region: Union[Unset, list["Metric"]] = UNSET
24
24
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25
25
 
26
26
  def to_dict(self) -> dict[str, Any]:
27
- region: Union[Unset, List[Dict[str, Any]]] = UNSET
27
+ region: Union[Unset, list[dict[str, Any]]] = UNSET
28
28
  if not isinstance(self.region, Unset):
29
29
  region = []
30
30
  for componentsschemas_array_metric_item_data in self.region:
@@ -40,9 +40,11 @@ class ModelDeploymentMetricsInferencePerSecondPerRegion:
40
40
  return field_dict
41
41
 
42
42
  @classmethod
43
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
43
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
44
44
  from ..models.metric import Metric
45
45
 
46
+ if not src_dict:
47
+ return None
46
48
  d = src_dict.copy()
47
49
  region = []
48
50
  _region = d.pop("region", UNSET)
@@ -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
@@ -25,7 +25,7 @@ class ModelDeploymentMetricsQueryPerSecondPerRegionPerCode:
25
25
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
26
 
27
27
  def to_dict(self) -> dict[str, Any]:
28
- region: Union[Unset, Dict[str, Any]] = UNSET
28
+ region: Union[Unset, dict[str, Any]] = UNSET
29
29
  if not isinstance(self.region, Unset):
30
30
  region = self.region.to_dict()
31
31
 
@@ -38,9 +38,11 @@ class ModelDeploymentMetricsQueryPerSecondPerRegionPerCode:
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
42
  from ..models.qps import QPS
43
43
 
44
+ if not src_dict:
45
+ return None
44
46
  d = src_dict.copy()
45
47
  _region = d.pop("region", UNSET)
46
48
  region: Union[Unset, QPS]
@@ -1,4 +1,4 @@
1
- from typing import Any, Type, TypeVar
1
+ from typing import Any, TypeVar
2
2
 
3
3
  from attrs import define as _attrs_define
4
4
  from attrs import field as _attrs_field
@@ -19,7 +19,9 @@ class ModelDeploymentPodTemplate:
19
19
  return field_dict
20
20
 
21
21
  @classmethod
22
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
23
25
  d = src_dict.copy()
24
26
  model_deployment_pod_template = cls()
25
27
 
@@ -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="ModelDeploymentPodTemplateType0")
7
+
8
+
9
+ @_attrs_define
10
+ class ModelDeploymentPodTemplateType0:
11
+ """The pod template for the deployment. Should be a Kubernetes PodTemplateSpec"""
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
+ model_deployment_pod_template_type_0 = cls()
25
+
26
+ model_deployment_pod_template_type_0.additional_properties = d
27
+ return model_deployment_pod_template_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,144 @@
1
+ from typing import TYPE_CHECKING, Any, Dict, 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
+ if TYPE_CHECKING:
9
+ from ..models.metadata_labels import MetadataLabels
10
+
11
+
12
+ T = TypeVar("T", bound="ModelMetadata")
13
+
14
+
15
+ @_attrs_define
16
+ class ModelMetadata:
17
+ """Model metadata
18
+
19
+ Attributes:
20
+ created_at (Union[Unset, str]): The date and time when the resource was created
21
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
22
+ created_by (Union[Unset, str]): The user or service account who created the resource
23
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
24
+ display_name (Union[Unset, str]): Model display name
25
+ labels (Union[Unset, MetadataLabels]): Labels
26
+ name (Union[Unset, str]): Model name
27
+ workspace (Union[Unset, str]): Workspace name
28
+ environment (Union[Unset, str]): Environment name
29
+ """
30
+
31
+ created_at: Union[Unset, str] = UNSET
32
+ updated_at: Union[Unset, str] = UNSET
33
+ created_by: Union[Unset, str] = UNSET
34
+ updated_by: Union[Unset, str] = UNSET
35
+ display_name: Union[Unset, str] = UNSET
36
+ labels: Union[Unset, "MetadataLabels"] = UNSET
37
+ name: Union[Unset, str] = UNSET
38
+ workspace: Union[Unset, str] = UNSET
39
+ environment: Union[Unset, str] = UNSET
40
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ created_at = self.created_at
44
+
45
+ updated_at = self.updated_at
46
+
47
+ created_by = self.created_by
48
+
49
+ updated_by = self.updated_by
50
+
51
+ display_name = self.display_name
52
+
53
+ labels: Union[Unset, Dict[str, Any]] = UNSET
54
+ if not isinstance(self.labels, Unset):
55
+ labels = self.labels.to_dict()
56
+
57
+ name = self.name
58
+
59
+ workspace = self.workspace
60
+
61
+ environment = self.environment
62
+
63
+ field_dict: dict[str, Any] = {}
64
+ field_dict.update(self.additional_properties)
65
+ field_dict.update({})
66
+ if created_at is not UNSET:
67
+ field_dict["createdAt"] = created_at
68
+ if updated_at is not UNSET:
69
+ field_dict["updatedAt"] = updated_at
70
+ if created_by is not UNSET:
71
+ field_dict["createdBy"] = created_by
72
+ if updated_by is not UNSET:
73
+ field_dict["updatedBy"] = updated_by
74
+ if display_name is not UNSET:
75
+ field_dict["displayName"] = display_name
76
+ if labels is not UNSET:
77
+ field_dict["labels"] = labels
78
+ if name is not UNSET:
79
+ field_dict["name"] = name
80
+ if workspace is not UNSET:
81
+ field_dict["workspace"] = workspace
82
+ if environment is not UNSET:
83
+ field_dict["environment"] = environment
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
89
+ from ..models.metadata_labels import MetadataLabels
90
+
91
+ d = src_dict.copy()
92
+ created_at = d.pop("createdAt", UNSET)
93
+
94
+ updated_at = d.pop("updatedAt", UNSET)
95
+
96
+ created_by = d.pop("createdBy", UNSET)
97
+
98
+ updated_by = d.pop("updatedBy", UNSET)
99
+
100
+ display_name = d.pop("displayName", UNSET)
101
+
102
+ _labels = d.pop("labels", UNSET)
103
+ labels: Union[Unset, MetadataLabels]
104
+ if isinstance(_labels, Unset):
105
+ labels = UNSET
106
+ else:
107
+ labels = MetadataLabels.from_dict(_labels)
108
+
109
+ name = d.pop("name", UNSET)
110
+
111
+ workspace = d.pop("workspace", UNSET)
112
+
113
+ environment = d.pop("environment", UNSET)
114
+
115
+ model_metadata = cls(
116
+ created_at=created_at,
117
+ updated_at=updated_at,
118
+ created_by=created_by,
119
+ updated_by=updated_by,
120
+ display_name=display_name,
121
+ labels=labels,
122
+ name=name,
123
+ workspace=workspace,
124
+ environment=environment,
125
+ )
126
+
127
+ model_metadata.additional_properties = d
128
+ return model_metadata
129
+
130
+ @property
131
+ def additional_keys(self) -> list[str]:
132
+ return list(self.additional_properties.keys())
133
+
134
+ def __getitem__(self, key: str) -> Any:
135
+ return self.additional_properties[key]
136
+
137
+ def __setitem__(self, key: str, value: Any) -> None:
138
+ self.additional_properties[key] = value
139
+
140
+ def __delitem__(self, key: str) -> None:
141
+ del self.additional_properties[key]
142
+
143
+ def __contains__(self, key: str) -> bool:
144
+ return key in self.additional_properties
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, List, 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
@@ -18,24 +18,24 @@ class ModelMetrics:
18
18
  """Metrics for a single model
19
19
 
20
20
  Attributes:
21
- inference_per_second_global (Union[Unset, List['Metric']]): Array of metrics
21
+ inference_per_second_global (Union[Unset, list['Metric']]): Array of metrics
22
22
  query_per_second_per_region (Union[Unset, QPS]): Query per second per element, can be per response status code
23
23
  (e.g. 200, 400) or per location
24
24
  """
25
25
 
26
- inference_per_second_global: Union[Unset, List["Metric"]] = UNSET
26
+ inference_per_second_global: Union[Unset, list["Metric"]] = UNSET
27
27
  query_per_second_per_region: Union[Unset, "QPS"] = UNSET
28
28
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
29
 
30
30
  def to_dict(self) -> dict[str, Any]:
31
- inference_per_second_global: Union[Unset, List[Dict[str, Any]]] = UNSET
31
+ inference_per_second_global: Union[Unset, list[dict[str, Any]]] = UNSET
32
32
  if not isinstance(self.inference_per_second_global, Unset):
33
33
  inference_per_second_global = []
34
34
  for componentsschemas_array_metric_item_data in self.inference_per_second_global:
35
35
  componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
36
36
  inference_per_second_global.append(componentsschemas_array_metric_item)
37
37
 
38
- query_per_second_per_region: Union[Unset, Dict[str, Any]] = UNSET
38
+ query_per_second_per_region: Union[Unset, dict[str, Any]] = UNSET
39
39
  if not isinstance(self.query_per_second_per_region, Unset):
40
40
  query_per_second_per_region = self.query_per_second_per_region.to_dict()
41
41
 
@@ -50,10 +50,12 @@ class ModelMetrics:
50
50
  return field_dict
51
51
 
52
52
  @classmethod
53
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
53
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
54
54
  from ..models.metric import Metric
55
55
  from ..models.qps import QPS
56
56
 
57
+ if not src_dict:
58
+ return None
57
59
  d = src_dict.copy()
58
60
  inference_per_second_global = []
59
61
  _inference_per_second_global = d.pop("inference_per_second_global", UNSET)
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, Dict, 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
@@ -27,7 +27,7 @@ class ModelProvider:
27
27
  display_name (Union[Unset, str]): Model provider display name
28
28
  labels (Union['LabelsType0', None, Unset]): Labels
29
29
  name (Union[Unset, str]): Model provider name
30
- type (Union[Unset, str]): Model provider type
30
+ type_ (Union[Unset, str]): Model provider type
31
31
  workspace (Union[Unset, str]): Workspace name
32
32
  """
33
33
 
@@ -40,7 +40,7 @@ class ModelProvider:
40
40
  display_name: Union[Unset, str] = UNSET
41
41
  labels: Union["LabelsType0", None, Unset] = UNSET
42
42
  name: Union[Unset, str] = UNSET
43
- type: Union[Unset, str] = UNSET
43
+ type_: Union[Unset, str] = UNSET
44
44
  workspace: Union[Unset, str] = UNSET
45
45
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
46
46
 
@@ -57,13 +57,13 @@ class ModelProvider:
57
57
 
58
58
  comment = self.comment
59
59
 
60
- config: Union[Unset, Dict[str, Any]] = UNSET
60
+ config: Union[Unset, dict[str, Any]] = UNSET
61
61
  if not isinstance(self.config, Unset):
62
62
  config = self.config.to_dict()
63
63
 
64
64
  display_name = self.display_name
65
65
 
66
- labels: Union[Dict[str, Any], None, Unset]
66
+ labels: Union[None, Unset, dict[str, Any]]
67
67
  if isinstance(self.labels, Unset):
68
68
  labels = UNSET
69
69
  elif isinstance(self.labels, LabelsType0):
@@ -73,7 +73,7 @@ class ModelProvider:
73
73
 
74
74
  name = self.name
75
75
 
76
- type = self.type
76
+ type_ = self.type_
77
77
 
78
78
  workspace = self.workspace
79
79
 
@@ -98,18 +98,20 @@ class ModelProvider:
98
98
  field_dict["labels"] = labels
99
99
  if name is not UNSET:
100
100
  field_dict["name"] = name
101
- if type is not UNSET:
102
- field_dict["type"] = type
101
+ if type_ is not UNSET:
102
+ field_dict["type"] = type_
103
103
  if workspace is not UNSET:
104
104
  field_dict["workspace"] = workspace
105
105
 
106
106
  return field_dict
107
107
 
108
108
  @classmethod
109
- def from_dict(cls: Type[T], src_dict: dict[str, Any]) -> T:
109
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
110
110
  from ..models.labels_type_0 import LabelsType0
111
111
  from ..models.provider_config import ProviderConfig
112
112
 
113
+ if not src_dict:
114
+ return None
113
115
  d = src_dict.copy()
114
116
  created_at = d.pop("created_at", UNSET)
115
117
 
@@ -149,7 +151,7 @@ class ModelProvider:
149
151
 
150
152
  name = d.pop("name", UNSET)
151
153
 
152
- type = d.pop("type", UNSET)
154
+ type_ = d.pop("type", UNSET)
153
155
 
154
156
  workspace = d.pop("workspace", UNSET)
155
157
 
@@ -163,7 +165,7 @@ class ModelProvider:
163
165
  display_name=display_name,
164
166
  labels=labels,
165
167
  name=name,
166
- type=type,
168
+ type_=type_,
167
169
  workspace=workspace,
168
170
  )
169
171