blaxel 0.64.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. blaxel/__init__.py +8 -0
  2. blaxel/agents/__init__.py +5 -0
  3. blaxel/agents/chain.py +153 -0
  4. blaxel/agents/chat.py +286 -0
  5. blaxel/agents/decorator.py +208 -0
  6. blaxel/agents/thread.py +24 -0
  7. blaxel/agents/voice/openai.py +255 -0
  8. blaxel/agents/voice/utils.py +25 -0
  9. blaxel/api/__init__.py +1 -0
  10. blaxel/api/agents/__init__.py +0 -0
  11. blaxel/api/agents/create_agent.py +155 -0
  12. blaxel/api/agents/delete_agent.py +146 -0
  13. blaxel/api/agents/get_agent.py +146 -0
  14. blaxel/api/agents/get_agent_logs.py +151 -0
  15. blaxel/api/agents/get_agent_metrics.py +150 -0
  16. blaxel/api/agents/get_agent_trace_ids.py +201 -0
  17. blaxel/api/agents/list_agent_revisions.py +155 -0
  18. blaxel/api/agents/list_agents.py +127 -0
  19. blaxel/api/agents/update_agent.py +168 -0
  20. blaxel/api/configurations/__init__.py +0 -0
  21. blaxel/api/configurations/get_configuration.py +122 -0
  22. blaxel/api/default/__init__.py +0 -0
  23. blaxel/api/default/get_trace.py +150 -0
  24. blaxel/api/default/get_trace_ids.py +218 -0
  25. blaxel/api/default/get_trace_logs.py +186 -0
  26. blaxel/api/default/list_mcp_hub_definitions.py +127 -0
  27. blaxel/api/functions/__init__.py +0 -0
  28. blaxel/api/functions/create_function.py +155 -0
  29. blaxel/api/functions/delete_function.py +146 -0
  30. blaxel/api/functions/get_function.py +146 -0
  31. blaxel/api/functions/get_function_logs.py +151 -0
  32. blaxel/api/functions/get_function_metrics.py +150 -0
  33. blaxel/api/functions/get_function_trace_ids.py +201 -0
  34. blaxel/api/functions/list_function_revisions.py +158 -0
  35. blaxel/api/functions/list_functions.py +131 -0
  36. blaxel/api/functions/update_function.py +168 -0
  37. blaxel/api/integrations/__init__.py +0 -0
  38. blaxel/api/integrations/create_integration_connection.py +167 -0
  39. blaxel/api/integrations/delete_integration_connection.py +158 -0
  40. blaxel/api/integrations/get_integration.py +97 -0
  41. blaxel/api/integrations/get_integration_connection.py +158 -0
  42. blaxel/api/integrations/get_integration_connection_model.py +104 -0
  43. blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
  44. blaxel/api/integrations/list_integration_connection_models.py +97 -0
  45. blaxel/api/integrations/list_integration_connections.py +139 -0
  46. blaxel/api/integrations/update_integration_connection.py +180 -0
  47. blaxel/api/invitations/__init__.py +0 -0
  48. blaxel/api/invitations/list_all_pending_invitations.py +142 -0
  49. blaxel/api/knowledgebases/__init__.py +0 -0
  50. blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
  51. blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
  52. blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
  53. blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
  54. blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
  55. blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
  56. blaxel/api/locations/__init__.py +0 -0
  57. blaxel/api/locations/list_locations.py +139 -0
  58. blaxel/api/metrics/__init__.py +0 -0
  59. blaxel/api/metrics/get_metrics.py +130 -0
  60. blaxel/api/models/__init__.py +0 -0
  61. blaxel/api/models/create_model.py +163 -0
  62. blaxel/api/models/delete_model.py +154 -0
  63. blaxel/api/models/get_model.py +154 -0
  64. blaxel/api/models/get_model_logs.py +155 -0
  65. blaxel/api/models/get_model_metrics.py +158 -0
  66. blaxel/api/models/get_model_trace_ids.py +201 -0
  67. blaxel/api/models/list_model_revisions.py +158 -0
  68. blaxel/api/models/list_models.py +135 -0
  69. blaxel/api/models/update_model.py +176 -0
  70. blaxel/api/policies/__init__.py +0 -0
  71. blaxel/api/policies/create_policy.py +167 -0
  72. blaxel/api/policies/delete_policy.py +154 -0
  73. blaxel/api/policies/get_policy.py +154 -0
  74. blaxel/api/policies/list_policies.py +139 -0
  75. blaxel/api/policies/update_policy.py +180 -0
  76. blaxel/api/privateclusters/__init__.py +0 -0
  77. blaxel/api/privateclusters/create_private_cluster.py +132 -0
  78. blaxel/api/privateclusters/delete_private_cluster.py +156 -0
  79. blaxel/api/privateclusters/get_private_cluster.py +159 -0
  80. blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
  81. blaxel/api/privateclusters/list_private_clusters.py +140 -0
  82. blaxel/api/privateclusters/update_private_cluster.py +156 -0
  83. blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
  84. blaxel/api/service_accounts/__init__.py +0 -0
  85. blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
  86. blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
  87. blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  88. blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
  89. blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
  90. blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  91. blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
  92. blaxel/api/store/__init__.py +0 -0
  93. blaxel/api/store/get_store_agent.py +146 -0
  94. blaxel/api/store/get_store_function.py +146 -0
  95. blaxel/api/store/list_store_agents.py +131 -0
  96. blaxel/api/store/list_store_functions.py +131 -0
  97. blaxel/api/workspaces/__init__.py +0 -0
  98. blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
  99. blaxel/api/workspaces/create_worspace.py +163 -0
  100. blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
  101. blaxel/api/workspaces/delete_workspace.py +154 -0
  102. blaxel/api/workspaces/get_workspace.py +154 -0
  103. blaxel/api/workspaces/invite_workspace_user.py +174 -0
  104. blaxel/api/workspaces/leave_workspace.py +161 -0
  105. blaxel/api/workspaces/list_workspace_users.py +139 -0
  106. blaxel/api/workspaces/list_workspaces.py +139 -0
  107. blaxel/api/workspaces/remove_workspace_user.py +101 -0
  108. blaxel/api/workspaces/update_workspace.py +176 -0
  109. blaxel/api/workspaces/update_workspace_user_role.py +187 -0
  110. blaxel/authentication/__init__.py +45 -0
  111. blaxel/authentication/apikey.py +50 -0
  112. blaxel/authentication/authentication.py +176 -0
  113. blaxel/authentication/clientcredentials.py +103 -0
  114. blaxel/authentication/credentials.py +295 -0
  115. blaxel/authentication/device_mode.py +197 -0
  116. blaxel/client.py +281 -0
  117. blaxel/common/__init__.py +17 -0
  118. blaxel/common/error.py +27 -0
  119. blaxel/common/instrumentation.py +317 -0
  120. blaxel/common/logger.py +60 -0
  121. blaxel/common/secrets.py +39 -0
  122. blaxel/common/settings.py +150 -0
  123. blaxel/common/slugify.py +18 -0
  124. blaxel/common/utils.py +34 -0
  125. blaxel/deploy/__init__.py +8 -0
  126. blaxel/deploy/deploy.py +316 -0
  127. blaxel/deploy/format.py +46 -0
  128. blaxel/deploy/parser.py +192 -0
  129. blaxel/errors.py +16 -0
  130. blaxel/functions/__init__.py +7 -0
  131. blaxel/functions/common.py +228 -0
  132. blaxel/functions/decorator.py +64 -0
  133. blaxel/functions/local/local.py +48 -0
  134. blaxel/functions/mcp/client.py +96 -0
  135. blaxel/functions/mcp/mcp.py +168 -0
  136. blaxel/functions/mcp/utils.py +56 -0
  137. blaxel/functions/remote/remote.py +183 -0
  138. blaxel/models/__init__.py +233 -0
  139. blaxel/models/acl.py +133 -0
  140. blaxel/models/agent.py +126 -0
  141. blaxel/models/agent_chain.py +88 -0
  142. blaxel/models/agent_spec.py +346 -0
  143. blaxel/models/api_key.py +142 -0
  144. blaxel/models/configuration.py +85 -0
  145. blaxel/models/continent.py +70 -0
  146. blaxel/models/core_event.py +97 -0
  147. blaxel/models/core_spec.py +249 -0
  148. blaxel/models/core_spec_configurations.py +77 -0
  149. blaxel/models/country.py +70 -0
  150. blaxel/models/create_api_key_for_service_account_body.py +69 -0
  151. blaxel/models/create_workspace_service_account_body.py +71 -0
  152. blaxel/models/create_workspace_service_account_response_200.py +105 -0
  153. blaxel/models/delete_workspace_service_account_response_200.py +96 -0
  154. blaxel/models/entrypoint.py +96 -0
  155. blaxel/models/entrypoint_env.py +45 -0
  156. blaxel/models/flavor.py +70 -0
  157. blaxel/models/form.py +120 -0
  158. blaxel/models/form_config.py +45 -0
  159. blaxel/models/form_oauthomitempty.py +45 -0
  160. blaxel/models/form_secrets.py +45 -0
  161. blaxel/models/function.py +126 -0
  162. blaxel/models/function_kit.py +97 -0
  163. blaxel/models/function_spec.py +310 -0
  164. blaxel/models/get_trace_ids_response_200.py +45 -0
  165. blaxel/models/get_trace_logs_response_200.py +45 -0
  166. blaxel/models/get_trace_response_200.py +45 -0
  167. blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
  168. blaxel/models/histogram_bucket.py +79 -0
  169. blaxel/models/histogram_stats.py +88 -0
  170. blaxel/models/integration_connection.py +96 -0
  171. blaxel/models/integration_connection_spec.py +114 -0
  172. blaxel/models/integration_connection_spec_config.py +45 -0
  173. blaxel/models/integration_connection_spec_secret.py +45 -0
  174. blaxel/models/integration_model.py +162 -0
  175. blaxel/models/integration_repository.py +88 -0
  176. blaxel/models/invite_workspace_user_body.py +60 -0
  177. blaxel/models/knowledgebase.py +126 -0
  178. blaxel/models/knowledgebase_spec.py +163 -0
  179. blaxel/models/knowledgebase_spec_options.py +45 -0
  180. blaxel/models/last_n_requests_metric.py +79 -0
  181. blaxel/models/latency_metric.py +144 -0
  182. blaxel/models/location_response.py +113 -0
  183. blaxel/models/mcp_definition.py +188 -0
  184. blaxel/models/mcp_definition_entrypoint.py +45 -0
  185. blaxel/models/mcp_definition_form.py +45 -0
  186. blaxel/models/metadata.py +139 -0
  187. blaxel/models/metadata_labels.py +45 -0
  188. blaxel/models/metric.py +79 -0
  189. blaxel/models/metrics.py +169 -0
  190. blaxel/models/metrics_models.py +45 -0
  191. blaxel/models/metrics_request_total_per_code.py +45 -0
  192. blaxel/models/metrics_rps_per_code.py +45 -0
  193. blaxel/models/model.py +126 -0
  194. blaxel/models/model_private_cluster.py +79 -0
  195. blaxel/models/model_spec.py +249 -0
  196. blaxel/models/o_auth.py +72 -0
  197. blaxel/models/owner_fields.py +70 -0
  198. blaxel/models/pending_invitation.py +124 -0
  199. blaxel/models/pending_invitation_accept.py +85 -0
  200. blaxel/models/pending_invitation_render.py +147 -0
  201. blaxel/models/pending_invitation_render_invited_by.py +88 -0
  202. blaxel/models/pending_invitation_render_workspace.py +70 -0
  203. blaxel/models/pending_invitation_workspace_details.py +72 -0
  204. blaxel/models/pod_template_spec.py +45 -0
  205. blaxel/models/policy.py +96 -0
  206. blaxel/models/policy_location.py +70 -0
  207. blaxel/models/policy_max_tokens.py +106 -0
  208. blaxel/models/policy_spec.py +151 -0
  209. blaxel/models/private_cluster.py +183 -0
  210. blaxel/models/private_location.py +61 -0
  211. blaxel/models/repository.py +70 -0
  212. blaxel/models/request_duration_over_time_metric.py +97 -0
  213. blaxel/models/request_duration_over_time_metrics.py +80 -0
  214. blaxel/models/request_total_by_origin_metric.py +115 -0
  215. blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
  216. blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
  217. blaxel/models/request_total_metric.py +123 -0
  218. blaxel/models/request_total_metric_request_total_per_code.py +45 -0
  219. blaxel/models/request_total_metric_rps_per_code.py +45 -0
  220. blaxel/models/resource_log.py +79 -0
  221. blaxel/models/resource_metrics.py +270 -0
  222. blaxel/models/resource_metrics_request_total_per_code.py +45 -0
  223. blaxel/models/resource_metrics_rps_per_code.py +45 -0
  224. blaxel/models/revision_configuration.py +97 -0
  225. blaxel/models/revision_metadata.py +124 -0
  226. blaxel/models/runtime.py +196 -0
  227. blaxel/models/runtime_startup_probe.py +45 -0
  228. blaxel/models/serverless_config.py +80 -0
  229. blaxel/models/spec_configuration.py +70 -0
  230. blaxel/models/store_agent.py +178 -0
  231. blaxel/models/store_agent_labels.py +45 -0
  232. blaxel/models/store_configuration.py +151 -0
  233. blaxel/models/store_configuration_option.py +79 -0
  234. blaxel/models/store_function.py +211 -0
  235. blaxel/models/store_function_kit.py +97 -0
  236. blaxel/models/store_function_labels.py +45 -0
  237. blaxel/models/store_function_parameter.py +88 -0
  238. blaxel/models/time_fields.py +70 -0
  239. blaxel/models/token_rate_metric.py +88 -0
  240. blaxel/models/token_rate_metrics.py +120 -0
  241. blaxel/models/token_total_metric.py +106 -0
  242. blaxel/models/trace_ids_response.py +45 -0
  243. blaxel/models/update_workspace_service_account_body.py +69 -0
  244. blaxel/models/update_workspace_service_account_response_200.py +96 -0
  245. blaxel/models/update_workspace_user_role_body.py +60 -0
  246. blaxel/models/websocket_channel.py +88 -0
  247. blaxel/models/workspace.py +148 -0
  248. blaxel/models/workspace_labels.py +45 -0
  249. blaxel/models/workspace_user.py +115 -0
  250. blaxel/py.typed +1 -0
  251. blaxel/run.py +108 -0
  252. blaxel/serve/app.py +131 -0
  253. blaxel/serve/middlewares/__init__.py +10 -0
  254. blaxel/serve/middlewares/accesslog.py +32 -0
  255. blaxel/serve/middlewares/processtime.py +28 -0
  256. blaxel/types.py +46 -0
  257. blaxel-0.64.0.dist-info/METADATA +96 -0
  258. blaxel-0.64.0.dist-info/RECORD +261 -0
  259. blaxel-0.64.0.dist-info/WHEEL +4 -0
  260. blaxel-0.64.0.dist-info/entry_points.txt +2 -0
  261. blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,196 @@
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.runtime_startup_probe import RuntimeStartupProbe
10
+
11
+
12
+ T = TypeVar("T", bound="Runtime")
13
+
14
+
15
+ @_attrs_define
16
+ class Runtime:
17
+ """Set of configurations for a deployment
18
+
19
+ Attributes:
20
+ args (Union[Unset, list[Any]]): The arguments to pass to the deployment runtime
21
+ command (Union[Unset, list[Any]]): The command to run the deployment
22
+ cpu (Union[Unset, int]): The CPU for the deployment in cores, only available for private cluster
23
+ endpoint_name (Union[Unset, str]): Endpoint Name of the model. In case of hf_private_endpoint, it is the
24
+ endpoint name. In case of hf_public_endpoint, it is not used.
25
+ envs (Union[Unset, list[Any]]): The env variables to set in the deployment. Should be a list of Kubernetes
26
+ EnvVar types
27
+ image (Union[Unset, str]): The Docker image for the deployment
28
+ memory (Union[Unset, int]): The memory for the deployment in MB
29
+ metric_port (Union[Unset, int]): The port to serve the metrics on
30
+ model (Union[Unset, str]): The slug name of the origin model at HuggingFace.
31
+ organization (Union[Unset, str]): The organization of the model
32
+ serving_port (Union[Unset, int]): The port to serve the model on
33
+ startup_probe (Union[Unset, RuntimeStartupProbe]): The readiness probe. Should be a Kubernetes Probe type
34
+ type_ (Union[Unset, str]): The type of origin for the deployment (hf_private_endpoint, hf_public_endpoint)
35
+ """
36
+
37
+ args: Union[Unset, list[Any]] = UNSET
38
+ command: Union[Unset, list[Any]] = UNSET
39
+ cpu: Union[Unset, int] = UNSET
40
+ endpoint_name: Union[Unset, str] = UNSET
41
+ envs: Union[Unset, list[Any]] = UNSET
42
+ image: Union[Unset, str] = UNSET
43
+ memory: Union[Unset, int] = UNSET
44
+ metric_port: Union[Unset, int] = UNSET
45
+ model: Union[Unset, str] = UNSET
46
+ organization: Union[Unset, str] = UNSET
47
+ serving_port: Union[Unset, int] = UNSET
48
+ startup_probe: Union[Unset, "RuntimeStartupProbe"] = UNSET
49
+ type_: Union[Unset, str] = UNSET
50
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
51
+
52
+ def to_dict(self) -> dict[str, Any]:
53
+ args: Union[Unset, list[Any]] = UNSET
54
+ if not isinstance(self.args, Unset):
55
+ args = self.args
56
+
57
+ command: Union[Unset, list[Any]] = UNSET
58
+ if not isinstance(self.command, Unset):
59
+ command = self.command
60
+
61
+ cpu = self.cpu
62
+
63
+ endpoint_name = self.endpoint_name
64
+
65
+ envs: Union[Unset, list[Any]] = UNSET
66
+ if not isinstance(self.envs, Unset):
67
+ envs = self.envs
68
+
69
+ image = self.image
70
+
71
+ memory = self.memory
72
+
73
+ metric_port = self.metric_port
74
+
75
+ model = self.model
76
+
77
+ organization = self.organization
78
+
79
+ serving_port = self.serving_port
80
+
81
+ startup_probe: Union[Unset, dict[str, Any]] = UNSET
82
+ if (
83
+ self.startup_probe
84
+ and not isinstance(self.startup_probe, Unset)
85
+ and not isinstance(self.startup_probe, dict)
86
+ ):
87
+ startup_probe = self.startup_probe.to_dict()
88
+ elif self.startup_probe and isinstance(self.startup_probe, dict):
89
+ startup_probe = self.startup_probe
90
+
91
+ type_ = self.type_
92
+
93
+ field_dict: dict[str, Any] = {}
94
+ field_dict.update(self.additional_properties)
95
+ field_dict.update({})
96
+ if args is not UNSET:
97
+ field_dict["args"] = args
98
+ if command is not UNSET:
99
+ field_dict["command"] = command
100
+ if cpu is not UNSET:
101
+ field_dict["cpu"] = cpu
102
+ if endpoint_name is not UNSET:
103
+ field_dict["endpointName"] = endpoint_name
104
+ if envs is not UNSET:
105
+ field_dict["envs"] = envs
106
+ if image is not UNSET:
107
+ field_dict["image"] = image
108
+ if memory is not UNSET:
109
+ field_dict["memory"] = memory
110
+ if metric_port is not UNSET:
111
+ field_dict["metricPort"] = metric_port
112
+ if model is not UNSET:
113
+ field_dict["model"] = model
114
+ if organization is not UNSET:
115
+ field_dict["organization"] = organization
116
+ if serving_port is not UNSET:
117
+ field_dict["servingPort"] = serving_port
118
+ if startup_probe is not UNSET:
119
+ field_dict["startupProbe"] = startup_probe
120
+ if type_ is not UNSET:
121
+ field_dict["type"] = type_
122
+
123
+ return field_dict
124
+
125
+ @classmethod
126
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
127
+ from ..models.runtime_startup_probe import RuntimeStartupProbe
128
+
129
+ if not src_dict:
130
+ return None
131
+ d = src_dict.copy()
132
+ args = cast(list[Any], d.pop("args", UNSET))
133
+
134
+ command = cast(list[Any], d.pop("command", UNSET))
135
+
136
+ cpu = d.pop("cpu", UNSET)
137
+
138
+ endpoint_name = d.pop("endpointName", UNSET)
139
+
140
+ envs = cast(list[Any], d.pop("envs", UNSET))
141
+
142
+ image = d.pop("image", UNSET)
143
+
144
+ memory = d.pop("memory", UNSET)
145
+
146
+ metric_port = d.pop("metricPort", UNSET)
147
+
148
+ model = d.pop("model", UNSET)
149
+
150
+ organization = d.pop("organization", UNSET)
151
+
152
+ serving_port = d.pop("servingPort", UNSET)
153
+
154
+ _startup_probe = d.pop("startupProbe", UNSET)
155
+ startup_probe: Union[Unset, RuntimeStartupProbe]
156
+ if isinstance(_startup_probe, Unset):
157
+ startup_probe = UNSET
158
+ else:
159
+ startup_probe = RuntimeStartupProbe.from_dict(_startup_probe)
160
+
161
+ type_ = d.pop("type", UNSET)
162
+
163
+ runtime = cls(
164
+ args=args,
165
+ command=command,
166
+ cpu=cpu,
167
+ endpoint_name=endpoint_name,
168
+ envs=envs,
169
+ image=image,
170
+ memory=memory,
171
+ metric_port=metric_port,
172
+ model=model,
173
+ organization=organization,
174
+ serving_port=serving_port,
175
+ startup_probe=startup_probe,
176
+ type_=type_,
177
+ )
178
+
179
+ runtime.additional_properties = d
180
+ return runtime
181
+
182
+ @property
183
+ def additional_keys(self) -> list[str]:
184
+ return list(self.additional_properties.keys())
185
+
186
+ def __getitem__(self, key: str) -> Any:
187
+ return self.additional_properties[key]
188
+
189
+ def __setitem__(self, key: str, value: Any) -> None:
190
+ self.additional_properties[key] = value
191
+
192
+ def __delitem__(self, key: str) -> None:
193
+ del self.additional_properties[key]
194
+
195
+ def __contains__(self, key: str) -> bool:
196
+ return key in self.additional_properties
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="RuntimeStartupProbe")
7
+
8
+
9
+ @_attrs_define
10
+ class RuntimeStartupProbe:
11
+ """The readiness probe. Should be a Kubernetes Probe type"""
12
+
13
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> dict[str, Any]:
16
+ field_dict: dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ runtime_startup_probe = cls()
27
+
28
+ runtime_startup_probe.additional_properties = d
29
+ return runtime_startup_probe
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties
@@ -0,0 +1,80 @@
1
+ from typing import Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="ServerlessConfig")
9
+
10
+
11
+ @_attrs_define
12
+ class ServerlessConfig:
13
+ """Configuration for a serverless deployment
14
+
15
+ Attributes:
16
+ max_scale (Union[Unset, int]): The minimum number of replicas for the deployment. Can be 0 or 1 (in which case
17
+ the deployment is always running in at least one location).
18
+ min_scale (Union[Unset, int]): The maximum number of replicas for the deployment.
19
+ timeout (Union[Unset, int]): The timeout for the deployment in seconds
20
+ """
21
+
22
+ max_scale: Union[Unset, int] = UNSET
23
+ min_scale: Union[Unset, int] = UNSET
24
+ timeout: Union[Unset, int] = UNSET
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ max_scale = self.max_scale
29
+
30
+ min_scale = self.min_scale
31
+
32
+ timeout = self.timeout
33
+
34
+ field_dict: dict[str, Any] = {}
35
+ field_dict.update(self.additional_properties)
36
+ field_dict.update({})
37
+ if max_scale is not UNSET:
38
+ field_dict["maxScale"] = max_scale
39
+ if min_scale is not UNSET:
40
+ field_dict["minScale"] = min_scale
41
+ if timeout is not UNSET:
42
+ field_dict["timeout"] = timeout
43
+
44
+ return field_dict
45
+
46
+ @classmethod
47
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
48
+ if not src_dict:
49
+ return None
50
+ d = src_dict.copy()
51
+ max_scale = d.pop("maxScale", UNSET)
52
+
53
+ min_scale = d.pop("minScale", UNSET)
54
+
55
+ timeout = d.pop("timeout", UNSET)
56
+
57
+ serverless_config = cls(
58
+ max_scale=max_scale,
59
+ min_scale=min_scale,
60
+ timeout=timeout,
61
+ )
62
+
63
+ serverless_config.additional_properties = d
64
+ return serverless_config
65
+
66
+ @property
67
+ def additional_keys(self) -> list[str]:
68
+ return list(self.additional_properties.keys())
69
+
70
+ def __getitem__(self, key: str) -> Any:
71
+ return self.additional_properties[key]
72
+
73
+ def __setitem__(self, key: str, value: Any) -> None:
74
+ self.additional_properties[key] = value
75
+
76
+ def __delitem__(self, key: str) -> None:
77
+ del self.additional_properties[key]
78
+
79
+ def __contains__(self, key: str) -> bool:
80
+ return key in self.additional_properties
@@ -0,0 +1,70 @@
1
+ from typing import Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="SpecConfiguration")
9
+
10
+
11
+ @_attrs_define
12
+ class SpecConfiguration:
13
+ """Configuration, this is a key value storage. In your object you can retrieve the value with config[key]
14
+
15
+ Attributes:
16
+ secret (Union[Unset, bool]): ACconfiguration secret
17
+ value (Union[Unset, str]): Configuration value
18
+ """
19
+
20
+ secret: Union[Unset, bool] = UNSET
21
+ value: Union[Unset, str] = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ secret = self.secret
26
+
27
+ value = self.value
28
+
29
+ field_dict: dict[str, Any] = {}
30
+ field_dict.update(self.additional_properties)
31
+ field_dict.update({})
32
+ if secret is not UNSET:
33
+ field_dict["secret"] = secret
34
+ if value is not UNSET:
35
+ field_dict["value"] = value
36
+
37
+ return field_dict
38
+
39
+ @classmethod
40
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
41
+ if not src_dict:
42
+ return None
43
+ d = src_dict.copy()
44
+ secret = d.pop("secret", UNSET)
45
+
46
+ value = d.pop("value", UNSET)
47
+
48
+ spec_configuration = cls(
49
+ secret=secret,
50
+ value=value,
51
+ )
52
+
53
+ spec_configuration.additional_properties = d
54
+ return spec_configuration
55
+
56
+ @property
57
+ def additional_keys(self) -> list[str]:
58
+ return list(self.additional_properties.keys())
59
+
60
+ def __getitem__(self, key: str) -> Any:
61
+ return self.additional_properties[key]
62
+
63
+ def __setitem__(self, key: str, value: Any) -> None:
64
+ self.additional_properties[key] = value
65
+
66
+ def __delitem__(self, key: str) -> None:
67
+ del self.additional_properties[key]
68
+
69
+ def __contains__(self, key: str) -> bool:
70
+ return key in self.additional_properties
@@ -0,0 +1,178 @@
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.store_agent_labels import StoreAgentLabels
10
+ from ..models.store_configuration import StoreConfiguration
11
+
12
+
13
+ T = TypeVar("T", bound="StoreAgent")
14
+
15
+
16
+ @_attrs_define
17
+ class StoreAgent:
18
+ """Store agent
19
+
20
+ Attributes:
21
+ created_at (Union[Unset, str]): The date and time when the resource was created
22
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
23
+ created_by (Union[Unset, str]): The user or service account who created the resource
24
+ updated_by (Union[Unset, str]): The user or service account who updated the resource
25
+ configuration (Union[Unset, list['StoreConfiguration']]): Store agent configuration
26
+ description (Union[Unset, str]): Store agent description
27
+ display_name (Union[Unset, str]): Store agent display name
28
+ image (Union[Unset, str]): Store agent image
29
+ labels (Union[Unset, StoreAgentLabels]): Store agent labels
30
+ name (Union[Unset, str]): Store agent name
31
+ prompt (Union[Unset, str]): Store agent prompt, this is to define what the agent does
32
+ """
33
+
34
+ created_at: Union[Unset, str] = UNSET
35
+ updated_at: Union[Unset, str] = UNSET
36
+ created_by: Union[Unset, str] = UNSET
37
+ updated_by: Union[Unset, str] = UNSET
38
+ configuration: Union[Unset, list["StoreConfiguration"]] = UNSET
39
+ description: Union[Unset, str] = UNSET
40
+ display_name: Union[Unset, str] = UNSET
41
+ image: Union[Unset, str] = UNSET
42
+ labels: Union[Unset, "StoreAgentLabels"] = UNSET
43
+ name: Union[Unset, str] = UNSET
44
+ prompt: 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
+ created_at = self.created_at
49
+
50
+ updated_at = self.updated_at
51
+
52
+ created_by = self.created_by
53
+
54
+ updated_by = self.updated_by
55
+
56
+ configuration: Union[Unset, list[dict[str, Any]]] = UNSET
57
+ if not isinstance(self.configuration, Unset):
58
+ configuration = []
59
+ for configuration_item_data in self.configuration:
60
+ configuration_item = configuration_item_data.to_dict()
61
+ configuration.append(configuration_item)
62
+
63
+ description = self.description
64
+
65
+ display_name = self.display_name
66
+
67
+ image = self.image
68
+
69
+ labels: Union[Unset, dict[str, Any]] = UNSET
70
+ if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
71
+ labels = self.labels.to_dict()
72
+ elif self.labels and isinstance(self.labels, dict):
73
+ labels = self.labels
74
+
75
+ name = self.name
76
+
77
+ prompt = self.prompt
78
+
79
+ field_dict: dict[str, Any] = {}
80
+ field_dict.update(self.additional_properties)
81
+ field_dict.update({})
82
+ if created_at is not UNSET:
83
+ field_dict["createdAt"] = created_at
84
+ if updated_at is not UNSET:
85
+ field_dict["updatedAt"] = updated_at
86
+ if created_by is not UNSET:
87
+ field_dict["createdBy"] = created_by
88
+ if updated_by is not UNSET:
89
+ field_dict["updatedBy"] = updated_by
90
+ if configuration is not UNSET:
91
+ field_dict["configuration"] = configuration
92
+ if description is not UNSET:
93
+ field_dict["description"] = description
94
+ if display_name is not UNSET:
95
+ field_dict["displayName"] = display_name
96
+ if image is not UNSET:
97
+ field_dict["image"] = image
98
+ if labels is not UNSET:
99
+ field_dict["labels"] = labels
100
+ if name is not UNSET:
101
+ field_dict["name"] = name
102
+ if prompt is not UNSET:
103
+ field_dict["prompt"] = prompt
104
+
105
+ return field_dict
106
+
107
+ @classmethod
108
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
109
+ from ..models.store_agent_labels import StoreAgentLabels
110
+ from ..models.store_configuration import StoreConfiguration
111
+
112
+ if not src_dict:
113
+ return None
114
+ d = src_dict.copy()
115
+ created_at = d.pop("createdAt", UNSET)
116
+
117
+ updated_at = d.pop("updatedAt", UNSET)
118
+
119
+ created_by = d.pop("createdBy", UNSET)
120
+
121
+ updated_by = d.pop("updatedBy", UNSET)
122
+
123
+ configuration = []
124
+ _configuration = d.pop("configuration", UNSET)
125
+ for configuration_item_data in _configuration or []:
126
+ configuration_item = StoreConfiguration.from_dict(configuration_item_data)
127
+
128
+ configuration.append(configuration_item)
129
+
130
+ description = d.pop("description", UNSET)
131
+
132
+ display_name = d.pop("displayName", UNSET)
133
+
134
+ image = d.pop("image", UNSET)
135
+
136
+ _labels = d.pop("labels", UNSET)
137
+ labels: Union[Unset, StoreAgentLabels]
138
+ if isinstance(_labels, Unset):
139
+ labels = UNSET
140
+ else:
141
+ labels = StoreAgentLabels.from_dict(_labels)
142
+
143
+ name = d.pop("name", UNSET)
144
+
145
+ prompt = d.pop("prompt", UNSET)
146
+
147
+ store_agent = cls(
148
+ created_at=created_at,
149
+ updated_at=updated_at,
150
+ created_by=created_by,
151
+ updated_by=updated_by,
152
+ configuration=configuration,
153
+ description=description,
154
+ display_name=display_name,
155
+ image=image,
156
+ labels=labels,
157
+ name=name,
158
+ prompt=prompt,
159
+ )
160
+
161
+ store_agent.additional_properties = d
162
+ return store_agent
163
+
164
+ @property
165
+ def additional_keys(self) -> list[str]:
166
+ return list(self.additional_properties.keys())
167
+
168
+ def __getitem__(self, key: str) -> Any:
169
+ return self.additional_properties[key]
170
+
171
+ def __setitem__(self, key: str, value: Any) -> None:
172
+ self.additional_properties[key] = value
173
+
174
+ def __delitem__(self, key: str) -> None:
175
+ del self.additional_properties[key]
176
+
177
+ def __contains__(self, key: str) -> bool:
178
+ return key in self.additional_properties
@@ -0,0 +1,45 @@
1
+ from typing import Any, TypeVar
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ T = TypeVar("T", bound="StoreAgentLabels")
7
+
8
+
9
+ @_attrs_define
10
+ class StoreAgentLabels:
11
+ """Store agent labels"""
12
+
13
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
14
+
15
+ def to_dict(self) -> dict[str, Any]:
16
+ field_dict: dict[str, Any] = {}
17
+ field_dict.update(self.additional_properties)
18
+
19
+ return field_dict
20
+
21
+ @classmethod
22
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ store_agent_labels = cls()
27
+
28
+ store_agent_labels.additional_properties = d
29
+ return store_agent_labels
30
+
31
+ @property
32
+ def additional_keys(self) -> list[str]:
33
+ return list(self.additional_properties.keys())
34
+
35
+ def __getitem__(self, key: str) -> Any:
36
+ return self.additional_properties[key]
37
+
38
+ def __setitem__(self, key: str, value: Any) -> None:
39
+ self.additional_properties[key] = value
40
+
41
+ def __delitem__(self, key: str) -> None:
42
+ del self.additional_properties[key]
43
+
44
+ def __contains__(self, key: str) -> bool:
45
+ return key in self.additional_properties