blaxel 0.2.34__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 (276) hide show
  1. blaxel/__init__.py +2 -2
  2. blaxel/core/client/api/agents/create_agent.py +64 -19
  3. blaxel/core/client/api/agents/delete_agent.py +44 -15
  4. blaxel/core/client/api/agents/get_agent.py +43 -14
  5. blaxel/core/client/api/agents/list_agents.py +40 -11
  6. blaxel/core/client/api/agents/update_agent.py +60 -19
  7. blaxel/core/client/api/compute/create_sandbox.py +60 -23
  8. blaxel/core/client/api/compute/delete_sandbox.py +40 -19
  9. blaxel/core/client/api/compute/get_sandbox.py +39 -18
  10. blaxel/core/client/api/compute/list_sandboxes.py +40 -19
  11. blaxel/core/client/api/compute/update_sandbox.py +56 -23
  12. blaxel/core/client/api/configurations/get_configuration.py +16 -4
  13. blaxel/core/client/api/customdomains/create_custom_domain.py +12 -0
  14. blaxel/core/client/api/customdomains/list_custom_domains.py +16 -4
  15. blaxel/core/client/api/default/get_template.py +8 -4
  16. blaxel/core/client/api/functions/create_function.py +62 -19
  17. blaxel/core/client/api/functions/delete_function.py +46 -15
  18. blaxel/core/client/api/functions/get_function.py +45 -14
  19. blaxel/core/client/api/functions/list_functions.py +44 -15
  20. blaxel/core/client/api/functions/update_function.py +62 -19
  21. blaxel/core/client/api/images/cleanup_images.py +12 -12
  22. blaxel/core/client/api/images/delete_image.py +12 -8
  23. blaxel/core/client/api/images/delete_image_tag.py +12 -8
  24. blaxel/core/client/api/images/get_image.py +12 -8
  25. blaxel/core/client/api/images/list_images.py +12 -8
  26. blaxel/core/client/api/integrations/create_integration_connection.py +56 -23
  27. blaxel/core/client/api/integrations/delete_integration_connection.py +48 -19
  28. blaxel/core/client/api/integrations/get_integration.py +12 -8
  29. blaxel/core/client/api/integrations/get_integration_connection.py +44 -19
  30. blaxel/core/client/api/integrations/get_integration_connection_model.py +2 -2
  31. blaxel/core/client/api/integrations/list_integration_connections.py +36 -19
  32. blaxel/core/client/api/integrations/update_integration_connection.py +52 -19
  33. blaxel/core/client/api/jobs/create_job.py +20 -12
  34. blaxel/core/client/api/jobs/create_job_execution.py +22 -16
  35. blaxel/core/client/api/jobs/delete_job.py +12 -8
  36. blaxel/core/client/api/jobs/delete_job_execution.py +12 -8
  37. blaxel/core/client/api/jobs/get_job.py +24 -20
  38. blaxel/core/client/api/jobs/get_job_execution.py +8 -4
  39. blaxel/core/client/api/jobs/list_job_executions.py +8 -4
  40. blaxel/core/client/api/jobs/list_jobs.py +12 -8
  41. blaxel/core/client/api/jobs/update_job.py +20 -12
  42. blaxel/core/client/api/locations/list_locations.py +12 -8
  43. blaxel/core/client/api/{default → mcphub}/list_mcp_hub_definitions.py +20 -4
  44. blaxel/core/client/api/models/create_model.py +52 -23
  45. blaxel/core/client/api/models/delete_model.py +40 -19
  46. blaxel/core/client/api/models/get_model.py +40 -19
  47. blaxel/core/client/api/models/list_models.py +40 -19
  48. blaxel/core/client/api/models/update_model.py +52 -23
  49. blaxel/core/client/api/policies/create_policy.py +12 -8
  50. blaxel/core/client/api/policies/delete_policy.py +12 -8
  51. blaxel/core/client/api/policies/get_policy.py +12 -8
  52. blaxel/core/client/api/policies/list_policies.py +12 -8
  53. blaxel/core/client/api/policies/update_policy.py +12 -8
  54. blaxel/core/client/api/public_ipslist/list_public_ips.py +37 -5
  55. blaxel/core/client/api/sandboxhub/__init__.py +0 -0
  56. blaxel/core/client/api/{default → sandboxhub}/list_sandbox_hub_definitions.py +20 -4
  57. blaxel/core/client/api/service_accounts/create_api_key_for_service_account.py +12 -8
  58. blaxel/core/client/api/service_accounts/create_workspace_service_account.py +12 -8
  59. blaxel/core/client/api/service_accounts/delete_api_key_for_service_account.py +6 -4
  60. blaxel/core/client/api/service_accounts/delete_workspace_service_account.py +12 -8
  61. blaxel/core/client/api/service_accounts/get_workspace_service_accounts.py +12 -8
  62. blaxel/core/client/api/service_accounts/list_api_keys_for_service_account.py +12 -8
  63. blaxel/core/client/api/service_accounts/update_workspace_service_account.py +8 -8
  64. blaxel/core/client/api/templates/list_templates.py +12 -8
  65. blaxel/core/client/api/volume_templates/create_volume_template.py +8 -4
  66. blaxel/core/client/api/volume_templates/list_volume_templates.py +8 -4
  67. blaxel/core/client/api/volumes/create_volume.py +56 -23
  68. blaxel/core/client/api/volumes/delete_volume.py +44 -19
  69. blaxel/core/client/api/volumes/get_volume.py +40 -19
  70. blaxel/core/client/api/volumes/list_volumes.py +40 -19
  71. blaxel/core/client/api/workspaces/create_workspace.py +54 -23
  72. blaxel/core/client/api/workspaces/delete_workspace.py +42 -19
  73. blaxel/core/client/api/workspaces/get_workspace.py +42 -19
  74. blaxel/core/client/api/workspaces/invite_workspace_user.py +8 -4
  75. blaxel/core/client/api/workspaces/list_workspace_users.py +12 -8
  76. blaxel/core/client/api/workspaces/list_workspaces.py +36 -19
  77. blaxel/core/client/api/workspaces/update_workspace.py +50 -19
  78. blaxel/core/client/models/__init__.py +76 -146
  79. blaxel/core/client/models/agent.py +43 -47
  80. blaxel/core/client/models/agent_runtime.py +139 -0
  81. blaxel/core/client/models/agent_runtime_generation.py +18 -0
  82. blaxel/core/client/models/agent_spec.py +33 -110
  83. blaxel/core/client/models/api_key.py +5 -4
  84. blaxel/core/client/models/core_event.py +5 -5
  85. blaxel/core/client/models/create_api_key_for_service_account_body.py +2 -1
  86. blaxel/core/client/models/create_job_execution_request.py +1 -1
  87. blaxel/core/client/models/create_job_execution_response.py +13 -9
  88. blaxel/core/client/models/custom_domain.py +19 -36
  89. blaxel/core/client/models/custom_domain_metadata.py +4 -3
  90. blaxel/core/client/models/custom_domain_spec.py +14 -5
  91. blaxel/core/client/models/custom_domain_spec_status.py +19 -0
  92. blaxel/core/client/models/entrypoint.py +39 -13
  93. blaxel/core/client/models/{workspace_labels.py → entrypoint_args_item.py} +6 -6
  94. blaxel/core/client/models/entrypoint_env.py +3 -3
  95. blaxel/core/client/models/{job_metrics_executions_total.py → entrypoint_super_gateway_args_item.py} +6 -6
  96. blaxel/core/client/models/{spec_configuration.py → env.py} +17 -8
  97. blaxel/core/{sandbox/client/models/welcome_response.py → client/models/error.py} +26 -23
  98. blaxel/core/client/models/expiration_policy.py +30 -11
  99. blaxel/core/client/models/expiration_policy_action.py +17 -0
  100. blaxel/core/client/models/expiration_policy_type.py +19 -0
  101. blaxel/core/client/models/flavor.py +13 -5
  102. blaxel/core/client/models/flavor_type.py +18 -0
  103. blaxel/core/client/models/form.py +6 -6
  104. blaxel/core/client/models/function.py +43 -47
  105. blaxel/core/client/models/function_runtime.py +138 -0
  106. blaxel/core/client/models/function_runtime_generation.py +18 -0
  107. blaxel/core/client/models/function_spec.py +27 -73
  108. blaxel/core/client/models/function_spec_transport.py +18 -0
  109. blaxel/core/client/models/image.py +19 -36
  110. blaxel/core/client/models/integration_connection.py +25 -39
  111. blaxel/core/client/models/integration_connection_spec.py +8 -5
  112. blaxel/core/client/models/integration_connection_spec_config.py +1 -1
  113. blaxel/core/client/models/integration_connection_spec_secret.py +1 -1
  114. blaxel/core/client/models/integration_endpoint.py +41 -11
  115. blaxel/core/client/models/integration_endpoint_ignore_models_item.py +45 -0
  116. blaxel/core/client/models/{mcp_definition_entrypoint.py → integration_endpoint_models_item.py} +6 -6
  117. blaxel/core/client/models/job.py +43 -47
  118. blaxel/core/client/models/job_execution.py +30 -37
  119. blaxel/core/client/models/job_execution_metadata.py +3 -3
  120. blaxel/core/client/models/job_execution_spec.py +2 -2
  121. blaxel/core/client/models/job_execution_stats.py +5 -5
  122. blaxel/core/client/models/job_execution_status.py +24 -0
  123. blaxel/core/client/models/job_execution_task.py +12 -4
  124. blaxel/core/client/models/job_execution_task_metadata.py +1 -1
  125. blaxel/core/client/models/job_execution_task_spec.py +2 -2
  126. blaxel/core/client/models/job_execution_task_status.py +23 -0
  127. blaxel/core/client/models/job_runtime.py +172 -0
  128. blaxel/core/client/models/job_runtime_generation.py +18 -0
  129. blaxel/core/client/models/job_spec.py +20 -88
  130. blaxel/core/client/models/location_response.py +5 -5
  131. blaxel/core/client/models/mcp_definition.py +30 -17
  132. blaxel/core/client/models/{job_metrics_tasks_total.py → mcp_definition_categories_item.py} +6 -6
  133. blaxel/core/client/models/metadata.py +23 -17
  134. blaxel/core/client/models/metadata_labels.py +4 -1
  135. blaxel/core/client/models/model.py +43 -47
  136. blaxel/core/client/models/model_runtime.py +99 -0
  137. blaxel/core/client/models/model_runtime_type.py +34 -0
  138. blaxel/core/client/models/model_spec.py +12 -58
  139. blaxel/core/client/models/o_auth.py +23 -6
  140. blaxel/core/client/models/{form_oauth.py → o_auth_scope_item.py} +6 -6
  141. blaxel/core/client/models/pending_invitation_accept.py +2 -1
  142. blaxel/core/client/models/pending_invitation_workspace_details.py +27 -6
  143. blaxel/core/client/models/{metrics_request_total_per_code.py → pending_invitation_workspace_details_emails_item.py} +6 -6
  144. blaxel/core/client/models/policy.py +20 -36
  145. blaxel/core/client/models/policy_location.py +13 -5
  146. blaxel/core/client/models/policy_location_type.py +19 -0
  147. blaxel/core/client/models/policy_max_tokens.py +6 -6
  148. blaxel/core/client/models/policy_resource_type.py +20 -0
  149. blaxel/core/client/models/policy_spec.py +31 -10
  150. blaxel/core/client/models/policy_spec_type.py +19 -0
  151. blaxel/core/client/models/port.py +25 -15
  152. blaxel/core/client/models/port_protocol.py +19 -0
  153. blaxel/core/client/models/preview.py +19 -36
  154. blaxel/core/client/models/preview_metadata.py +12 -10
  155. blaxel/core/client/models/preview_token.py +19 -36
  156. blaxel/core/client/models/preview_token_metadata.py +8 -6
  157. blaxel/core/client/models/repository.py +2 -2
  158. blaxel/core/client/models/revision_configuration.py +3 -3
  159. blaxel/core/client/models/sandbox.py +45 -58
  160. blaxel/core/client/models/sandbox_definition.py +37 -22
  161. blaxel/core/client/models/sandbox_definition_categories_item.py +45 -0
  162. blaxel/core/client/models/sandbox_error.py +148 -0
  163. blaxel/core/client/models/sandbox_error_details.py +45 -0
  164. blaxel/core/client/models/sandbox_lifecycle.py +3 -2
  165. blaxel/core/client/models/sandbox_runtime.py +145 -0
  166. blaxel/core/client/models/sandbox_spec.py +33 -134
  167. blaxel/core/client/models/status.py +25 -0
  168. blaxel/core/client/models/template.py +8 -7
  169. blaxel/core/client/models/template_variable.py +5 -5
  170. blaxel/core/client/models/trigger.py +14 -6
  171. blaxel/core/client/models/trigger_configuration.py +7 -6
  172. blaxel/core/client/models/trigger_type.py +19 -0
  173. blaxel/core/client/models/volume.py +35 -47
  174. blaxel/core/client/models/volume_attachment.py +6 -4
  175. blaxel/core/client/models/volume_spec.py +7 -4
  176. blaxel/core/client/models/volume_state.py +3 -3
  177. blaxel/core/client/models/volume_template.py +19 -33
  178. blaxel/core/client/models/volume_template_state.py +12 -4
  179. blaxel/core/client/models/volume_template_state_status.py +19 -0
  180. blaxel/core/client/models/volume_template_version.py +12 -4
  181. blaxel/core/client/models/volume_template_version_status.py +19 -0
  182. blaxel/core/client/models/workspace.py +35 -25
  183. blaxel/core/client/models/workspace_runtime.py +3 -2
  184. blaxel/core/client/models/workspace_status.py +22 -0
  185. blaxel/core/common/__init__.py +1 -1
  186. blaxel/core/jobs/__init__.py +0 -1
  187. blaxel/core/sandbox/__init__.py +2 -0
  188. blaxel/core/sandbox/client/api/process/post_process.py +8 -4
  189. blaxel/core/sandbox/client/models/__init__.py +0 -2
  190. blaxel/core/sandbox/client/models/process_response.py +16 -0
  191. blaxel/core/sandbox/client/models/process_response_status.py +9 -0
  192. blaxel/core/sandbox/default/__init__.py +2 -0
  193. blaxel/core/sandbox/default/interpreter.py +5 -1
  194. blaxel/core/sandbox/default/preview.py +3 -1
  195. blaxel/core/sandbox/default/sandbox.py +51 -16
  196. blaxel/core/sandbox/sync/process.py +2 -1
  197. blaxel/core/sandbox/sync/sandbox.py +34 -13
  198. blaxel/core/tools/common.py +16 -2
  199. blaxel/core/volume/__init__.py +2 -2
  200. blaxel/core/volume/volume.py +32 -10
  201. blaxel/langgraph/tools.py +34 -2
  202. blaxel/openai/tools.py +33 -1
  203. {blaxel-0.2.34.dist-info → blaxel-0.2.35.dist-info}/METADATA +3 -3
  204. {blaxel-0.2.34.dist-info → blaxel-0.2.35.dist-info}/RECORD +207 -246
  205. blaxel/core/client/models/acl.py +0 -133
  206. blaxel/core/client/models/billable_time_metric.py +0 -89
  207. blaxel/core/client/models/core_spec.py +0 -194
  208. blaxel/core/client/models/core_spec_configurations.py +0 -77
  209. blaxel/core/client/models/histogram_bucket.py +0 -79
  210. blaxel/core/client/models/histogram_stats.py +0 -88
  211. blaxel/core/client/models/integration_model.py +0 -162
  212. blaxel/core/client/models/job_execution_config.py +0 -79
  213. blaxel/core/client/models/job_metrics.py +0 -262
  214. blaxel/core/client/models/jobs_chart_value.py +0 -70
  215. blaxel/core/client/models/jobs_network_chart.py +0 -102
  216. blaxel/core/client/models/jobs_success_failed_chart.py +0 -147
  217. blaxel/core/client/models/jobs_total.py +0 -88
  218. blaxel/core/client/models/last_n_requests_metric.py +0 -97
  219. blaxel/core/client/models/latency_metric.py +0 -148
  220. blaxel/core/client/models/logs_response.py +0 -63
  221. blaxel/core/client/models/logs_response_data.py +0 -99
  222. blaxel/core/client/models/mcp_definition_form.py +0 -45
  223. blaxel/core/client/models/memory_allocation_by_name.py +0 -70
  224. blaxel/core/client/models/memory_allocation_metric.py +0 -61
  225. blaxel/core/client/models/metric.py +0 -79
  226. blaxel/core/client/models/metrics.py +0 -273
  227. blaxel/core/client/models/metrics_models.py +0 -45
  228. blaxel/core/client/models/metrics_rps_per_code.py +0 -45
  229. blaxel/core/client/models/pod_template_spec.py +0 -45
  230. blaxel/core/client/models/request_duration_over_time_metric.py +0 -97
  231. blaxel/core/client/models/request_duration_over_time_metrics.py +0 -84
  232. blaxel/core/client/models/request_total_by_origin_metric.py +0 -129
  233. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin.py +0 -45
  234. blaxel/core/client/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -45
  235. blaxel/core/client/models/request_total_metric.py +0 -155
  236. blaxel/core/client/models/request_total_metric_request_total_per_code.py +0 -45
  237. blaxel/core/client/models/request_total_metric_rps_per_code.py +0 -45
  238. blaxel/core/client/models/request_total_response_data.py +0 -97
  239. blaxel/core/client/models/resource.py +0 -99
  240. blaxel/core/client/models/resource_log.py +0 -88
  241. blaxel/core/client/models/resource_log_chart.py +0 -133
  242. blaxel/core/client/models/resource_log_response.py +0 -83
  243. blaxel/core/client/models/resource_metrics.py +0 -618
  244. blaxel/core/client/models/resource_metrics_request_total_per_code.py +0 -45
  245. blaxel/core/client/models/resource_metrics_request_total_per_code_previous.py +0 -45
  246. blaxel/core/client/models/resource_metrics_rps_per_code.py +0 -45
  247. blaxel/core/client/models/resource_metrics_rps_per_code_previous.py +0 -45
  248. blaxel/core/client/models/resource_trace.py +0 -97
  249. blaxel/core/client/models/runtime.py +0 -317
  250. blaxel/core/client/models/runtime_configuration.py +0 -45
  251. blaxel/core/client/models/runtime_startup_probe.py +0 -45
  252. blaxel/core/client/models/sandbox_metrics.py +0 -88
  253. blaxel/core/client/models/serverless_config.py +0 -117
  254. blaxel/core/client/models/serverless_config_configuration.py +0 -45
  255. blaxel/core/client/models/start_sandbox.py +0 -98
  256. blaxel/core/client/models/stop_sandbox.py +0 -98
  257. blaxel/core/client/models/store_agent.py +0 -181
  258. blaxel/core/client/models/store_agent_labels.py +0 -45
  259. blaxel/core/client/models/store_configuration.py +0 -156
  260. blaxel/core/client/models/store_configuration_option.py +0 -79
  261. blaxel/core/client/models/time_to_first_token_over_time_metrics.py +0 -87
  262. blaxel/core/client/models/token_rate_metric.py +0 -106
  263. blaxel/core/client/models/token_rate_metrics.py +0 -124
  264. blaxel/core/client/models/token_total_metric.py +0 -112
  265. blaxel/core/client/models/trace_ids_response.py +0 -45
  266. blaxel/core/client/models/websocket_channel.py +0 -97
  267. blaxel/core/client/models/websocket_message.py +0 -106
  268. blaxel/core/sandbox/client/api/root/delete.py +0 -130
  269. blaxel/core/sandbox/client/api/root/get.py +0 -130
  270. blaxel/core/sandbox/client/api/root/options.py +0 -130
  271. blaxel/core/sandbox/client/api/root/patch.py +0 -130
  272. blaxel/core/sandbox/client/api/root/post.py +0 -130
  273. blaxel/core/sandbox/client/api/root/put.py +0 -130
  274. /blaxel/core/{sandbox/client/api/root → client/api/mcphub}/__init__.py +0 -0
  275. {blaxel-0.2.34.dist-info → blaxel-0.2.35.dist-info}/WHEEL +0 -0
  276. {blaxel-0.2.34.dist-info → blaxel-0.2.35.dist-info}/licenses/LICENSE +0 -0
@@ -1,10 +1,11 @@
1
1
  from http import HTTPStatus
2
- from typing import Any
2
+ from typing import Any, Union
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import Client
8
+ from ...models.error import Error
8
9
  from ...models.sandbox import Sandbox
9
10
  from ...types import Response
10
11
 
@@ -18,7 +19,9 @@ def _get_kwargs() -> dict[str, Any]:
18
19
  return _kwargs
19
20
 
20
21
 
21
- def _parse_response(*, client: Client, response: httpx.Response) -> list["Sandbox"] | None:
22
+ def _parse_response(
23
+ *, client: Client, response: httpx.Response
24
+ ) -> Union[Error, list["Sandbox"]] | None:
22
25
  if response.status_code == 200:
23
26
  response_200 = []
24
27
  _response_200 = response.json()
@@ -28,13 +31,27 @@ def _parse_response(*, client: Client, response: httpx.Response) -> list["Sandbo
28
31
  response_200.append(response_200_item)
29
32
 
30
33
  return response_200
34
+ if response.status_code == 401:
35
+ response_401 = Error.from_dict(response.json())
36
+
37
+ return response_401
38
+ if response.status_code == 403:
39
+ response_403 = Error.from_dict(response.json())
40
+
41
+ return response_403
42
+ if response.status_code == 500:
43
+ response_500 = Error.from_dict(response.json())
44
+
45
+ return response_500
31
46
  if client.raise_on_unexpected_status:
32
47
  raise errors.UnexpectedStatus(response.status_code, response.content)
33
48
  else:
34
49
  return None
35
50
 
36
51
 
37
- def _build_response(*, client: Client, response: httpx.Response) -> Response[list["Sandbox"]]:
52
+ def _build_response(
53
+ *, client: Client, response: httpx.Response
54
+ ) -> Response[Union[Error, list["Sandbox"]]]:
38
55
  return Response(
39
56
  status_code=HTTPStatus(response.status_code),
40
57
  content=response.content,
@@ -46,17 +63,18 @@ def _build_response(*, client: Client, response: httpx.Response) -> Response[lis
46
63
  def sync_detailed(
47
64
  *,
48
65
  client: Client,
49
- ) -> Response[list["Sandbox"]]:
50
- """List Sandboxes
66
+ ) -> Response[Union[Error, list["Sandbox"]]]:
67
+ """List sandboxes
51
68
 
52
- Returns a list of all Sandboxes in the workspace.
69
+ Returns all sandboxes in the workspace. Each sandbox includes its configuration, status, and
70
+ endpoint URL.
53
71
 
54
72
  Raises:
55
73
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
74
  httpx.TimeoutException: If the request takes longer than Client.timeout.
57
75
 
58
76
  Returns:
59
- Response[list['Sandbox']]
77
+ Response[Union[Error, list['Sandbox']]]
60
78
  """
61
79
 
62
80
  kwargs = _get_kwargs()
@@ -71,17 +89,18 @@ def sync_detailed(
71
89
  def sync(
72
90
  *,
73
91
  client: Client,
74
- ) -> list["Sandbox"] | None:
75
- """List Sandboxes
92
+ ) -> Union[Error, list["Sandbox"]] | None:
93
+ """List sandboxes
76
94
 
77
- Returns a list of all Sandboxes in the workspace.
95
+ Returns all sandboxes in the workspace. Each sandbox includes its configuration, status, and
96
+ endpoint URL.
78
97
 
79
98
  Raises:
80
99
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
100
  httpx.TimeoutException: If the request takes longer than Client.timeout.
82
101
 
83
102
  Returns:
84
- list['Sandbox']
103
+ Union[Error, list['Sandbox']]
85
104
  """
86
105
 
87
106
  return sync_detailed(
@@ -92,17 +111,18 @@ def sync(
92
111
  async def asyncio_detailed(
93
112
  *,
94
113
  client: Client,
95
- ) -> Response[list["Sandbox"]]:
96
- """List Sandboxes
114
+ ) -> Response[Union[Error, list["Sandbox"]]]:
115
+ """List sandboxes
97
116
 
98
- Returns a list of all Sandboxes in the workspace.
117
+ Returns all sandboxes in the workspace. Each sandbox includes its configuration, status, and
118
+ endpoint URL.
99
119
 
100
120
  Raises:
101
121
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
122
  httpx.TimeoutException: If the request takes longer than Client.timeout.
103
123
 
104
124
  Returns:
105
- Response[list['Sandbox']]
125
+ Response[Union[Error, list['Sandbox']]]
106
126
  """
107
127
 
108
128
  kwargs = _get_kwargs()
@@ -115,17 +135,18 @@ async def asyncio_detailed(
115
135
  async def asyncio(
116
136
  *,
117
137
  client: Client,
118
- ) -> list["Sandbox"] | None:
119
- """List Sandboxes
138
+ ) -> Union[Error, list["Sandbox"]] | None:
139
+ """List sandboxes
120
140
 
121
- Returns a list of all Sandboxes in the workspace.
141
+ Returns all sandboxes in the workspace. Each sandbox includes its configuration, status, and
142
+ endpoint URL.
122
143
 
123
144
  Raises:
124
145
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
146
  httpx.TimeoutException: If the request takes longer than Client.timeout.
126
147
 
127
148
  Returns:
128
- list['Sandbox']
149
+ Union[Error, list['Sandbox']]
129
150
  """
130
151
 
131
152
  return (
@@ -1,10 +1,11 @@
1
1
  from http import HTTPStatus
2
- from typing import Any
2
+ from typing import Any, Union
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import Client
8
+ from ...models.error import Error
8
9
  from ...models.sandbox import Sandbox
9
10
  from ...types import Response
10
11
 
@@ -33,18 +34,38 @@ def _get_kwargs(
33
34
  return _kwargs
34
35
 
35
36
 
36
- def _parse_response(*, client: Client, response: httpx.Response) -> Sandbox | None:
37
+ def _parse_response(*, client: Client, response: httpx.Response) -> Union[Error, Sandbox] | None:
37
38
  if response.status_code == 200:
38
39
  response_200 = Sandbox.from_dict(response.json())
39
40
 
40
41
  return response_200
42
+ if response.status_code == 400:
43
+ response_400 = Error.from_dict(response.json())
44
+
45
+ return response_400
46
+ if response.status_code == 401:
47
+ response_401 = Error.from_dict(response.json())
48
+
49
+ return response_401
50
+ if response.status_code == 403:
51
+ response_403 = Error.from_dict(response.json())
52
+
53
+ return response_403
54
+ if response.status_code == 404:
55
+ response_404 = Error.from_dict(response.json())
56
+
57
+ return response_404
58
+ if response.status_code == 500:
59
+ response_500 = Error.from_dict(response.json())
60
+
61
+ return response_500
41
62
  if client.raise_on_unexpected_status:
42
63
  raise errors.UnexpectedStatus(response.status_code, response.content)
43
64
  else:
44
65
  return None
45
66
 
46
67
 
47
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Sandbox]:
68
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Error, Sandbox]]:
48
69
  return Response(
49
70
  status_code=HTTPStatus(response.status_code),
50
71
  content=response.content,
@@ -58,21 +79,24 @@ def sync_detailed(
58
79
  *,
59
80
  client: Client,
60
81
  body: Sandbox,
61
- ) -> Response[Sandbox]:
62
- """Update Sandbox
82
+ ) -> Response[Union[Error, Sandbox]]:
83
+ """Update sandbox
63
84
 
64
- Update a Sandbox by name.
85
+ Updates a sandbox's configuration. Note that certain changes (like image or memory) may reset the
86
+ sandbox state. Use lifecycle policies to control automatic cleanup.
65
87
 
66
88
  Args:
67
89
  sandbox_name (str):
68
- body (Sandbox): Micro VM for running agentic tasks
90
+ body (Sandbox): Lightweight virtual machine for secure AI code execution. Sandboxes resume
91
+ from standby in under 25ms and automatically scale to zero after inactivity, preserving
92
+ memory state including running processes and filesystem.
69
93
 
70
94
  Raises:
71
95
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
72
96
  httpx.TimeoutException: If the request takes longer than Client.timeout.
73
97
 
74
98
  Returns:
75
- Response[Sandbox]
99
+ Response[Union[Error, Sandbox]]
76
100
  """
77
101
 
78
102
  kwargs = _get_kwargs(
@@ -92,21 +116,24 @@ def sync(
92
116
  *,
93
117
  client: Client,
94
118
  body: Sandbox,
95
- ) -> Sandbox | None:
96
- """Update Sandbox
119
+ ) -> Union[Error, Sandbox] | None:
120
+ """Update sandbox
97
121
 
98
- Update a Sandbox by name.
122
+ Updates a sandbox's configuration. Note that certain changes (like image or memory) may reset the
123
+ sandbox state. Use lifecycle policies to control automatic cleanup.
99
124
 
100
125
  Args:
101
126
  sandbox_name (str):
102
- body (Sandbox): Micro VM for running agentic tasks
127
+ body (Sandbox): Lightweight virtual machine for secure AI code execution. Sandboxes resume
128
+ from standby in under 25ms and automatically scale to zero after inactivity, preserving
129
+ memory state including running processes and filesystem.
103
130
 
104
131
  Raises:
105
132
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106
133
  httpx.TimeoutException: If the request takes longer than Client.timeout.
107
134
 
108
135
  Returns:
109
- Sandbox
136
+ Union[Error, Sandbox]
110
137
  """
111
138
 
112
139
  return sync_detailed(
@@ -121,21 +148,24 @@ async def asyncio_detailed(
121
148
  *,
122
149
  client: Client,
123
150
  body: Sandbox,
124
- ) -> Response[Sandbox]:
125
- """Update Sandbox
151
+ ) -> Response[Union[Error, Sandbox]]:
152
+ """Update sandbox
126
153
 
127
- Update a Sandbox by name.
154
+ Updates a sandbox's configuration. Note that certain changes (like image or memory) may reset the
155
+ sandbox state. Use lifecycle policies to control automatic cleanup.
128
156
 
129
157
  Args:
130
158
  sandbox_name (str):
131
- body (Sandbox): Micro VM for running agentic tasks
159
+ body (Sandbox): Lightweight virtual machine for secure AI code execution. Sandboxes resume
160
+ from standby in under 25ms and automatically scale to zero after inactivity, preserving
161
+ memory state including running processes and filesystem.
132
162
 
133
163
  Raises:
134
164
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
135
165
  httpx.TimeoutException: If the request takes longer than Client.timeout.
136
166
 
137
167
  Returns:
138
- Response[Sandbox]
168
+ Response[Union[Error, Sandbox]]
139
169
  """
140
170
 
141
171
  kwargs = _get_kwargs(
@@ -153,21 +183,24 @@ async def asyncio(
153
183
  *,
154
184
  client: Client,
155
185
  body: Sandbox,
156
- ) -> Sandbox | None:
157
- """Update Sandbox
186
+ ) -> Union[Error, Sandbox] | None:
187
+ """Update sandbox
158
188
 
159
- Update a Sandbox by name.
189
+ Updates a sandbox's configuration. Note that certain changes (like image or memory) may reset the
190
+ sandbox state. Use lifecycle policies to control automatic cleanup.
160
191
 
161
192
  Args:
162
193
  sandbox_name (str):
163
- body (Sandbox): Micro VM for running agentic tasks
194
+ body (Sandbox): Lightweight virtual machine for secure AI code execution. Sandboxes resume
195
+ from standby in under 25ms and automatically scale to zero after inactivity, preserving
196
+ memory state including running processes and filesystem.
164
197
 
165
198
  Raises:
166
199
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
167
200
  httpx.TimeoutException: If the request takes longer than Client.timeout.
168
201
 
169
202
  Returns:
170
- Sandbox
203
+ Union[Error, Sandbox]
171
204
  """
172
205
 
173
206
  return (
@@ -42,7 +42,10 @@ def sync_detailed(
42
42
  *,
43
43
  client: Client,
44
44
  ) -> Response[Configuration]:
45
- """List all configurations
45
+ """Get platform configuration
46
+
47
+ Returns global platform configuration including available regions, countries, continents, and
48
+ private locations for deployment policies.
46
49
 
47
50
  Raises:
48
51
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -65,7 +68,10 @@ def sync(
65
68
  *,
66
69
  client: Client,
67
70
  ) -> Configuration | None:
68
- """List all configurations
71
+ """Get platform configuration
72
+
73
+ Returns global platform configuration including available regions, countries, continents, and
74
+ private locations for deployment policies.
69
75
 
70
76
  Raises:
71
77
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -84,7 +90,10 @@ async def asyncio_detailed(
84
90
  *,
85
91
  client: Client,
86
92
  ) -> Response[Configuration]:
87
- """List all configurations
93
+ """Get platform configuration
94
+
95
+ Returns global platform configuration including available regions, countries, continents, and
96
+ private locations for deployment policies.
88
97
 
89
98
  Raises:
90
99
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -105,7 +114,10 @@ async def asyncio(
105
114
  *,
106
115
  client: Client,
107
116
  ) -> Configuration | None:
108
- """List all configurations
117
+ """Get platform configuration
118
+
119
+ Returns global platform configuration including available regions, countries, continents, and
120
+ private locations for deployment policies.
109
121
 
110
122
  Raises:
111
123
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -59,6 +59,9 @@ def sync_detailed(
59
59
  ) -> Response[CustomDomain]:
60
60
  """Create custom domain
61
61
 
62
+ Creates a new custom domain for preview deployments. After creation, you must configure DNS records
63
+ and verify domain ownership before it becomes active.
64
+
62
65
  Args:
63
66
  body (CustomDomain): Custom domain for preview deployments
64
67
  The custom domain represents a base domain (e.g., example.com) that will be used
@@ -91,6 +94,9 @@ def sync(
91
94
  ) -> CustomDomain | None:
92
95
  """Create custom domain
93
96
 
97
+ Creates a new custom domain for preview deployments. After creation, you must configure DNS records
98
+ and verify domain ownership before it becomes active.
99
+
94
100
  Args:
95
101
  body (CustomDomain): Custom domain for preview deployments
96
102
  The custom domain represents a base domain (e.g., example.com) that will be used
@@ -118,6 +124,9 @@ async def asyncio_detailed(
118
124
  ) -> Response[CustomDomain]:
119
125
  """Create custom domain
120
126
 
127
+ Creates a new custom domain for preview deployments. After creation, you must configure DNS records
128
+ and verify domain ownership before it becomes active.
129
+
121
130
  Args:
122
131
  body (CustomDomain): Custom domain for preview deployments
123
132
  The custom domain represents a base domain (e.g., example.com) that will be used
@@ -148,6 +157,9 @@ async def asyncio(
148
157
  ) -> CustomDomain | None:
149
158
  """Create custom domain
150
159
 
160
+ Creates a new custom domain for preview deployments. After creation, you must configure DNS records
161
+ and verify domain ownership before it becomes active.
162
+
151
163
  Args:
152
164
  body (CustomDomain): Custom domain for preview deployments
153
165
  The custom domain represents a base domain (e.g., example.com) that will be used
@@ -47,7 +47,10 @@ def sync_detailed(
47
47
  *,
48
48
  client: Client,
49
49
  ) -> Response[list["CustomDomain"]]:
50
- """List all custom domains
50
+ """List custom domains
51
+
52
+ Returns all custom domains configured in the workspace. Custom domains allow serving preview
53
+ deployments under your own domain (e.g., preview.yourdomain.com).
51
54
 
52
55
  Raises:
53
56
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -70,7 +73,10 @@ def sync(
70
73
  *,
71
74
  client: Client,
72
75
  ) -> list["CustomDomain"] | None:
73
- """List all custom domains
76
+ """List custom domains
77
+
78
+ Returns all custom domains configured in the workspace. Custom domains allow serving preview
79
+ deployments under your own domain (e.g., preview.yourdomain.com).
74
80
 
75
81
  Raises:
76
82
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -89,7 +95,10 @@ async def asyncio_detailed(
89
95
  *,
90
96
  client: Client,
91
97
  ) -> Response[list["CustomDomain"]]:
92
- """List all custom domains
98
+ """List custom domains
99
+
100
+ Returns all custom domains configured in the workspace. Custom domains allow serving preview
101
+ deployments under your own domain (e.g., preview.yourdomain.com).
93
102
 
94
103
  Raises:
95
104
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -110,7 +119,10 @@ async def asyncio(
110
119
  *,
111
120
  client: Client,
112
121
  ) -> list["CustomDomain"] | None:
113
- """List all custom domains
122
+ """List custom domains
123
+
124
+ Returns all custom domains configured in the workspace. Custom domains allow serving preview
125
+ deployments under your own domain (e.g., preview.yourdomain.com).
114
126
 
115
127
  Raises:
116
128
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -47,7 +47,8 @@ def sync_detailed(
47
47
  ) -> Response[Template]:
48
48
  """Get template
49
49
 
50
- Returns a template by name.
50
+ Returns detailed information about a deployment template including its configuration, source code
51
+ reference, and available parameters.
51
52
 
52
53
  Args:
53
54
  template_name (str):
@@ -78,7 +79,8 @@ def sync(
78
79
  ) -> Template | None:
79
80
  """Get template
80
81
 
81
- Returns a template by name.
82
+ Returns detailed information about a deployment template including its configuration, source code
83
+ reference, and available parameters.
82
84
 
83
85
  Args:
84
86
  template_name (str):
@@ -104,7 +106,8 @@ async def asyncio_detailed(
104
106
  ) -> Response[Template]:
105
107
  """Get template
106
108
 
107
- Returns a template by name.
109
+ Returns detailed information about a deployment template including its configuration, source code
110
+ reference, and available parameters.
108
111
 
109
112
  Args:
110
113
  template_name (str):
@@ -133,7 +136,8 @@ async def asyncio(
133
136
  ) -> Template | None:
134
137
  """Get template
135
138
 
136
- Returns a template by name.
139
+ Returns detailed information about a deployment template including its configuration, source code
140
+ reference, and available parameters.
137
141
 
138
142
  Args:
139
143
  template_name (str):
@@ -1,10 +1,11 @@
1
1
  from http import HTTPStatus
2
- from typing import Any
2
+ from typing import Any, Union
3
3
 
4
4
  import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import Client
8
+ from ...models.error import Error
8
9
  from ...models.function import Function
9
10
  from ...types import Response
10
11
 
@@ -32,18 +33,40 @@ def _get_kwargs(
32
33
  return _kwargs
33
34
 
34
35
 
35
- def _parse_response(*, client: Client, response: httpx.Response) -> Function | None:
36
+ def _parse_response(*, client: Client, response: httpx.Response) -> Union[Error, Function] | None:
36
37
  if response.status_code == 200:
37
38
  response_200 = Function.from_dict(response.json())
38
39
 
39
40
  return response_200
41
+ if response.status_code == 400:
42
+ response_400 = Error.from_dict(response.json())
43
+
44
+ return response_400
45
+ if response.status_code == 401:
46
+ response_401 = Error.from_dict(response.json())
47
+
48
+ return response_401
49
+ if response.status_code == 403:
50
+ response_403 = Error.from_dict(response.json())
51
+
52
+ return response_403
53
+ if response.status_code == 409:
54
+ response_409 = Error.from_dict(response.json())
55
+
56
+ return response_409
57
+ if response.status_code == 500:
58
+ response_500 = Error.from_dict(response.json())
59
+
60
+ return response_500
40
61
  if client.raise_on_unexpected_status:
41
62
  raise errors.UnexpectedStatus(response.status_code, response.content)
42
63
  else:
43
64
  return None
44
65
 
45
66
 
46
- def _build_response(*, client: Client, response: httpx.Response) -> Response[Function]:
67
+ def _build_response(
68
+ *, client: Client, response: httpx.Response
69
+ ) -> Response[Union[Error, Function]]:
47
70
  return Response(
48
71
  status_code=HTTPStatus(response.status_code),
49
72
  content=response.content,
@@ -56,18 +79,23 @@ def sync_detailed(
56
79
  *,
57
80
  client: Client,
58
81
  body: Function,
59
- ) -> Response[Function]:
60
- """Create function
82
+ ) -> Response[Union[Error, Function]]:
83
+ """Create MCP server
84
+
85
+ Creates a new MCP server function deployment. The function will expose tools via the Model Context
86
+ Protocol that can be used by AI agents. Supports streamable HTTP transport.
61
87
 
62
88
  Args:
63
- body (Function): Function
89
+ body (Function): MCP server deployment that exposes tools for AI agents via the Model
90
+ Context Protocol (MCP). Deployed as a serverless auto-scaling endpoint using streamable
91
+ HTTP transport.
64
92
 
65
93
  Raises:
66
94
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
95
  httpx.TimeoutException: If the request takes longer than Client.timeout.
68
96
 
69
97
  Returns:
70
- Response[Function]
98
+ Response[Union[Error, Function]]
71
99
  """
72
100
 
73
101
  kwargs = _get_kwargs(
@@ -85,18 +113,23 @@ def sync(
85
113
  *,
86
114
  client: Client,
87
115
  body: Function,
88
- ) -> Function | None:
89
- """Create function
116
+ ) -> Union[Error, Function] | None:
117
+ """Create MCP server
118
+
119
+ Creates a new MCP server function deployment. The function will expose tools via the Model Context
120
+ Protocol that can be used by AI agents. Supports streamable HTTP transport.
90
121
 
91
122
  Args:
92
- body (Function): Function
123
+ body (Function): MCP server deployment that exposes tools for AI agents via the Model
124
+ Context Protocol (MCP). Deployed as a serverless auto-scaling endpoint using streamable
125
+ HTTP transport.
93
126
 
94
127
  Raises:
95
128
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
96
129
  httpx.TimeoutException: If the request takes longer than Client.timeout.
97
130
 
98
131
  Returns:
99
- Function
132
+ Union[Error, Function]
100
133
  """
101
134
 
102
135
  return sync_detailed(
@@ -109,18 +142,23 @@ async def asyncio_detailed(
109
142
  *,
110
143
  client: Client,
111
144
  body: Function,
112
- ) -> Response[Function]:
113
- """Create function
145
+ ) -> Response[Union[Error, Function]]:
146
+ """Create MCP server
147
+
148
+ Creates a new MCP server function deployment. The function will expose tools via the Model Context
149
+ Protocol that can be used by AI agents. Supports streamable HTTP transport.
114
150
 
115
151
  Args:
116
- body (Function): Function
152
+ body (Function): MCP server deployment that exposes tools for AI agents via the Model
153
+ Context Protocol (MCP). Deployed as a serverless auto-scaling endpoint using streamable
154
+ HTTP transport.
117
155
 
118
156
  Raises:
119
157
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
120
158
  httpx.TimeoutException: If the request takes longer than Client.timeout.
121
159
 
122
160
  Returns:
123
- Response[Function]
161
+ Response[Union[Error, Function]]
124
162
  """
125
163
 
126
164
  kwargs = _get_kwargs(
@@ -136,18 +174,23 @@ async def asyncio(
136
174
  *,
137
175
  client: Client,
138
176
  body: Function,
139
- ) -> Function | None:
140
- """Create function
177
+ ) -> Union[Error, Function] | None:
178
+ """Create MCP server
179
+
180
+ Creates a new MCP server function deployment. The function will expose tools via the Model Context
181
+ Protocol that can be used by AI agents. Supports streamable HTTP transport.
141
182
 
142
183
  Args:
143
- body (Function): Function
184
+ body (Function): MCP server deployment that exposes tools for AI agents via the Model
185
+ Context Protocol (MCP). Deployed as a serverless auto-scaling endpoint using streamable
186
+ HTTP transport.
144
187
 
145
188
  Raises:
146
189
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
190
  httpx.TimeoutException: If the request takes longer than Client.timeout.
148
191
 
149
192
  Returns:
150
- Function
193
+ Union[Error, Function]
151
194
  """
152
195
 
153
196
  return (