blaxel 0.2.33__py3-none-any.whl → 0.2.35__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 (278) hide show
  1. blaxel/__init__.py +2 -2
  2. blaxel/core/__init__.py +2 -1
  3. blaxel/core/client/api/agents/create_agent.py +64 -19
  4. blaxel/core/client/api/agents/delete_agent.py +44 -15
  5. blaxel/core/client/api/agents/get_agent.py +43 -14
  6. blaxel/core/client/api/agents/list_agents.py +40 -11
  7. blaxel/core/client/api/agents/update_agent.py +60 -19
  8. blaxel/core/client/api/compute/create_sandbox.py +60 -23
  9. blaxel/core/client/api/compute/delete_sandbox.py +40 -19
  10. blaxel/core/client/api/compute/get_sandbox.py +39 -18
  11. blaxel/core/client/api/compute/list_sandboxes.py +40 -19
  12. blaxel/core/client/api/compute/update_sandbox.py +56 -23
  13. blaxel/core/client/api/configurations/get_configuration.py +16 -4
  14. blaxel/core/client/api/customdomains/create_custom_domain.py +12 -0
  15. blaxel/core/client/api/customdomains/list_custom_domains.py +16 -4
  16. blaxel/core/client/api/default/get_template.py +8 -4
  17. blaxel/core/client/api/functions/create_function.py +62 -19
  18. blaxel/core/client/api/functions/delete_function.py +46 -15
  19. blaxel/core/client/api/functions/get_function.py +45 -14
  20. blaxel/core/client/api/functions/list_functions.py +44 -15
  21. blaxel/core/client/api/functions/update_function.py +62 -19
  22. blaxel/core/client/api/images/cleanup_images.py +12 -12
  23. blaxel/core/client/api/images/delete_image.py +12 -8
  24. blaxel/core/client/api/images/delete_image_tag.py +12 -8
  25. blaxel/core/client/api/images/get_image.py +12 -8
  26. blaxel/core/client/api/images/list_images.py +12 -8
  27. blaxel/core/client/api/integrations/create_integration_connection.py +56 -23
  28. blaxel/core/client/api/integrations/delete_integration_connection.py +48 -19
  29. blaxel/core/client/api/integrations/get_integration.py +12 -8
  30. blaxel/core/client/api/integrations/get_integration_connection.py +44 -19
  31. blaxel/core/client/api/integrations/get_integration_connection_model.py +2 -2
  32. blaxel/core/client/api/integrations/list_integration_connections.py +36 -19
  33. blaxel/core/client/api/integrations/update_integration_connection.py +52 -19
  34. blaxel/core/client/api/jobs/create_job.py +20 -12
  35. blaxel/core/client/api/jobs/create_job_execution.py +22 -16
  36. blaxel/core/client/api/jobs/delete_job.py +12 -8
  37. blaxel/core/client/api/jobs/delete_job_execution.py +12 -8
  38. blaxel/core/client/api/jobs/get_job.py +24 -20
  39. blaxel/core/client/api/jobs/get_job_execution.py +8 -4
  40. blaxel/core/client/api/jobs/list_job_executions.py +8 -4
  41. blaxel/core/client/api/jobs/list_jobs.py +12 -8
  42. blaxel/core/client/api/jobs/update_job.py +20 -12
  43. blaxel/core/client/api/locations/list_locations.py +12 -8
  44. blaxel/core/client/api/{default → mcphub}/list_mcp_hub_definitions.py +20 -4
  45. blaxel/core/client/api/models/create_model.py +52 -23
  46. blaxel/core/client/api/models/delete_model.py +40 -19
  47. blaxel/core/client/api/models/get_model.py +40 -19
  48. blaxel/core/client/api/models/list_models.py +40 -19
  49. blaxel/core/client/api/models/update_model.py +52 -23
  50. blaxel/core/client/api/policies/create_policy.py +12 -8
  51. blaxel/core/client/api/policies/delete_policy.py +12 -8
  52. blaxel/core/client/api/policies/get_policy.py +12 -8
  53. blaxel/core/client/api/policies/list_policies.py +12 -8
  54. blaxel/core/client/api/policies/update_policy.py +12 -8
  55. blaxel/core/client/api/public_ipslist/list_public_ips.py +37 -5
  56. blaxel/core/client/api/sandboxhub/__init__.py +0 -0
  57. blaxel/core/client/api/{default → sandboxhub}/list_sandbox_hub_definitions.py +20 -4
  58. blaxel/core/client/api/service_accounts/create_api_key_for_service_account.py +12 -8
  59. blaxel/core/client/api/service_accounts/create_workspace_service_account.py +12 -8
  60. blaxel/core/client/api/service_accounts/delete_api_key_for_service_account.py +6 -4
  61. blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +12 -8
  62. blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +12 -8
  63. blaxel/core/client/api/service_accounts/list_api_keys_for_service_account.py +12 -8
  64. blaxel/core/client/api/service_accounts/update_workspace_service_account.py +8 -8
  65. blaxel/core/client/api/templates/list_templates.py +12 -8
  66. blaxel/core/client/api/volume_templates/create_volume_template.py +8 -4
  67. blaxel/core/client/api/volume_templates/list_volume_templates.py +8 -4
  68. blaxel/core/client/api/volumes/create_volume.py +56 -23
  69. blaxel/core/client/api/volumes/delete_volume.py +44 -19
  70. blaxel/core/client/api/volumes/get_volume.py +40 -19
  71. blaxel/core/client/api/volumes/list_volumes.py +40 -19
  72. blaxel/core/client/api/workspaces/create_workspace.py +54 -23
  73. blaxel/core/client/api/workspaces/delete_workspace.py +42 -19
  74. blaxel/core/client/api/workspaces/get_workspace.py +42 -19
  75. blaxel/core/client/api/workspaces/invite_workspace_user.py +8 -4
  76. blaxel/core/client/api/workspaces/list_workspace_users.py +12 -8
  77. blaxel/core/client/api/workspaces/list_workspaces.py +36 -19
  78. blaxel/core/client/api/workspaces/update_workspace.py +50 -19
  79. blaxel/core/client/models/__init__.py +76 -146
  80. blaxel/core/client/models/agent.py +43 -47
  81. blaxel/core/client/models/agent_runtime.py +139 -0
  82. blaxel/core/client/models/agent_runtime_generation.py +18 -0
  83. blaxel/core/client/models/agent_spec.py +33 -110
  84. blaxel/core/client/models/api_key.py +5 -4
  85. blaxel/core/client/models/core_event.py +5 -5
  86. blaxel/core/client/models/create_api_key_for_service_account_body.py +2 -1
  87. blaxel/core/client/models/create_job_execution_request.py +1 -1
  88. blaxel/core/client/models/create_job_execution_response.py +13 -9
  89. blaxel/core/client/models/custom_domain.py +19 -36
  90. blaxel/core/client/models/custom_domain_metadata.py +4 -3
  91. blaxel/core/client/models/custom_domain_spec.py +14 -5
  92. blaxel/core/client/models/custom_domain_spec_status.py +19 -0
  93. blaxel/core/client/models/entrypoint.py +39 -13
  94. blaxel/core/client/models/{workspace_labels.py → entrypoint_args_item.py} +6 -6
  95. blaxel/core/client/models/entrypoint_env.py +3 -3
  96. blaxel/core/client/models/{job_metrics_executions_total.py → entrypoint_super_gateway_args_item.py} +6 -6
  97. blaxel/core/client/models/{spec_configuration.py → env.py} +17 -8
  98. blaxel/core/{sandbox/client/models/welcome_response.py → client/models/error.py} +26 -23
  99. blaxel/core/client/models/expiration_policy.py +30 -11
  100. blaxel/core/client/models/expiration_policy_action.py +17 -0
  101. blaxel/core/client/models/expiration_policy_type.py +19 -0
  102. blaxel/core/client/models/flavor.py +13 -5
  103. blaxel/core/client/models/flavor_type.py +18 -0
  104. blaxel/core/client/models/form.py +6 -6
  105. blaxel/core/client/models/function.py +43 -47
  106. blaxel/core/client/models/function_runtime.py +138 -0
  107. blaxel/core/client/models/function_runtime_generation.py +18 -0
  108. blaxel/core/client/models/function_spec.py +27 -73
  109. blaxel/core/client/models/function_spec_transport.py +18 -0
  110. blaxel/core/client/models/image.py +19 -36
  111. blaxel/core/client/models/integration_connection.py +25 -39
  112. blaxel/core/client/models/integration_connection_spec.py +8 -5
  113. blaxel/core/client/models/integration_connection_spec_config.py +1 -1
  114. blaxel/core/client/models/integration_connection_spec_secret.py +1 -1
  115. blaxel/core/client/models/integration_endpoint.py +41 -11
  116. blaxel/core/client/models/integration_endpoint_ignore_models_item.py +45 -0
  117. blaxel/core/client/models/{mcp_definition_entrypoint.py → integration_endpoint_models_item.py} +6 -6
  118. blaxel/core/client/models/job.py +43 -47
  119. blaxel/core/client/models/job_execution.py +30 -37
  120. blaxel/core/client/models/job_execution_metadata.py +3 -3
  121. blaxel/core/client/models/job_execution_spec.py +2 -2
  122. blaxel/core/client/models/job_execution_stats.py +5 -5
  123. blaxel/core/client/models/job_execution_status.py +24 -0
  124. blaxel/core/client/models/job_execution_task.py +12 -4
  125. blaxel/core/client/models/job_execution_task_metadata.py +1 -1
  126. blaxel/core/client/models/job_execution_task_spec.py +2 -2
  127. blaxel/core/client/models/job_execution_task_status.py +23 -0
  128. blaxel/core/client/models/job_runtime.py +172 -0
  129. blaxel/core/client/models/job_runtime_generation.py +18 -0
  130. blaxel/core/client/models/job_spec.py +20 -88
  131. blaxel/core/client/models/location_response.py +5 -5
  132. blaxel/core/client/models/mcp_definition.py +30 -17
  133. blaxel/core/client/models/{job_metrics_tasks_total.py → mcp_definition_categories_item.py} +6 -6
  134. blaxel/core/client/models/metadata.py +23 -17
  135. blaxel/core/client/models/metadata_labels.py +4 -1
  136. blaxel/core/client/models/model.py +43 -47
  137. blaxel/core/client/models/model_runtime.py +99 -0
  138. blaxel/core/client/models/model_runtime_type.py +34 -0
  139. blaxel/core/client/models/model_spec.py +12 -58
  140. blaxel/core/client/models/o_auth.py +23 -6
  141. blaxel/core/client/models/{form_oauth.py → o_auth_scope_item.py} +6 -6
  142. blaxel/core/client/models/pending_invitation_accept.py +2 -1
  143. blaxel/core/client/models/pending_invitation_workspace_details.py +27 -6
  144. blaxel/core/client/models/{metrics_request_total_per_code.py → pending_invitation_workspace_details_emails_item.py} +6 -6
  145. blaxel/core/client/models/policy.py +20 -36
  146. blaxel/core/client/models/policy_location.py +13 -5
  147. blaxel/core/client/models/policy_location_type.py +19 -0
  148. blaxel/core/client/models/policy_max_tokens.py +6 -6
  149. blaxel/core/client/models/policy_resource_type.py +20 -0
  150. blaxel/core/client/models/policy_spec.py +31 -10
  151. blaxel/core/client/models/policy_spec_type.py +19 -0
  152. blaxel/core/client/models/port.py +25 -15
  153. blaxel/core/client/models/port_protocol.py +19 -0
  154. blaxel/core/client/models/preview.py +19 -36
  155. blaxel/core/client/models/preview_metadata.py +12 -10
  156. blaxel/core/client/models/preview_token.py +19 -36
  157. blaxel/core/client/models/preview_token_metadata.py +8 -6
  158. blaxel/core/client/models/repository.py +2 -2
  159. blaxel/core/client/models/revision_configuration.py +3 -3
  160. blaxel/core/client/models/sandbox.py +45 -58
  161. blaxel/core/client/models/sandbox_definition.py +37 -22
  162. blaxel/core/client/models/sandbox_definition_categories_item.py +45 -0
  163. blaxel/core/client/models/sandbox_error.py +148 -0
  164. blaxel/core/client/models/sandbox_error_details.py +45 -0
  165. blaxel/core/client/models/sandbox_lifecycle.py +3 -2
  166. blaxel/core/client/models/sandbox_runtime.py +145 -0
  167. blaxel/core/client/models/sandbox_spec.py +33 -134
  168. blaxel/core/client/models/status.py +25 -0
  169. blaxel/core/client/models/template.py +8 -7
  170. blaxel/core/client/models/template_variable.py +5 -5
  171. blaxel/core/client/models/trigger.py +14 -6
  172. blaxel/core/client/models/trigger_configuration.py +7 -6
  173. blaxel/core/client/models/trigger_type.py +19 -0
  174. blaxel/core/client/models/volume.py +35 -47
  175. blaxel/core/client/models/volume_attachment.py +6 -4
  176. blaxel/core/client/models/volume_spec.py +7 -4
  177. blaxel/core/client/models/volume_state.py +3 -3
  178. blaxel/core/client/models/volume_template.py +19 -33
  179. blaxel/core/client/models/volume_template_state.py +12 -4
  180. blaxel/core/client/models/volume_template_state_status.py +19 -0
  181. blaxel/core/client/models/volume_template_version.py +12 -4
  182. blaxel/core/client/models/volume_template_version_status.py +19 -0
  183. blaxel/core/client/models/workspace.py +35 -25
  184. blaxel/core/client/models/workspace_runtime.py +3 -2
  185. blaxel/core/client/models/workspace_status.py +22 -0
  186. blaxel/core/common/__init__.py +1 -1
  187. blaxel/core/jobs/__init__.py +0 -1
  188. blaxel/core/sandbox/__init__.py +2 -0
  189. blaxel/core/sandbox/client/api/process/post_process.py +8 -4
  190. blaxel/core/sandbox/client/models/__init__.py +0 -2
  191. blaxel/core/sandbox/client/models/process_response.py +16 -0
  192. blaxel/core/sandbox/client/models/process_response_status.py +9 -0
  193. blaxel/core/sandbox/default/__init__.py +2 -0
  194. blaxel/core/sandbox/default/interpreter.py +5 -1
  195. blaxel/core/sandbox/default/preview.py +3 -1
  196. blaxel/core/sandbox/default/sandbox.py +85 -26
  197. blaxel/core/sandbox/sync/process.py +2 -1
  198. blaxel/core/sandbox/sync/sandbox.py +68 -23
  199. blaxel/core/sandbox/types.py +3 -0
  200. blaxel/core/tools/common.py +16 -2
  201. blaxel/core/volume/__init__.py +2 -2
  202. blaxel/core/volume/volume.py +227 -11
  203. blaxel/langgraph/tools.py +34 -2
  204. blaxel/openai/tools.py +33 -1
  205. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/METADATA +3 -3
  206. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/RECORD +209 -248
  207. blaxel/core/client/models/acl.py +0 -133
  208. blaxel/core/client/models/billable_time_metric.py +0 -89
  209. blaxel/core/client/models/core_spec.py +0 -194
  210. blaxel/core/client/models/core_spec_configurations.py +0 -77
  211. blaxel/core/client/models/histogram_bucket.py +0 -79
  212. blaxel/core/client/models/histogram_stats.py +0 -88
  213. blaxel/core/client/models/integration_model.py +0 -162
  214. blaxel/core/client/models/job_execution_config.py +0 -79
  215. blaxel/core/client/models/job_metrics.py +0 -262
  216. blaxel/core/client/models/jobs_chart_value.py +0 -70
  217. blaxel/core/client/models/jobs_network_chart.py +0 -102
  218. blaxel/core/client/models/jobs_success_failed_chart.py +0 -147
  219. blaxel/core/client/models/jobs_total.py +0 -88
  220. blaxel/core/client/models/last_n_requests_metric.py +0 -97
  221. blaxel/core/client/models/latency_metric.py +0 -148
  222. blaxel/core/client/models/logs_response.py +0 -63
  223. blaxel/core/client/models/logs_response_data.py +0 -99
  224. blaxel/core/client/models/mcp_definition_form.py +0 -45
  225. blaxel/core/client/models/memory_allocation_by_name.py +0 -70
  226. blaxel/core/client/models/memory_allocation_metric.py +0 -61
  227. blaxel/core/client/models/metric.py +0 -79
  228. blaxel/core/client/models/metrics.py +0 -273
  229. blaxel/core/client/models/metrics_models.py +0 -45
  230. blaxel/core/client/models/metrics_rps_per_code.py +0 -45
  231. blaxel/core/client/models/pod_template_spec.py +0 -45
  232. blaxel/core/client/models/request_duration_over_time_metric.py +0 -97
  233. blaxel/core/client/models/request_duration_over_time_metrics.py +0 -84
  234. blaxel/core/client/models/request_total_by_origin_metric.py +0 -129
  235. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin.py +0 -45
  236. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -45
  237. blaxel/core/client/models/request_total_metric.py +0 -155
  238. blaxel/core/client/models/request_total_metric_request_total_per_code.py +0 -45
  239. blaxel/core/client/models/request_total_metric_rps_per_code.py +0 -45
  240. blaxel/core/client/models/request_total_response_data.py +0 -97
  241. blaxel/core/client/models/resource.py +0 -99
  242. blaxel/core/client/models/resource_log.py +0 -88
  243. blaxel/core/client/models/resource_log_chart.py +0 -133
  244. blaxel/core/client/models/resource_log_response.py +0 -83
  245. blaxel/core/client/models/resource_metrics.py +0 -618
  246. blaxel/core/client/models/resource_metrics_request_total_per_code.py +0 -45
  247. blaxel/core/client/models/resource_metrics_request_total_per_code_previous.py +0 -45
  248. blaxel/core/client/models/resource_metrics_rps_per_code.py +0 -45
  249. blaxel/core/client/models/resource_metrics_rps_per_code_previous.py +0 -45
  250. blaxel/core/client/models/resource_trace.py +0 -97
  251. blaxel/core/client/models/runtime.py +0 -317
  252. blaxel/core/client/models/runtime_configuration.py +0 -45
  253. blaxel/core/client/models/runtime_startup_probe.py +0 -45
  254. blaxel/core/client/models/sandbox_metrics.py +0 -88
  255. blaxel/core/client/models/serverless_config.py +0 -117
  256. blaxel/core/client/models/serverless_config_configuration.py +0 -45
  257. blaxel/core/client/models/start_sandbox.py +0 -98
  258. blaxel/core/client/models/stop_sandbox.py +0 -98
  259. blaxel/core/client/models/store_agent.py +0 -181
  260. blaxel/core/client/models/store_agent_labels.py +0 -45
  261. blaxel/core/client/models/store_configuration.py +0 -156
  262. blaxel/core/client/models/store_configuration_option.py +0 -79
  263. blaxel/core/client/models/time_to_first_token_over_time_metrics.py +0 -87
  264. blaxel/core/client/models/token_rate_metric.py +0 -106
  265. blaxel/core/client/models/token_rate_metrics.py +0 -124
  266. blaxel/core/client/models/token_total_metric.py +0 -112
  267. blaxel/core/client/models/trace_ids_response.py +0 -45
  268. blaxel/core/client/models/websocket_channel.py +0 -97
  269. blaxel/core/client/models/websocket_message.py +0 -106
  270. blaxel/core/sandbox/client/api/root/delete.py +0 -130
  271. blaxel/core/sandbox/client/api/root/get.py +0 -130
  272. blaxel/core/sandbox/client/api/root/options.py +0 -130
  273. blaxel/core/sandbox/client/api/root/patch.py +0 -130
  274. blaxel/core/sandbox/client/api/root/post.py +0 -130
  275. blaxel/core/sandbox/client/api/root/put.py +0 -130
  276. /blaxel/core/{sandbox/client/api/root → client/api/mcphub}/__init__.py +0 -0
  277. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/WHEEL +0 -0
  278. {blaxel-0.2.33.dist-info → blaxel-0.2.35.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,148 @@
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.sandbox_error_details import SandboxErrorDetails
10
+
11
+
12
+ T = TypeVar("T", bound="SandboxError")
13
+
14
+
15
+ @_attrs_define
16
+ class SandboxError:
17
+ """Error response returned by the CreateSandbox endpoint with extended details about the failure
18
+
19
+ Attributes:
20
+ code (str): Error code identifying the kind of error (e.g., INVALID_IMAGE, QUOTA_EXCEEDED) Example:
21
+ INVALID_IMAGE.
22
+ message (str): Human-readable error message describing what went wrong Example: Sandbox image blaxel/dev-ts-
23
+ app:latest is not supported.
24
+ details (Union[Unset, SandboxErrorDetails]): Additional error details. For INVALID_IMAGE errors, includes
25
+ requested_image and supported_images array.
26
+ sandbox_name (Union[Unset, str]): Name of the sandbox that failed to create Example: mysandbox.
27
+ status_code (Union[Unset, int]): HTTP status code Example: 400.
28
+ step (Union[Unset, str]): Processing step where the error occurred Example: validate_and_prepare.
29
+ timestamp (Union[Unset, str]): ISO 8601 timestamp of when the error occurred Example:
30
+ 2025-12-19T22:36:29.336304095Z.
31
+ workspace (Union[Unset, str]): Workspace name where the sandbox creation was attempted Example: main.
32
+ """
33
+
34
+ code: str
35
+ message: str
36
+ details: Union[Unset, "SandboxErrorDetails"] = UNSET
37
+ sandbox_name: Union[Unset, str] = UNSET
38
+ status_code: Union[Unset, int] = UNSET
39
+ step: Union[Unset, str] = UNSET
40
+ timestamp: Union[Unset, str] = UNSET
41
+ workspace: Union[Unset, str] = UNSET
42
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
43
+
44
+ def to_dict(self) -> dict[str, Any]:
45
+ code = self.code
46
+
47
+ message = self.message
48
+
49
+ details: Union[Unset, dict[str, Any]] = UNSET
50
+ if (
51
+ self.details
52
+ and not isinstance(self.details, Unset)
53
+ and not isinstance(self.details, dict)
54
+ ):
55
+ details = self.details.to_dict()
56
+ elif self.details and isinstance(self.details, dict):
57
+ details = self.details
58
+
59
+ sandbox_name = self.sandbox_name
60
+
61
+ status_code = self.status_code
62
+
63
+ step = self.step
64
+
65
+ timestamp = self.timestamp
66
+
67
+ workspace = self.workspace
68
+
69
+ field_dict: dict[str, Any] = {}
70
+ field_dict.update(self.additional_properties)
71
+ field_dict.update(
72
+ {
73
+ "code": code,
74
+ "message": message,
75
+ }
76
+ )
77
+ if details is not UNSET:
78
+ field_dict["details"] = details
79
+ if sandbox_name is not UNSET:
80
+ field_dict["sandbox_name"] = sandbox_name
81
+ if status_code is not UNSET:
82
+ field_dict["status_code"] = status_code
83
+ if step is not UNSET:
84
+ field_dict["step"] = step
85
+ if timestamp is not UNSET:
86
+ field_dict["timestamp"] = timestamp
87
+ if workspace is not UNSET:
88
+ field_dict["workspace"] = workspace
89
+
90
+ return field_dict
91
+
92
+ @classmethod
93
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None:
94
+ from ..models.sandbox_error_details import SandboxErrorDetails
95
+
96
+ if not src_dict:
97
+ return None
98
+ d = src_dict.copy()
99
+ code = d.pop("code")
100
+
101
+ message = d.pop("message")
102
+
103
+ _details = d.pop("details", UNSET)
104
+ details: Union[Unset, SandboxErrorDetails]
105
+ if isinstance(_details, Unset):
106
+ details = UNSET
107
+ else:
108
+ details = SandboxErrorDetails.from_dict(_details)
109
+
110
+ sandbox_name = d.pop("sandbox_name", UNSET)
111
+
112
+ status_code = d.pop("status_code", UNSET)
113
+
114
+ step = d.pop("step", UNSET)
115
+
116
+ timestamp = d.pop("timestamp", UNSET)
117
+
118
+ workspace = d.pop("workspace", UNSET)
119
+
120
+ sandbox_error = cls(
121
+ code=code,
122
+ message=message,
123
+ details=details,
124
+ sandbox_name=sandbox_name,
125
+ status_code=status_code,
126
+ step=step,
127
+ timestamp=timestamp,
128
+ workspace=workspace,
129
+ )
130
+
131
+ sandbox_error.additional_properties = d
132
+ return sandbox_error
133
+
134
+ @property
135
+ def additional_keys(self) -> list[str]:
136
+ return list(self.additional_properties.keys())
137
+
138
+ def __getitem__(self, key: str) -> Any:
139
+ return self.additional_properties[key]
140
+
141
+ def __setitem__(self, key: str, value: Any) -> None:
142
+ self.additional_properties[key] = value
143
+
144
+ def __delitem__(self, key: str) -> None:
145
+ del self.additional_properties[key]
146
+
147
+ def __contains__(self, key: str) -> bool:
148
+ 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="SandboxErrorDetails")
7
+
8
+
9
+ @_attrs_define
10
+ class SandboxErrorDetails:
11
+ """Additional error details. For INVALID_IMAGE errors, includes requested_image and supported_images array."""
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 | None:
23
+ if not src_dict:
24
+ return None
25
+ d = src_dict.copy()
26
+ sandbox_error_details = cls()
27
+
28
+ sandbox_error_details.additional_properties = d
29
+ return sandbox_error_details
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
@@ -14,10 +14,11 @@ T = TypeVar("T", bound="SandboxLifecycle")
14
14
 
15
15
  @_attrs_define
16
16
  class SandboxLifecycle:
17
- """Lifecycle configuration for sandbox management
17
+ """Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates
18
18
 
19
19
  Attributes:
20
- expiration_policies (Union[Unset, list['ExpirationPolicy']]): List of expiration policies
20
+ expiration_policies (Union[Unset, list['ExpirationPolicy']]): List of expiration policies. Multiple policies can
21
+ be combined; whichever condition is met first triggers the action.
21
22
  """
22
23
 
23
24
  expiration_policies: Union[Unset, list["ExpirationPolicy"]] = UNSET
@@ -0,0 +1,145 @@
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.env import Env
10
+ from ..models.port import Port
11
+
12
+
13
+ T = TypeVar("T", bound="SandboxRuntime")
14
+
15
+
16
+ @_attrs_define
17
+ class SandboxRuntime:
18
+ """Runtime configuration defining how the sandbox VM is provisioned and its resource limits
19
+
20
+ Attributes:
21
+ envs (Union[Unset, list['Env']]): Environment variables injected into the sandbox. Supports Kubernetes EnvVar
22
+ format with valueFrom references.
23
+ expires (Union[Unset, str]): Absolute expiration timestamp in ISO 8601 format when the sandbox will be deleted
24
+ Example: 2025-12-31T23:59:59Z.
25
+ image (Union[Unset, str]): Sandbox image to use. Can be a public Blaxel image (e.g., blaxel/base-image:latest)
26
+ or a custom template image built with 'bl deploy'. Example: blaxel/base-image:latest.
27
+ memory (Union[Unset, int]): Memory allocation in megabytes. Also determines CPU allocation (CPU cores = memory
28
+ in MB / 2048, e.g., 4096MB = 2 CPUs). Example: 4096.
29
+ ports (Union[Unset, list['Port']]): Set of ports for a resource
30
+ ttl (Union[Unset, str]): Time-to-live duration after which the sandbox is automatically deleted (e.g., '30m',
31
+ '24h', '7d') Example: 24h.
32
+ """
33
+
34
+ envs: Union[Unset, list["Env"]] = UNSET
35
+ expires: Union[Unset, str] = UNSET
36
+ image: Union[Unset, str] = UNSET
37
+ memory: Union[Unset, int] = UNSET
38
+ ports: Union[Unset, list["Port"]] = UNSET
39
+ ttl: 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
+ envs: Union[Unset, list[dict[str, Any]]] = UNSET
44
+ if not isinstance(self.envs, Unset):
45
+ envs = []
46
+ for envs_item_data in self.envs:
47
+ if type(envs_item_data) is dict:
48
+ envs_item = envs_item_data
49
+ else:
50
+ envs_item = envs_item_data.to_dict()
51
+ envs.append(envs_item)
52
+
53
+ expires = self.expires
54
+
55
+ image = self.image
56
+
57
+ memory = self.memory
58
+
59
+ ports: Union[Unset, list[dict[str, Any]]] = UNSET
60
+ if not isinstance(self.ports, Unset):
61
+ ports = []
62
+ for componentsschemas_ports_item_data in self.ports:
63
+ if type(componentsschemas_ports_item_data) is dict:
64
+ componentsschemas_ports_item = componentsschemas_ports_item_data
65
+ else:
66
+ componentsschemas_ports_item = componentsschemas_ports_item_data.to_dict()
67
+ ports.append(componentsschemas_ports_item)
68
+
69
+ ttl = self.ttl
70
+
71
+ field_dict: dict[str, Any] = {}
72
+ field_dict.update(self.additional_properties)
73
+ field_dict.update({})
74
+ if envs is not UNSET:
75
+ field_dict["envs"] = envs
76
+ if expires is not UNSET:
77
+ field_dict["expires"] = expires
78
+ if image is not UNSET:
79
+ field_dict["image"] = image
80
+ if memory is not UNSET:
81
+ field_dict["memory"] = memory
82
+ if ports is not UNSET:
83
+ field_dict["ports"] = ports
84
+ if ttl is not UNSET:
85
+ field_dict["ttl"] = ttl
86
+
87
+ return field_dict
88
+
89
+ @classmethod
90
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None:
91
+ from ..models.env import Env
92
+ from ..models.port import Port
93
+
94
+ if not src_dict:
95
+ return None
96
+ d = src_dict.copy()
97
+ envs = []
98
+ _envs = d.pop("envs", UNSET)
99
+ for envs_item_data in _envs or []:
100
+ envs_item = Env.from_dict(envs_item_data)
101
+
102
+ envs.append(envs_item)
103
+
104
+ expires = d.pop("expires", UNSET)
105
+
106
+ image = d.pop("image", UNSET)
107
+
108
+ memory = d.pop("memory", UNSET)
109
+
110
+ ports = []
111
+ _ports = d.pop("ports", UNSET)
112
+ for componentsschemas_ports_item_data in _ports or []:
113
+ componentsschemas_ports_item = Port.from_dict(componentsschemas_ports_item_data)
114
+
115
+ ports.append(componentsschemas_ports_item)
116
+
117
+ ttl = d.pop("ttl", UNSET)
118
+
119
+ sandbox_runtime = cls(
120
+ envs=envs,
121
+ expires=expires,
122
+ image=image,
123
+ memory=memory,
124
+ ports=ports,
125
+ ttl=ttl,
126
+ )
127
+
128
+ sandbox_runtime.additional_properties = d
129
+ return sandbox_runtime
130
+
131
+ @property
132
+ def additional_keys(self) -> list[str]:
133
+ return list(self.additional_properties.keys())
134
+
135
+ def __getitem__(self, key: str) -> Any:
136
+ return self.additional_properties[key]
137
+
138
+ def __setitem__(self, key: str, value: Any) -> None:
139
+ self.additional_properties[key] = value
140
+
141
+ def __delitem__(self, key: str) -> None:
142
+ del self.additional_properties[key]
143
+
144
+ def __contains__(self, key: str) -> bool:
145
+ return key in self.additional_properties
@@ -1,4 +1,4 @@
1
- from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
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
@@ -6,11 +6,8 @@ from attrs import field as _attrs_field
6
6
  from ..types import UNSET, Unset
7
7
 
8
8
  if TYPE_CHECKING:
9
- from ..models.core_spec_configurations import CoreSpecConfigurations
10
- from ..models.flavor import Flavor
11
- from ..models.revision_configuration import RevisionConfiguration
12
- from ..models.runtime import Runtime
13
9
  from ..models.sandbox_lifecycle import SandboxLifecycle
10
+ from ..models.sandbox_runtime import SandboxRuntime
14
11
  from ..models.volume_attachment import VolumeAttachment
15
12
 
16
13
 
@@ -19,75 +16,41 @@ T = TypeVar("T", bound="SandboxSpec")
19
16
 
20
17
  @_attrs_define
21
18
  class SandboxSpec:
22
- """Sandbox specification
19
+ """Configuration for a sandbox including its image, memory, ports, region, and lifecycle policies
23
20
 
24
21
  Attributes:
25
- configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
26
- enabled (Union[Unset, bool]): Enable or disable the resource
27
- flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
28
- integration_connections (Union[Unset, list[str]]):
29
- policies (Union[Unset, list[str]]):
30
- revision (Union[Unset, RevisionConfiguration]): Revision configuration
31
- runtime (Union[Unset, Runtime]): Set of configurations for a deployment
32
- sandbox (Union[Unset, bool]): Sandbox mode
33
- lifecycle (Union[Unset, SandboxLifecycle]): Lifecycle configuration for sandbox management
34
- region (Union[Unset, str]): Region where the sandbox should be created (e.g. us-pdx-1, eu-lon-1)
22
+ enabled (Union[Unset, bool]): When false, the sandbox is disabled and will not accept connections Default: True.
23
+ Example: True.
24
+ lifecycle (Union[Unset, SandboxLifecycle]): Lifecycle configuration controlling automatic sandbox deletion based
25
+ on idle time, max age, or specific dates
26
+ region (Union[Unset, str]): Region where the sandbox should be created (e.g. us-pdx-1, eu-lon-1). If not
27
+ specified, defaults to the region closest to the user. Example: us-pdx-1.
28
+ runtime (Union[Unset, SandboxRuntime]): Runtime configuration defining how the sandbox VM is provisioned and its
29
+ resource limits
35
30
  volumes (Union[Unset, list['VolumeAttachment']]):
36
31
  """
37
32
 
38
- configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
39
- enabled: Union[Unset, bool] = UNSET
40
- flavors: Union[Unset, list["Flavor"]] = UNSET
41
- integration_connections: Union[Unset, list[str]] = UNSET
42
- policies: Union[Unset, list[str]] = UNSET
43
- revision: Union[Unset, "RevisionConfiguration"] = UNSET
44
- runtime: Union[Unset, "Runtime"] = UNSET
45
- sandbox: Union[Unset, bool] = UNSET
33
+ enabled: Union[Unset, bool] = True
46
34
  lifecycle: Union[Unset, "SandboxLifecycle"] = UNSET
47
35
  region: Union[Unset, str] = UNSET
36
+ runtime: Union[Unset, "SandboxRuntime"] = UNSET
48
37
  volumes: Union[Unset, list["VolumeAttachment"]] = UNSET
49
38
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
50
39
 
51
40
  def to_dict(self) -> dict[str, Any]:
52
- configurations: Union[Unset, dict[str, Any]] = UNSET
53
- if (
54
- self.configurations
55
- and not isinstance(self.configurations, Unset)
56
- and not isinstance(self.configurations, dict)
57
- ):
58
- configurations = self.configurations.to_dict()
59
- elif self.configurations and isinstance(self.configurations, dict):
60
- configurations = self.configurations
61
-
62
41
  enabled = self.enabled
63
42
 
64
- flavors: Union[Unset, list[dict[str, Any]]] = UNSET
65
- if not isinstance(self.flavors, Unset):
66
- flavors = []
67
- for componentsschemas_flavors_item_data in self.flavors:
68
- if type(componentsschemas_flavors_item_data) is dict:
69
- componentsschemas_flavors_item = componentsschemas_flavors_item_data
70
- else:
71
- componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
72
- flavors.append(componentsschemas_flavors_item)
73
-
74
- integration_connections: Union[Unset, list[str]] = UNSET
75
- if not isinstance(self.integration_connections, Unset):
76
- integration_connections = self.integration_connections
77
-
78
- policies: Union[Unset, list[str]] = UNSET
79
- if not isinstance(self.policies, Unset):
80
- policies = self.policies
81
-
82
- revision: Union[Unset, dict[str, Any]] = UNSET
43
+ lifecycle: Union[Unset, dict[str, Any]] = UNSET
83
44
  if (
84
- self.revision
85
- and not isinstance(self.revision, Unset)
86
- and not isinstance(self.revision, dict)
45
+ self.lifecycle
46
+ and not isinstance(self.lifecycle, Unset)
47
+ and not isinstance(self.lifecycle, dict)
87
48
  ):
88
- revision = self.revision.to_dict()
89
- elif self.revision and isinstance(self.revision, dict):
90
- revision = self.revision
49
+ lifecycle = self.lifecycle.to_dict()
50
+ elif self.lifecycle and isinstance(self.lifecycle, dict):
51
+ lifecycle = self.lifecycle
52
+
53
+ region = self.region
91
54
 
92
55
  runtime: Union[Unset, dict[str, Any]] = UNSET
93
56
  if (
@@ -99,20 +62,6 @@ class SandboxSpec:
99
62
  elif self.runtime and isinstance(self.runtime, dict):
100
63
  runtime = self.runtime
101
64
 
102
- sandbox = self.sandbox
103
-
104
- lifecycle: Union[Unset, dict[str, Any]] = UNSET
105
- if (
106
- self.lifecycle
107
- and not isinstance(self.lifecycle, Unset)
108
- and not isinstance(self.lifecycle, dict)
109
- ):
110
- lifecycle = self.lifecycle.to_dict()
111
- elif self.lifecycle and isinstance(self.lifecycle, dict):
112
- lifecycle = self.lifecycle
113
-
114
- region = self.region
115
-
116
65
  volumes: Union[Unset, list[dict[str, Any]]] = UNSET
117
66
  if not isinstance(self.volumes, Unset):
118
67
  volumes = []
@@ -130,26 +79,14 @@ class SandboxSpec:
130
79
  field_dict: dict[str, Any] = {}
131
80
  field_dict.update(self.additional_properties)
132
81
  field_dict.update({})
133
- if configurations is not UNSET:
134
- field_dict["configurations"] = configurations
135
82
  if enabled is not UNSET:
136
83
  field_dict["enabled"] = enabled
137
- if flavors is not UNSET:
138
- field_dict["flavors"] = flavors
139
- if integration_connections is not UNSET:
140
- field_dict["integrationConnections"] = integration_connections
141
- if policies is not UNSET:
142
- field_dict["policies"] = policies
143
- if revision is not UNSET:
144
- field_dict["revision"] = revision
145
- if runtime is not UNSET:
146
- field_dict["runtime"] = runtime
147
- if sandbox is not UNSET:
148
- field_dict["sandbox"] = sandbox
149
84
  if lifecycle is not UNSET:
150
85
  field_dict["lifecycle"] = lifecycle
151
86
  if region is not UNSET:
152
87
  field_dict["region"] = region
88
+ if runtime is not UNSET:
89
+ field_dict["runtime"] = runtime
153
90
  if volumes is not UNSET:
154
91
  field_dict["volumes"] = volumes
155
92
 
@@ -157,54 +94,15 @@ class SandboxSpec:
157
94
 
158
95
  @classmethod
159
96
  def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T | None:
160
- from ..models.core_spec_configurations import CoreSpecConfigurations
161
- from ..models.flavor import Flavor
162
- from ..models.revision_configuration import RevisionConfiguration
163
- from ..models.runtime import Runtime
164
97
  from ..models.sandbox_lifecycle import SandboxLifecycle
98
+ from ..models.sandbox_runtime import SandboxRuntime
165
99
  from ..models.volume_attachment import VolumeAttachment
166
100
 
167
101
  if not src_dict:
168
102
  return None
169
103
  d = src_dict.copy()
170
- _configurations = d.pop("configurations", UNSET)
171
- configurations: Union[Unset, CoreSpecConfigurations]
172
- if isinstance(_configurations, Unset):
173
- configurations = UNSET
174
- else:
175
- configurations = CoreSpecConfigurations.from_dict(_configurations)
176
-
177
104
  enabled = d.pop("enabled", UNSET)
178
105
 
179
- flavors = []
180
- _flavors = d.pop("flavors", UNSET)
181
- for componentsschemas_flavors_item_data in _flavors or []:
182
- componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
183
-
184
- flavors.append(componentsschemas_flavors_item)
185
-
186
- integration_connections = cast(
187
- list[str], d.pop("integrationConnections", d.pop("integration_connections", UNSET))
188
- )
189
-
190
- policies = cast(list[str], d.pop("policies", UNSET))
191
-
192
- _revision = d.pop("revision", UNSET)
193
- revision: Union[Unset, RevisionConfiguration]
194
- if isinstance(_revision, Unset):
195
- revision = UNSET
196
- else:
197
- revision = RevisionConfiguration.from_dict(_revision)
198
-
199
- _runtime = d.pop("runtime", UNSET)
200
- runtime: Union[Unset, Runtime]
201
- if isinstance(_runtime, Unset):
202
- runtime = UNSET
203
- else:
204
- runtime = Runtime.from_dict(_runtime)
205
-
206
- sandbox = d.pop("sandbox", UNSET)
207
-
208
106
  _lifecycle = d.pop("lifecycle", UNSET)
209
107
  lifecycle: Union[Unset, SandboxLifecycle]
210
108
  if isinstance(_lifecycle, Unset):
@@ -214,6 +112,13 @@ class SandboxSpec:
214
112
 
215
113
  region = d.pop("region", UNSET)
216
114
 
115
+ _runtime = d.pop("runtime", UNSET)
116
+ runtime: Union[Unset, SandboxRuntime]
117
+ if isinstance(_runtime, Unset):
118
+ runtime = UNSET
119
+ else:
120
+ runtime = SandboxRuntime.from_dict(_runtime)
121
+
217
122
  volumes = []
218
123
  _volumes = d.pop("volumes", UNSET)
219
124
  for componentsschemas_volume_attachments_item_data in _volumes or []:
@@ -224,16 +129,10 @@ class SandboxSpec:
224
129
  volumes.append(componentsschemas_volume_attachments_item)
225
130
 
226
131
  sandbox_spec = cls(
227
- configurations=configurations,
228
132
  enabled=enabled,
229
- flavors=flavors,
230
- integration_connections=integration_connections,
231
- policies=policies,
232
- revision=revision,
233
- runtime=runtime,
234
- sandbox=sandbox,
235
133
  lifecycle=lifecycle,
236
134
  region=region,
135
+ runtime=runtime,
237
136
  volumes=volumes,
238
137
  )
239
138
 
@@ -0,0 +1,25 @@
1
+ from enum import Enum
2
+
3
+
4
+ class Status(str, Enum):
5
+ BUILDING = "BUILDING"
6
+ DEACTIVATED = "DEACTIVATED"
7
+ DEACTIVATING = "DEACTIVATING"
8
+ DELETING = "DELETING"
9
+ DEPLOYED = "DEPLOYED"
10
+ DEPLOYING = "DEPLOYING"
11
+ FAILED = "FAILED"
12
+ TERMINATED = "TERMINATED"
13
+ UPLOADING = "UPLOADING"
14
+
15
+ def __str__(self) -> str:
16
+ return str(self.value)
17
+
18
+ @classmethod
19
+ def _missing_(cls, value: object) -> "Status | None":
20
+ if isinstance(value, str):
21
+ upper_value = value.upper()
22
+ for member in cls:
23
+ if member.value.upper() == upper_value:
24
+ return member
25
+ return None
@@ -17,17 +17,18 @@ class Template:
17
17
  """Blaxel template
18
18
 
19
19
  Attributes:
20
- default_branch (Union[Unset, str]): Default branch of the template
21
- description (Union[Unset, str]): Description of the template
22
- download_count (Union[Unset, int]): Number of downloads/clones of the repository
23
- forks_count (Union[Unset, int]): Number of forks the repository has
20
+ default_branch (Union[Unset, str]): Default branch of the template Example: main.
21
+ description (Union[Unset, str]): Description of the template Example: A starter template for building LangChain
22
+ agents.
23
+ download_count (Union[Unset, int]): Number of downloads/clones of the repository Example: 1200.
24
+ forks_count (Union[Unset, int]): Number of forks the repository has Example: 45.
24
25
  icon (Union[Unset, str]): URL to the template's icon
25
26
  icon_dark (Union[Unset, str]): URL to the template's icon in dark mode
26
- name (Union[Unset, str]): Name of the template
27
+ name (Union[Unset, str]): Name of the template Example: langchain-agent.
27
28
  sha (Union[Unset, str]): SHA of the variable
28
- star_count (Union[Unset, int]): Number of stars the repository has
29
+ star_count (Union[Unset, int]): Number of stars the repository has Example: 150.
29
30
  topics (Union[Unset, list[str]]): Topic of the template
30
- url (Union[Unset, str]): URL of the template
31
+ url (Union[Unset, str]): URL of the template Example: https://github.com/blaxel-ai/template-langchain-agent.
31
32
  variables (Union[Unset, list['TemplateVariable']]): Variables of the template
32
33
  """
33
34
 
@@ -13,11 +13,11 @@ class TemplateVariable:
13
13
  """Blaxel template variable
14
14
 
15
15
  Attributes:
16
- description (Union[Unset, str]): Description of the variable
17
- integration (Union[Unset, str]): Integration of the variable
18
- name (Union[Unset, str]): Name of the variable
19
- path (Union[Unset, str]): Path of the variable
20
- secret (Union[Unset, bool]): Whether the variable is secret
16
+ description (Union[Unset, str]): Description of the variable Example: OpenAI API key for the agent.
17
+ integration (Union[Unset, str]): Integration of the variable Example: openai.
18
+ name (Union[Unset, str]): Name of the variable Example: OPENAI_API_KEY.
19
+ path (Union[Unset, str]): Path of the variable Example: .env.
20
+ secret (Union[Unset, bool]): Whether the variable is secret Example: True.
21
21
  """
22
22
 
23
23
  description: Union[Unset, str] = UNSET