blaxel 0.1.21rc69__py3-none-any.whl → 0.2.0rc1__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 (421) hide show
  1. blaxel/__init__.py +6 -3
  2. blaxel/core/__init__.py +44 -0
  3. blaxel/core/agents/__init__.py +115 -0
  4. blaxel/{authentication → core/authentication}/apikey.py +1 -0
  5. blaxel/{authentication → core/authentication}/clientcredentials.py +6 -2
  6. blaxel/{client → core/client}/api/agents/create_agent.py +1 -1
  7. blaxel/{client → core/client}/api/agents/update_agent.py +1 -1
  8. blaxel/{client → core/client}/api/compute/create_sandbox.py +1 -1
  9. blaxel/{client → core/client}/api/compute/create_sandbox_preview.py +1 -1
  10. blaxel/{client → core/client}/api/compute/create_sandbox_preview_token.py +1 -1
  11. blaxel/{client → core/client}/api/compute/update_sandbox.py +1 -1
  12. blaxel/{client → core/client}/api/compute/update_sandbox_preview.py +1 -1
  13. blaxel/{client → core/client}/api/functions/create_function.py +1 -1
  14. blaxel/{client → core/client}/api/functions/update_function.py +1 -1
  15. blaxel/{client → core/client}/api/integrations/create_integration_connection.py +1 -1
  16. blaxel/{client → core/client}/api/integrations/update_integration_connection.py +1 -1
  17. blaxel/{client → core/client}/api/jobs/create_job.py +1 -1
  18. blaxel/{client → core/client}/api/jobs/update_job.py +1 -1
  19. blaxel/{client → core/client}/api/knowledgebases/create_knowledgebase.py +1 -1
  20. blaxel/{client → core/client}/api/knowledgebases/update_knowledgebase.py +1 -1
  21. blaxel/{client → core/client}/api/models/create_model.py +1 -1
  22. blaxel/{client → core/client}/api/models/update_model.py +1 -1
  23. blaxel/{client → core/client}/api/policies/create_policy.py +1 -1
  24. blaxel/{client → core/client}/api/policies/update_policy.py +1 -1
  25. blaxel/{client → core/client}/api/service_accounts/create_api_key_for_service_account.py +1 -1
  26. blaxel/{client → core/client}/api/service_accounts/create_workspace_service_account.py +1 -1
  27. blaxel/{client → core/client}/api/service_accounts/update_workspace_service_account.py +1 -1
  28. blaxel/{client → core/client}/api/workspaces/check_workspace_availability.py +1 -1
  29. blaxel/{client → core/client}/api/workspaces/create_worspace.py +1 -1
  30. blaxel/{client → core/client}/api/workspaces/invite_workspace_user.py +1 -1
  31. blaxel/{client → core/client}/api/workspaces/update_workspace.py +1 -1
  32. blaxel/{client → core/client}/api/workspaces/update_workspace_user_role.py +1 -1
  33. blaxel/{client → core/client}/models/__init__.py +18 -0
  34. blaxel/{client → core/client}/models/agent.py +1 -1
  35. blaxel/{client → core/client}/models/agent_spec.py +2 -2
  36. blaxel/core/client/models/billable_time_metric.py +70 -0
  37. blaxel/{client → core/client}/models/core_spec.py +1 -1
  38. blaxel/{client → core/client}/models/function.py +1 -1
  39. blaxel/{client → core/client}/models/function_schema_properties.py +1 -1
  40. blaxel/{client → core/client}/models/function_spec.py +2 -2
  41. blaxel/{client → core/client}/models/integration.py +2 -2
  42. blaxel/{client → core/client}/models/integration_endpoints.py +1 -1
  43. blaxel/{client → core/client}/models/job.py +1 -1
  44. blaxel/{client → core/client}/models/job_spec.py +1 -1
  45. blaxel/{client → core/client}/models/jobs_chart_value.py +2 -2
  46. blaxel/{client → core/client}/models/knowledgebase.py +1 -1
  47. blaxel/{client → core/client}/models/location_response.py +1 -1
  48. blaxel/core/client/models/logs_response.py +63 -0
  49. blaxel/core/client/models/logs_response_data.py +99 -0
  50. blaxel/core/client/models/memory_allocation_by_name.py +70 -0
  51. blaxel/{client → core/client}/models/metadata.py +9 -0
  52. blaxel/{client → core/client}/models/model.py +1 -1
  53. blaxel/{client → core/client}/models/model_spec.py +1 -1
  54. blaxel/{client → core/client}/models/policy_spec.py +2 -2
  55. blaxel/core/client/models/resource.py +79 -0
  56. blaxel/core/client/models/resource_log_chart.py +133 -0
  57. blaxel/core/client/models/resource_log_response.py +83 -0
  58. blaxel/{client → core/client}/models/resource_metrics.py +27 -3
  59. blaxel/core/client/models/resource_trace.py +97 -0
  60. blaxel/{client → core/client}/models/runtime.py +1 -1
  61. blaxel/{client → core/client}/models/sandbox.py +1 -1
  62. blaxel/{client → core/client}/models/sandbox_definition.py +1 -1
  63. blaxel/{client → core/client}/models/sandbox_spec.py +1 -1
  64. blaxel/{client → core/client}/models/store_agent.py +1 -1
  65. blaxel/{client → core/client}/models/store_configuration.py +1 -1
  66. blaxel/{client → core/client}/models/template.py +1 -1
  67. blaxel/core/client/models/websocket_message.py +106 -0
  68. blaxel/core/common/__init__.py +6 -0
  69. blaxel/core/common/autoload.py +21 -0
  70. blaxel/{common → core/common}/internal.py +34 -62
  71. blaxel/core/common/logger.py +131 -0
  72. blaxel/{jobs → core/jobs}/__init__.py +41 -61
  73. blaxel/core/mcp/__init__.py +4 -0
  74. blaxel/{mcp → core/mcp}/client.py +13 -7
  75. blaxel/{mcp → core/mcp}/server.py +76 -17
  76. blaxel/core/models/__init__.py +52 -0
  77. blaxel/core/sandbox/__init__.py +29 -0
  78. blaxel/core/sandbox/action.py +79 -0
  79. blaxel/{sandbox → core/sandbox}/client/api/filesystem/put_filesystem_path.py +1 -1
  80. blaxel/{sandbox → core/sandbox}/client/api/network/post_network_process_pid_monitor.py +1 -1
  81. blaxel/core/sandbox/client/api/process/__init__.py +0 -0
  82. blaxel/{sandbox → core/sandbox}/client/api/process/delete_process_identifier_kill.py +0 -26
  83. blaxel/{sandbox → core/sandbox}/client/api/process/post_process.py +1 -1
  84. blaxel/{sandbox → core/sandbox}/client/models/__init__.py +2 -2
  85. blaxel/{sandbox → core/sandbox}/client/models/directory.py +2 -2
  86. blaxel/{sandbox → core/sandbox}/client/models/process_request.py +25 -1
  87. blaxel/core/sandbox/client/models/process_request_env.py +49 -0
  88. blaxel/core/sandbox/filesystem.py +280 -0
  89. blaxel/core/sandbox/network.py +10 -0
  90. blaxel/{sandbox → core/sandbox}/preview.py +45 -17
  91. blaxel/core/sandbox/process.py +159 -0
  92. blaxel/{sandbox → core/sandbox}/sandbox.py +62 -5
  93. blaxel/core/sandbox/session.py +124 -0
  94. blaxel/core/sandbox/types.py +103 -0
  95. blaxel/{tools → core/tools}/__init__.py +63 -91
  96. blaxel/crewai/__init__.py +4 -0
  97. blaxel/{models/crewai.py → crewai/model.py} +4 -2
  98. blaxel/crewai/py.typed +0 -0
  99. blaxel/crewai/tools.py +26 -0
  100. blaxel/googleadk/__init__.py +4 -0
  101. blaxel/{models/googleadk.py → googleadk/model.py} +8 -2
  102. blaxel/googleadk/py.typed +0 -0
  103. blaxel/googleadk/tools.py +72 -0
  104. blaxel/langgraph/__init__.py +4 -0
  105. blaxel/{models/langchain.py → langgraph/model.py} +8 -4
  106. blaxel/langgraph/py.typed +0 -0
  107. blaxel/{tools/langchain.py → langgraph/tools.py} +7 -3
  108. blaxel/livekit/__init__.py +4 -0
  109. blaxel/{models/livekit.py → livekit/model.py} +7 -1
  110. blaxel/livekit/py.typed +0 -0
  111. blaxel/{tools/livekit.py → livekit/tools.py} +8 -1
  112. blaxel/llamaindex/__init__.py +4 -0
  113. blaxel/{models/llamaindex.py → llamaindex/model.py} +6 -3
  114. blaxel/llamaindex/py.typed +0 -0
  115. blaxel/{tools/llamaindex.py → llamaindex/tools.py} +7 -4
  116. blaxel/openai/__init__.py +4 -0
  117. blaxel/{models/openai.py → openai/model.py} +4 -2
  118. blaxel/openai/py.typed +0 -0
  119. blaxel/{tools/openai.py → openai/tools.py} +7 -3
  120. blaxel/pydantic/__init__.py +4 -0
  121. blaxel/{models/custom/pydantic → pydantic/custom}/gemini.py +0 -1
  122. blaxel/{models/pydantic.py → pydantic/model.py} +6 -4
  123. blaxel/pydantic/py.typed +0 -0
  124. blaxel/{tools/pydantic.py → pydantic/tools.py} +6 -3
  125. blaxel/telemetry/__init__.py +6 -0
  126. blaxel/telemetry/instrumentation/blaxel_core.py +124 -0
  127. blaxel/telemetry/instrumentation/blaxel_langgraph.py +74 -0
  128. blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py +360 -0
  129. blaxel/telemetry/instrumentation/blaxel_llamaindex.py +89 -0
  130. blaxel/telemetry/instrumentation/map.py +61 -0
  131. blaxel/telemetry/instrumentation/utils.py +74 -0
  132. blaxel/{common → telemetry/log}/logger.py +6 -12
  133. blaxel/{instrumentation → telemetry}/manager.py +20 -12
  134. blaxel/telemetry/py.typed +0 -0
  135. blaxel/{instrumentation → telemetry}/span.py +12 -1
  136. blaxel-0.2.0rc1.dist-info/METADATA +224 -0
  137. blaxel-0.2.0rc1.dist-info/RECORD +408 -0
  138. blaxel/agents/__init__.py +0 -135
  139. blaxel/common/autoload.py +0 -9
  140. blaxel/instrumentation/map.py +0 -49
  141. blaxel/mcp/__init__.py +0 -3
  142. blaxel/models/__init__.py +0 -104
  143. blaxel/sandbox/base.py +0 -68
  144. blaxel/sandbox/client/models/process_kill_request.py +0 -60
  145. blaxel/sandbox/filesystem.py +0 -104
  146. blaxel/sandbox/process.py +0 -56
  147. blaxel/tools/crewai.py +0 -22
  148. blaxel/tools/googleadk.py +0 -66
  149. blaxel-0.1.21rc69.dist-info/METADATA +0 -169
  150. blaxel-0.1.21rc69.dist-info/RECORD +0 -370
  151. /blaxel/{authentication → core/authentication}/__init__.py +0 -0
  152. /blaxel/{authentication → core/authentication}/devicemode.py +0 -0
  153. /blaxel/{authentication → core/authentication}/oauth.py +0 -0
  154. /blaxel/{authentication → core/authentication}/types.py +0 -0
  155. /blaxel/{cache → core/cache}/__init__.py +0 -0
  156. /blaxel/{cache → core/cache}/cache.py +0 -0
  157. /blaxel/{client → core/client}/__init__.py +0 -0
  158. /blaxel/{client → core/client}/api/__init__.py +0 -0
  159. /blaxel/{client → core/client}/api/agents/__init__.py +0 -0
  160. /blaxel/{client → core/client}/api/agents/delete_agent.py +0 -0
  161. /blaxel/{client → core/client}/api/agents/get_agent.py +0 -0
  162. /blaxel/{client → core/client}/api/agents/list_agent_revisions.py +0 -0
  163. /blaxel/{client → core/client}/api/agents/list_agents.py +0 -0
  164. /blaxel/{client → core/client}/api/compute/__init__.py +0 -0
  165. /blaxel/{client → core/client}/api/compute/delete_sandbox.py +0 -0
  166. /blaxel/{client → core/client}/api/compute/delete_sandbox_preview.py +0 -0
  167. /blaxel/{client → core/client}/api/compute/delete_sandbox_preview_token.py +0 -0
  168. /blaxel/{client → core/client}/api/compute/get_sandbox.py +0 -0
  169. /blaxel/{client → core/client}/api/compute/get_sandbox_preview.py +0 -0
  170. /blaxel/{client → core/client}/api/compute/list_sandbox_preview_tokens.py +0 -0
  171. /blaxel/{client → core/client}/api/compute/list_sandbox_previews.py +0 -0
  172. /blaxel/{client → core/client}/api/compute/list_sandboxes.py +0 -0
  173. /blaxel/{client → core/client}/api/compute/start_sandbox.py +0 -0
  174. /blaxel/{client → core/client}/api/compute/stop_sandbox.py +0 -0
  175. /blaxel/{client → core/client}/api/configurations/__init__.py +0 -0
  176. /blaxel/{client → core/client}/api/configurations/get_configuration.py +0 -0
  177. /blaxel/{client → core/client}/api/default/__init__.py +0 -0
  178. /blaxel/{client → core/client}/api/default/get_template.py +0 -0
  179. /blaxel/{client → core/client}/api/default/list_mcp_hub_definitions.py +0 -0
  180. /blaxel/{client → core/client}/api/default/list_sandbox_hub_definitions.py +0 -0
  181. /blaxel/{client → core/client}/api/functions/__init__.py +0 -0
  182. /blaxel/{client → core/client}/api/functions/delete_function.py +0 -0
  183. /blaxel/{client → core/client}/api/functions/get_function.py +0 -0
  184. /blaxel/{client → core/client}/api/functions/list_function_revisions.py +0 -0
  185. /blaxel/{client → core/client}/api/functions/list_functions.py +0 -0
  186. /blaxel/{client → core/client}/api/integrations/__init__.py +0 -0
  187. /blaxel/{client → core/client}/api/integrations/delete_integration_connection.py +0 -0
  188. /blaxel/{client → core/client}/api/integrations/get_integration.py +0 -0
  189. /blaxel/{client → core/client}/api/integrations/get_integration_connection.py +0 -0
  190. /blaxel/{client → core/client}/api/integrations/get_integration_connection_model.py +0 -0
  191. /blaxel/{client → core/client}/api/integrations/get_integration_connection_model_endpoint_configurations.py +0 -0
  192. /blaxel/{client → core/client}/api/integrations/list_integration_connection_models.py +0 -0
  193. /blaxel/{client → core/client}/api/integrations/list_integration_connections.py +0 -0
  194. /blaxel/{client → core/client}/api/invitations/__init__.py +0 -0
  195. /blaxel/{client → core/client}/api/invitations/list_all_pending_invitations.py +0 -0
  196. /blaxel/{client → core/client}/api/jobs/__init__.py +0 -0
  197. /blaxel/{client → core/client}/api/jobs/delete_job.py +0 -0
  198. /blaxel/{client → core/client}/api/jobs/get_job.py +0 -0
  199. /blaxel/{client → core/client}/api/jobs/list_job_revisions.py +0 -0
  200. /blaxel/{client → core/client}/api/jobs/list_jobs.py +0 -0
  201. /blaxel/{client → core/client}/api/knowledgebases/__init__.py +0 -0
  202. /blaxel/{client → core/client}/api/knowledgebases/delete_knowledgebase.py +0 -0
  203. /blaxel/{client → core/client}/api/knowledgebases/get_knowledgebase.py +0 -0
  204. /blaxel/{client → core/client}/api/knowledgebases/list_knowledgebase_revisions.py +0 -0
  205. /blaxel/{client → core/client}/api/knowledgebases/list_knowledgebases.py +0 -0
  206. /blaxel/{client → core/client}/api/locations/__init__.py +0 -0
  207. /blaxel/{client → core/client}/api/locations/list_locations.py +0 -0
  208. /blaxel/{client → core/client}/api/models/__init__.py +0 -0
  209. /blaxel/{client → core/client}/api/models/delete_model.py +0 -0
  210. /blaxel/{client → core/client}/api/models/get_model.py +0 -0
  211. /blaxel/{client → core/client}/api/models/list_model_revisions.py +0 -0
  212. /blaxel/{client → core/client}/api/models/list_models.py +0 -0
  213. /blaxel/{client → core/client}/api/policies/__init__.py +0 -0
  214. /blaxel/{client → core/client}/api/policies/delete_policy.py +0 -0
  215. /blaxel/{client → core/client}/api/policies/get_policy.py +0 -0
  216. /blaxel/{client → core/client}/api/policies/list_policies.py +0 -0
  217. /blaxel/{client → core/client}/api/privateclusters/__init__.py +0 -0
  218. /blaxel/{client → core/client}/api/privateclusters/create_private_cluster.py +0 -0
  219. /blaxel/{client → core/client}/api/privateclusters/delete_private_cluster.py +0 -0
  220. /blaxel/{client → core/client}/api/privateclusters/get_private_cluster.py +0 -0
  221. /blaxel/{client → core/client}/api/privateclusters/get_private_cluster_health.py +0 -0
  222. /blaxel/{client → core/client}/api/privateclusters/list_private_clusters.py +0 -0
  223. /blaxel/{client → core/client}/api/privateclusters/update_private_cluster.py +0 -0
  224. /blaxel/{client → core/client}/api/privateclusters/update_private_cluster_health.py +0 -0
  225. /blaxel/{client → core/client}/api/service_accounts/__init__.py +0 -0
  226. /blaxel/{client → core/client}/api/service_accounts/delete_api_key_for_service_account.py +0 -0
  227. /blaxel/{client → core/client}/api/service_accounts/delete_workspace_service_account.py +0 -0
  228. /blaxel/{client → core/client}/api/service_accounts/get_workspace_service_accounts.py +0 -0
  229. /blaxel/{client → core/client}/api/service_accounts/list_api_keys_for_service_account.py +0 -0
  230. /blaxel/{client → core/client}/api/templates/__init__.py +0 -0
  231. /blaxel/{client → core/client}/api/templates/list_templates.py +0 -0
  232. /blaxel/{client → core/client}/api/workspaces/__init__.py +0 -0
  233. /blaxel/{client → core/client}/api/workspaces/accept_workspace_invitation.py +0 -0
  234. /blaxel/{client → core/client}/api/workspaces/decline_workspace_invitation.py +0 -0
  235. /blaxel/{client → core/client}/api/workspaces/delete_workspace.py +0 -0
  236. /blaxel/{client → core/client}/api/workspaces/get_workspace.py +0 -0
  237. /blaxel/{client → core/client}/api/workspaces/leave_workspace.py +0 -0
  238. /blaxel/{client → core/client}/api/workspaces/list_workspace_users.py +0 -0
  239. /blaxel/{client → core/client}/api/workspaces/list_workspaces.py +0 -0
  240. /blaxel/{client → core/client}/api/workspaces/remove_workspace_user.py +0 -0
  241. /blaxel/{client → core/client}/client.py +0 -0
  242. /blaxel/{client → core/client}/errors.py +0 -0
  243. /blaxel/{client → core/client}/models/acl.py +0 -0
  244. /blaxel/{client → core/client}/models/api_key.py +0 -0
  245. /blaxel/{client → core/client}/models/check_workspace_availability_body.py +0 -0
  246. /blaxel/{client → core/client}/models/configuration.py +0 -0
  247. /blaxel/{client → core/client}/models/continent.py +0 -0
  248. /blaxel/{client → core/client}/models/core_event.py +0 -0
  249. /blaxel/{client → core/client}/models/core_spec_configurations.py +0 -0
  250. /blaxel/{client → core/client}/models/country.py +0 -0
  251. /blaxel/{client → core/client}/models/create_api_key_for_service_account_body.py +0 -0
  252. /blaxel/{client → core/client}/models/create_workspace_service_account_body.py +0 -0
  253. /blaxel/{client → core/client}/models/create_workspace_service_account_response_200.py +0 -0
  254. /blaxel/{client → core/client}/models/delete_sandbox_preview_token_response_200.py +0 -0
  255. /blaxel/{client → core/client}/models/delete_workspace_service_account_response_200.py +0 -0
  256. /blaxel/{client → core/client}/models/entrypoint.py +0 -0
  257. /blaxel/{client → core/client}/models/entrypoint_env.py +0 -0
  258. /blaxel/{client → core/client}/models/flavor.py +0 -0
  259. /blaxel/{client → core/client}/models/form.py +0 -0
  260. /blaxel/{client → core/client}/models/form_config.py +0 -0
  261. /blaxel/{client → core/client}/models/form_oauth.py +0 -0
  262. /blaxel/{client → core/client}/models/form_secrets.py +0 -0
  263. /blaxel/{client → core/client}/models/function_kit.py +0 -0
  264. /blaxel/{client → core/client}/models/function_schema.py +0 -0
  265. /blaxel/{client → core/client}/models/function_schema_not.py +0 -0
  266. /blaxel/{client → core/client}/models/function_schema_or_bool.py +0 -0
  267. /blaxel/{client → core/client}/models/get_workspace_service_accounts_response_200_item.py +0 -0
  268. /blaxel/{client → core/client}/models/histogram_bucket.py +0 -0
  269. /blaxel/{client → core/client}/models/histogram_stats.py +0 -0
  270. /blaxel/{client → core/client}/models/integration_additional_infos.py +0 -0
  271. /blaxel/{client → core/client}/models/integration_connection.py +0 -0
  272. /blaxel/{client → core/client}/models/integration_connection_spec.py +0 -0
  273. /blaxel/{client → core/client}/models/integration_connection_spec_config.py +0 -0
  274. /blaxel/{client → core/client}/models/integration_connection_spec_secret.py +0 -0
  275. /blaxel/{client → core/client}/models/integration_endpoint.py +0 -0
  276. /blaxel/{client → core/client}/models/integration_endpoint_token.py +0 -0
  277. /blaxel/{client → core/client}/models/integration_headers.py +0 -0
  278. /blaxel/{client → core/client}/models/integration_model.py +0 -0
  279. /blaxel/{client → core/client}/models/integration_organization.py +0 -0
  280. /blaxel/{client → core/client}/models/integration_query_params.py +0 -0
  281. /blaxel/{client → core/client}/models/integration_repository.py +0 -0
  282. /blaxel/{client → core/client}/models/invite_workspace_user_body.py +0 -0
  283. /blaxel/{client → core/client}/models/job_execution_config.py +0 -0
  284. /blaxel/{client → core/client}/models/job_metrics.py +0 -0
  285. /blaxel/{client → core/client}/models/job_metrics_executions_chart.py +0 -0
  286. /blaxel/{client → core/client}/models/job_metrics_executions_total.py +0 -0
  287. /blaxel/{client → core/client}/models/job_metrics_tasks_chart.py +0 -0
  288. /blaxel/{client → core/client}/models/job_metrics_tasks_total.py +0 -0
  289. /blaxel/{client → core/client}/models/jobs_chart.py +0 -0
  290. /blaxel/{client → core/client}/models/jobs_executions.py +0 -0
  291. /blaxel/{client → core/client}/models/jobs_network_chart.py +0 -0
  292. /blaxel/{client → core/client}/models/jobs_success_failed_chart.py +0 -0
  293. /blaxel/{client → core/client}/models/jobs_tasks.py +0 -0
  294. /blaxel/{client → core/client}/models/jobs_total.py +0 -0
  295. /blaxel/{client → core/client}/models/knowledgebase_spec.py +0 -0
  296. /blaxel/{client → core/client}/models/knowledgebase_spec_options.py +0 -0
  297. /blaxel/{client → core/client}/models/last_n_requests_metric.py +0 -0
  298. /blaxel/{client → core/client}/models/latency_metric.py +0 -0
  299. /blaxel/{client → core/client}/models/mcp_definition.py +0 -0
  300. /blaxel/{client → core/client}/models/mcp_definition_entrypoint.py +0 -0
  301. /blaxel/{client → core/client}/models/mcp_definition_form.py +0 -0
  302. /blaxel/{client → core/client}/models/memory_allocation_metric.py +0 -0
  303. /blaxel/{client → core/client}/models/metadata_labels.py +0 -0
  304. /blaxel/{client → core/client}/models/metric.py +0 -0
  305. /blaxel/{client → core/client}/models/metrics.py +0 -0
  306. /blaxel/{client → core/client}/models/metrics_models.py +0 -0
  307. /blaxel/{client → core/client}/models/metrics_request_total_per_code.py +0 -0
  308. /blaxel/{client → core/client}/models/metrics_rps_per_code.py +0 -0
  309. /blaxel/{client → core/client}/models/model_private_cluster.py +0 -0
  310. /blaxel/{client → core/client}/models/o_auth.py +0 -0
  311. /blaxel/{client → core/client}/models/owner_fields.py +0 -0
  312. /blaxel/{client → core/client}/models/pending_invitation.py +0 -0
  313. /blaxel/{client → core/client}/models/pending_invitation_accept.py +0 -0
  314. /blaxel/{client → core/client}/models/pending_invitation_render.py +0 -0
  315. /blaxel/{client → core/client}/models/pending_invitation_render_invited_by.py +0 -0
  316. /blaxel/{client → core/client}/models/pending_invitation_render_workspace.py +0 -0
  317. /blaxel/{client → core/client}/models/pending_invitation_workspace_details.py +0 -0
  318. /blaxel/{client → core/client}/models/pod_template_spec.py +0 -0
  319. /blaxel/{client → core/client}/models/policy.py +0 -0
  320. /blaxel/{client → core/client}/models/policy_location.py +0 -0
  321. /blaxel/{client → core/client}/models/policy_max_tokens.py +0 -0
  322. /blaxel/{client → core/client}/models/port.py +0 -0
  323. /blaxel/{client → core/client}/models/preview.py +0 -0
  324. /blaxel/{client → core/client}/models/preview_metadata.py +0 -0
  325. /blaxel/{client → core/client}/models/preview_spec.py +0 -0
  326. /blaxel/{client → core/client}/models/preview_spec_request_headers.py +0 -0
  327. /blaxel/{client → core/client}/models/preview_spec_response_headers.py +0 -0
  328. /blaxel/{client → core/client}/models/preview_token.py +0 -0
  329. /blaxel/{client → core/client}/models/preview_token_metadata.py +0 -0
  330. /blaxel/{client → core/client}/models/preview_token_spec.py +0 -0
  331. /blaxel/{client → core/client}/models/private_cluster.py +0 -0
  332. /blaxel/{client → core/client}/models/private_location.py +0 -0
  333. /blaxel/{client → core/client}/models/repository.py +0 -0
  334. /blaxel/{client → core/client}/models/request_duration_over_time_metric.py +0 -0
  335. /blaxel/{client → core/client}/models/request_duration_over_time_metrics.py +0 -0
  336. /blaxel/{client → core/client}/models/request_total_by_origin_metric.py +0 -0
  337. /blaxel/{client → core/client}/models/request_total_by_origin_metric_request_total_by_origin.py +0 -0
  338. /blaxel/{client → core/client}/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -0
  339. /blaxel/{client → core/client}/models/request_total_metric.py +0 -0
  340. /blaxel/{client → core/client}/models/request_total_metric_request_total_per_code.py +0 -0
  341. /blaxel/{client → core/client}/models/request_total_metric_rps_per_code.py +0 -0
  342. /blaxel/{client → core/client}/models/request_total_response_data.py +0 -0
  343. /blaxel/{client → core/client}/models/resource_log.py +0 -0
  344. /blaxel/{client → core/client}/models/resource_metrics_request_total_per_code.py +0 -0
  345. /blaxel/{client → core/client}/models/resource_metrics_request_total_per_code_previous.py +0 -0
  346. /blaxel/{client → core/client}/models/resource_metrics_rps_per_code.py +0 -0
  347. /blaxel/{client → core/client}/models/resource_metrics_rps_per_code_previous.py +0 -0
  348. /blaxel/{client → core/client}/models/revision_configuration.py +0 -0
  349. /blaxel/{client → core/client}/models/revision_metadata.py +0 -0
  350. /blaxel/{client → core/client}/models/runtime_configuration.py +0 -0
  351. /blaxel/{client → core/client}/models/runtime_startup_probe.py +0 -0
  352. /blaxel/{client → core/client}/models/serverless_config.py +0 -0
  353. /blaxel/{client → core/client}/models/serverless_config_configuration.py +0 -0
  354. /blaxel/{client → core/client}/models/spec_configuration.py +0 -0
  355. /blaxel/{client → core/client}/models/start_sandbox.py +0 -0
  356. /blaxel/{client → core/client}/models/stop_sandbox.py +0 -0
  357. /blaxel/{client → core/client}/models/store_agent_labels.py +0 -0
  358. /blaxel/{client → core/client}/models/store_configuration_option.py +0 -0
  359. /blaxel/{client → core/client}/models/template_variable.py +0 -0
  360. /blaxel/{client → core/client}/models/time_fields.py +0 -0
  361. /blaxel/{client → core/client}/models/time_to_first_token_over_time_metrics.py +0 -0
  362. /blaxel/{client → core/client}/models/token_rate_metric.py +0 -0
  363. /blaxel/{client → core/client}/models/token_rate_metrics.py +0 -0
  364. /blaxel/{client → core/client}/models/token_total_metric.py +0 -0
  365. /blaxel/{client → core/client}/models/trace_ids_response.py +0 -0
  366. /blaxel/{client → core/client}/models/trigger.py +0 -0
  367. /blaxel/{client → core/client}/models/trigger_configuration.py +0 -0
  368. /blaxel/{client → core/client}/models/update_workspace_service_account_body.py +0 -0
  369. /blaxel/{client → core/client}/models/update_workspace_service_account_response_200.py +0 -0
  370. /blaxel/{client → core/client}/models/update_workspace_user_role_body.py +0 -0
  371. /blaxel/{client → core/client}/models/websocket_channel.py +0 -0
  372. /blaxel/{client → core/client}/models/workspace.py +0 -0
  373. /blaxel/{client → core/client}/models/workspace_labels.py +0 -0
  374. /blaxel/{client → core/client}/models/workspace_runtime.py +0 -0
  375. /blaxel/{client → core/client}/models/workspace_user.py +0 -0
  376. /blaxel/{client → core/client}/py.typed +0 -0
  377. /blaxel/{client → core/client}/types.py +0 -0
  378. /blaxel/{common → core/common}/env.py +0 -0
  379. /blaxel/{common → core/common}/settings.py +0 -0
  380. /blaxel/{sandbox/client/api/filesystem/__init__.py → core/py.typed} +0 -0
  381. /blaxel/{sandbox → core/sandbox}/client/__init__.py +0 -0
  382. /blaxel/{sandbox → core/sandbox}/client/api/__init__.py +0 -0
  383. /blaxel/{sandbox/client/api/network → core/sandbox/client/api/filesystem}/__init__.py +0 -0
  384. /blaxel/{sandbox → core/sandbox}/client/api/filesystem/delete_filesystem_path.py +0 -0
  385. /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_filesystem_path.py +0 -0
  386. /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_watch_filesystem_path.py +0 -0
  387. /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_ws_watch_filesystem_path.py +0 -0
  388. /blaxel/{sandbox/client/api/process → core/sandbox/client/api/network}/__init__.py +0 -0
  389. /blaxel/{sandbox → core/sandbox}/client/api/network/delete_network_process_pid_monitor.py +0 -0
  390. /blaxel/{sandbox → core/sandbox}/client/api/network/get_network_process_pid_ports.py +0 -0
  391. /blaxel/{sandbox → core/sandbox}/client/api/process/delete_process_identifier.py +0 -0
  392. /blaxel/{sandbox → core/sandbox}/client/api/process/get_process.py +0 -0
  393. /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier.py +0 -0
  394. /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier_logs.py +0 -0
  395. /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier_logs_stream.py +0 -0
  396. /blaxel/{sandbox → core/sandbox}/client/api/process/get_ws_process_identifier_logs_stream.py +0 -0
  397. /blaxel/{sandbox → core/sandbox}/client/client.py +0 -0
  398. /blaxel/{sandbox → core/sandbox}/client/errors.py +0 -0
  399. /blaxel/{sandbox → core/sandbox}/client/models/delete_network_process_pid_monitor_response_200.py +0 -0
  400. /blaxel/{sandbox → core/sandbox}/client/models/error_response.py +0 -0
  401. /blaxel/{sandbox → core/sandbox}/client/models/file.py +0 -0
  402. /blaxel/{sandbox → core/sandbox}/client/models/file_request.py +0 -0
  403. /blaxel/{sandbox → core/sandbox}/client/models/file_with_content.py +0 -0
  404. /blaxel/{sandbox → core/sandbox}/client/models/get_network_process_pid_ports_response_200.py +0 -0
  405. /blaxel/{sandbox → core/sandbox}/client/models/port_monitor_request.py +0 -0
  406. /blaxel/{sandbox → core/sandbox}/client/models/post_network_process_pid_monitor_response_200.py +0 -0
  407. /blaxel/{sandbox → core/sandbox}/client/models/process_logs.py +0 -0
  408. /blaxel/{sandbox → core/sandbox}/client/models/process_response.py +0 -0
  409. /blaxel/{sandbox → core/sandbox}/client/models/process_response_status.py +0 -0
  410. /blaxel/{sandbox → core/sandbox}/client/models/subdirectory.py +0 -0
  411. /blaxel/{sandbox → core/sandbox}/client/models/success_response.py +0 -0
  412. /blaxel/{sandbox → core/sandbox}/client/py.typed +0 -0
  413. /blaxel/{sandbox → core/sandbox}/client/types.py +0 -0
  414. /blaxel/{tools → core/tools}/common.py +0 -0
  415. /blaxel/{tools → core/tools}/types.py +0 -0
  416. /blaxel/{models/custom/langchain → langgraph/custom}/gemini.py +0 -0
  417. /blaxel/{models/custom/llamaindex → llamaindex/custom}/cohere.py +0 -0
  418. /blaxel/{instrumentation → telemetry}/exporters.py +0 -0
  419. /blaxel/{instrumentation → telemetry/log}/log.py +0 -0
  420. {blaxel-0.1.21rc69.dist-info → blaxel-0.2.0rc1.dist-info}/WHEEL +0 -0
  421. {blaxel-0.1.21rc69.dist-info → blaxel-0.2.0rc1.dist-info}/licenses/LICENSE +0 -0
blaxel/models/__init__.py DELETED
@@ -1,104 +0,0 @@
1
-
2
- from ..cache import find_from_cache
3
- from ..client import client
4
- from ..client.api.models import get_model
5
- from ..client.models import Model
6
- from ..common.settings import settings
7
-
8
-
9
- class BLModel:
10
- models = {}
11
-
12
- def __init__(self, model_name, **kwargs):
13
- self.model_name = model_name
14
- self.kwargs = kwargs
15
-
16
- async def to_langchain(self):
17
- from .langchain import get_langchain_model
18
- url, type, model = await self._get_parameters()
19
- model = await get_langchain_model(url, type, model, **self.kwargs)
20
- BLModel.models[f"langchain_{self.model_name}"] = model
21
- return model
22
-
23
- async def to_llamaindex(self):
24
- from .llamaindex import get_llamaindex_model
25
- url, type, model = await self._get_parameters()
26
- model = await get_llamaindex_model(url, type, model, **self.kwargs)
27
- BLModel.models[f"llamaindex_{self.model_name}"] = model
28
- return model
29
-
30
- async def to_crewai(self):
31
- from .crewai import get_crewai_model
32
-
33
- url, type, model = await self._get_parameters()
34
- model = await get_crewai_model(url, type, model, **self.kwargs)
35
- BLModel.models[f"crewai_{self.model_name}"] = model
36
- return model
37
-
38
- async def to_openai(self):
39
- from .openai import get_openai_model
40
- url, type, model = await self._get_parameters()
41
- model = await get_openai_model(url, type, model, **self.kwargs)
42
- BLModel.models[f"openai_{self.model_name}"] = model
43
- return model
44
-
45
- async def to_pydantic(self):
46
- from .pydantic import get_pydantic_model
47
- url, type, model = await self._get_parameters()
48
- model = await get_pydantic_model(url, type, model, **self.kwargs)
49
- BLModel.models[f"pydantic_{self.model_name}"] = model
50
- return model
51
-
52
- async def to_google_adk(self):
53
- from .googleadk import get_google_adk_model
54
- url, type, model = await self._get_parameters()
55
- model = await get_google_adk_model(url, type, model, **self.kwargs)
56
- BLModel.models[f"googleadk_{self.model_name}"] = model
57
- return model
58
-
59
- async def to_livekit(self):
60
- # This has to be here because livekit plugins must be registered on the main thread
61
- from .livekit import get_livekit_model
62
-
63
- url, type, model = await self._get_parameters()
64
- model = await get_livekit_model(url, type, model, **self.kwargs)
65
- BLModel.models[f"livekit_{self.model_name}"] = model
66
- return model
67
-
68
- async def _get_parameters(self) -> tuple[str, str, str]:
69
- if self.model_name in self.models:
70
- # We get the headers in case we need to refresh the token
71
- settings.auth.get_headers()
72
- model = self.models[self.model_name]
73
- return model["url"], model["type"], model["model"]
74
- url = f"{settings.run_url}/{settings.auth.workspace_name}/models/{self.model_name}"
75
- model_data = await self._get_model_metadata()
76
- if not model_data:
77
- raise Exception(f"Model {self.model_name} not found")
78
- runtime = (model_data.spec and model_data.spec.runtime)
79
- if not runtime:
80
- raise Exception(f"Model {self.model_name} has no runtime")
81
-
82
- type = runtime.type_ or 'openai'
83
- model = runtime.model
84
- self.models[self.model_name] = {
85
- "url": url,
86
- "type": type,
87
- "model": model
88
- }
89
- return url, type, model
90
-
91
- async def _get_model_metadata(self) -> Model | None:
92
- cache_data = await find_from_cache('Model', self.model_name)
93
- if cache_data:
94
- return Model.from_dict(cache_data)
95
-
96
- try:
97
- return await get_model.asyncio(client=client, model_name=self.model_name)
98
- except Exception:
99
- return None
100
-
101
- def bl_model(model_name, **kwargs):
102
- return BLModel(model_name, **kwargs)
103
-
104
- __all__ = ["bl_model"]
blaxel/sandbox/base.py DELETED
@@ -1,68 +0,0 @@
1
- import os
2
-
3
- from httpx import Response
4
-
5
- from ..client.models import Sandbox
6
- from ..common.internal import get_global_unique_hash, get_forced_url
7
- from ..common.settings import settings
8
- from .client.client import client
9
- from .client.models import ErrorResponse
10
-
11
-
12
- class ResponseError(Exception):
13
- def __init__(self, response: Response):
14
- self.status_code = response.status_code
15
- self.status_text = response.content
16
- self.error = None
17
- data_error = {
18
- "status": response.status_code,
19
- "statusText": response.content,
20
- }
21
- if hasattr(response, "parsed") and isinstance(response.parsed, ErrorResponse):
22
- data_error["error"] = response.parsed.error
23
- self.error = response.parsed.error
24
- super().__init__(str(data_error))
25
-
26
-
27
- class SandboxHandleBase:
28
- def __init__(self, sandbox: Sandbox):
29
- self.sandbox = sandbox
30
- self.client = client.with_base_url(self.url).with_headers(settings.headers)
31
-
32
- @property
33
- def name(self):
34
- return self.sandbox.metadata and self.sandbox.metadata.name
35
-
36
- @property
37
- def fallback_url(self):
38
- if self.external_url != self.url:
39
- return self.external_url
40
- return None
41
-
42
- @property
43
- def external_url(self):
44
- return f"{settings.run_url}/{settings.workspace}/sandboxes/{self.name}"
45
-
46
- @property
47
- def internal_url(self):
48
- hash_ = get_global_unique_hash(settings.workspace, "sandbox", self.name)
49
- return f"{settings.run_internal_protocol}://bl-{settings.env}-{hash_}.{settings.run_internal_hostname}"
50
-
51
- @property
52
- def forced_url(self):
53
- return get_forced_url("sandbox", self.name)
54
-
55
- @property
56
- def url(self):
57
- if self.forced_url:
58
- return self.forced_url
59
- # Uncomment and use this when agent and mcp are available in mk3
60
- # Update all requests made in this package to use fallbackUrl when internalUrl is not working
61
- # if settings.run_internal_hostname:
62
- # return self.internal_url
63
- return self.external_url
64
-
65
- def handle_response(self, response: Response):
66
- if response.status_code >= 400:
67
- raise ResponseError(response)
68
-
@@ -1,60 +0,0 @@
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="ProcessKillRequest")
9
-
10
-
11
- @_attrs_define
12
- class ProcessKillRequest:
13
- """
14
- Attributes:
15
- signal (Union[Unset, str]): Example: SIGTERM.
16
- """
17
-
18
- signal: Union[Unset, str] = UNSET
19
- additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
20
-
21
- def to_dict(self) -> dict[str, Any]:
22
- signal = self.signal
23
-
24
- field_dict: dict[str, Any] = {}
25
- field_dict.update(self.additional_properties)
26
- field_dict.update({})
27
- if signal is not UNSET:
28
- field_dict["signal"] = signal
29
-
30
- return field_dict
31
-
32
- @classmethod
33
- def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
34
- if not src_dict:
35
- return None
36
- d = src_dict.copy()
37
- signal = d.pop("signal", UNSET)
38
-
39
- process_kill_request = cls(
40
- signal=signal,
41
- )
42
-
43
- process_kill_request.additional_properties = d
44
- return process_kill_request
45
-
46
- @property
47
- def additional_keys(self) -> list[str]:
48
- return list(self.additional_properties.keys())
49
-
50
- def __getitem__(self, key: str) -> Any:
51
- return self.additional_properties[key]
52
-
53
- def __setitem__(self, key: str, value: Any) -> None:
54
- self.additional_properties[key] = value
55
-
56
- def __delitem__(self, key: str) -> None:
57
- del self.additional_properties[key]
58
-
59
- def __contains__(self, key: str) -> bool:
60
- return key in self.additional_properties
@@ -1,104 +0,0 @@
1
- import asyncio
2
- from typing import Dict
3
-
4
- from ..common.settings import settings
5
- from .base import SandboxHandleBase
6
- from .client.api.filesystem.delete_filesystem_path import (
7
- asyncio_detailed as delete_filesystem_by_path,
8
- )
9
- from .client.api.filesystem.get_filesystem_path import asyncio_detailed as get_filesystem_by_path
10
- from .client.api.filesystem.put_filesystem_path import asyncio_detailed as put_filesystem_by_path
11
- from .client.client import client
12
- from .client.models import Directory, FileRequest, SuccessResponse
13
-
14
-
15
- class SandboxFileSystem(SandboxHandleBase):
16
- def __init__(self, sandbox):
17
- super().__init__(sandbox)
18
- self.client = client.with_base_url(self.url).with_headers(settings.headers)
19
-
20
- async def mkdir(self, path: str, permissions: str = "0755") -> SuccessResponse:
21
- path = self.format_path(path)
22
- body = FileRequest(is_directory=True, permissions=permissions)
23
- response = await put_filesystem_by_path(path=path, client=self.client, body=body)
24
- self.handle_response(response)
25
- return response.parsed
26
-
27
- async def write(self, path: str, content: str) -> SuccessResponse:
28
- path = self.format_path(path)
29
- body = FileRequest(content=content)
30
- response = await put_filesystem_by_path(path=path, client=self.client, body=body)
31
- self.handle_response(response)
32
- return response.parsed
33
-
34
- async def read(self, path: str) -> str:
35
- path = self.format_path(path)
36
- response = await get_filesystem_by_path(path=path, client=self.client)
37
- self.handle_response(response)
38
- if "content" not in response.parsed.additional_properties:
39
- raise Exception('{"error": "File not found"}')
40
- return response.parsed.additional_properties["content"]
41
-
42
- async def rm(self, path: str, recursive: bool = False) -> SuccessResponse:
43
- path = self.format_path(path)
44
- response = await delete_filesystem_by_path(path=path, client=self.client, recursive=recursive)
45
- self.handle_response(response)
46
- return response.parsed
47
-
48
- async def ls(self, path: str) -> Directory:
49
- path = self.format_path(path)
50
- response = await get_filesystem_by_path(path=path, client=self.client)
51
- self.handle_response(response)
52
- if not hasattr(response.parsed, "files") and not hasattr(response.parsed, "subdirectories"):
53
- raise Exception('{"error": "Directory not found"}')
54
- return response.parsed
55
-
56
- async def cp(self, source: str, destination: str) -> Dict[str, str]:
57
- source = self.format_path(source)
58
- destination = self.format_path(destination)
59
- response = await get_filesystem_by_path(path=source, client=self.client)
60
- self.handle_response(response)
61
- data = response.parsed
62
- if "content" in data.additional_properties:
63
- await self.write(destination, data.additional_properties["content"])
64
- return {
65
- "message": "File copied successfully",
66
- "source": source,
67
- "destination": destination,
68
- }
69
- elif hasattr(data, "subdirectories") or hasattr(data, "files"):
70
- # Create destination directory
71
- await self.mkdir(destination)
72
- # Process subdirectories in batches of 5
73
- subdirectories = getattr(data, "subdirectories", []) or []
74
- for i in range(0, len(subdirectories), 5):
75
- batch = subdirectories[i:i+5]
76
- await asyncio.gather(*[
77
- self.cp(
78
- getattr(subdir, "path", f"{source}/{getattr(subdir, 'path', '')}"),
79
- f"{destination}/{getattr(subdir, 'path', '')}"
80
- ) for subdir in batch
81
- ])
82
- # Process files in batches of 10
83
- files = getattr(data, "files", []) or []
84
- for i in range(0, len(files), 10):
85
- batch = files[i:i+10]
86
- await asyncio.gather(*[
87
- self.write(
88
- f"{destination}/{getattr(file, 'path', '')}",
89
- await self.read(getattr(file, "path", f"{source}/{getattr(file, 'path', '')}"))
90
- ) for file in batch
91
- ])
92
- return {
93
- "message": "Directory copied successfully",
94
- "source": source,
95
- "destination": destination,
96
- }
97
- raise Exception("Unsupported file type")
98
-
99
- def format_path(self, path: str) -> str:
100
- if path == "/":
101
- return "%2F"
102
- if path.startswith("/"):
103
- path = path[1:]
104
- return path
blaxel/sandbox/process.py DELETED
@@ -1,56 +0,0 @@
1
- from blaxel.sandbox.client.models.process_request import ProcessRequest
2
-
3
- from .base import SandboxHandleBase
4
- from .client.api.process.delete_process_identifier import (
5
- asyncio_detailed as delete_process_by_identifier,
6
- )
7
- from .client.api.process.delete_process_identifier_kill import (
8
- asyncio_detailed as delete_process_by_identifier_kill,
9
- )
10
- from .client.api.process.get_process import asyncio_detailed as get_process
11
- from .client.api.process.get_process_identifier import asyncio_detailed as get_process_by_identifier
12
- from .client.api.process.get_process_identifier_logs import (
13
- asyncio_detailed as get_process_by_identifier_logs,
14
- )
15
- from .client.api.process.post_process import asyncio_detailed as post_process
16
- from .client.models import ProcessKillRequest, ProcessLogs, ProcessResponse, SuccessResponse
17
-
18
-
19
- class SandboxProcess(SandboxHandleBase):
20
- async def exec(self, process: ProcessRequest) -> ProcessResponse:
21
- response = await post_process(client=self.client, body=process)
22
- self.handle_response(response)
23
- return response.parsed
24
-
25
- async def get(self, identifier: str) -> ProcessResponse:
26
- response = await get_process_by_identifier(identifier=identifier, client=self.client)
27
- self.handle_response(response)
28
- return response.parsed
29
-
30
- async def list(self) -> list[ProcessResponse]:
31
- response = await get_process(client=self.client)
32
- self.handle_response(response)
33
- return response.parsed
34
-
35
- async def stop(self, identifier: str) -> SuccessResponse:
36
- response = await delete_process_by_identifier(identifier=identifier, client=self.client)
37
- self.handle_response(response)
38
- return response.parsed
39
-
40
- async def kill(self, identifier: str, signal: str = "SIGKILL") -> SuccessResponse:
41
- kill_request = ProcessKillRequest(signal=signal)
42
- response = await delete_process_by_identifier_kill(identifier=identifier, client=self.client, body=kill_request)
43
- self.handle_response(response)
44
- return response.parsed
45
-
46
- async def logs(self, identifier: str, type_: str = "stdout") -> str:
47
- response = await get_process_by_identifier_logs(identifier=identifier, client=self.client)
48
- self.handle_response(response)
49
- data: ProcessLogs = response.parsed
50
- if type_ == "all":
51
- return data.logs
52
- elif type_ == "stderr":
53
- return data.stderr
54
- elif type_ == "stdout":
55
- return data.stdout
56
- raise Exception("Unsupported log type")
blaxel/tools/crewai.py DELETED
@@ -1,22 +0,0 @@
1
- from crewai.tools import BaseTool
2
-
3
- from .common import create_model_from_json_schema
4
- from .types import Tool
5
-
6
-
7
- def get_crewai_tools(tools: list[Tool]) -> list[BaseTool]:
8
- class CrewAITool(BaseTool):
9
- _tool: Tool
10
-
11
- def __init__(self, tool: Tool):
12
- super().__init__(
13
- name=tool.name,
14
- description=tool.description,
15
- args_schema=create_model_from_json_schema(tool.input_schema),
16
- )
17
- self._tool = tool
18
-
19
- def _run(self, *args, **kwargs):
20
- return self._tool.sync_coroutine(**kwargs)
21
-
22
- return [CrewAITool(tool) for tool in tools]
blaxel/tools/googleadk.py DELETED
@@ -1,66 +0,0 @@
1
- import inspect
2
- from typing import Any, Optional, override
3
-
4
- from google.adk.tools import BaseTool, ToolContext
5
- from google.genai import types
6
-
7
- from .types import Tool
8
-
9
-
10
- def get_google_adk_tools(tools: list[Tool]) -> list[BaseTool]:
11
- class GoogleADKTool(BaseTool):
12
- _tool: Tool
13
-
14
- def __init__(self, tool: Tool):
15
- super().__init__(
16
- name=tool.name,
17
- description=tool.description,
18
- )
19
- self._tool = tool
20
-
21
- def _clean_schema(self, schema: dict) -> dict:
22
- if not isinstance(schema, dict):
23
- return schema
24
-
25
- # Create a copy of the schema
26
- cleaned_schema = schema.copy()
27
-
28
- # Remove $schema and additionalProperties at current level
29
- if "$schema" in cleaned_schema:
30
- del cleaned_schema["$schema"]
31
- if "additionalProperties" in cleaned_schema:
32
- del cleaned_schema["additionalProperties"]
33
-
34
- # Recursively clean properties if they exist
35
- if "properties" in cleaned_schema:
36
- cleaned_schema["properties"] = {
37
- k: self._clean_schema(v) for k, v in cleaned_schema["properties"].items()
38
- }
39
-
40
- return cleaned_schema
41
-
42
- @override
43
- def _get_declaration(self) -> Optional[types.FunctionDeclaration]:
44
- # Clean the schema recursively
45
- schema = self._clean_schema(self._tool.input_schema)
46
-
47
- function_decl = types.FunctionDeclaration.model_validate(
48
- types.FunctionDeclaration(
49
- name=self._tool.name,
50
- description=self._tool.description,
51
- parameters=schema,
52
- )
53
- )
54
-
55
- return function_decl
56
-
57
- @override
58
- async def run_async(
59
- self, *, args: dict[str, Any], tool_context: ToolContext
60
- ) -> Any:
61
- args_to_call = args.copy()
62
- signature = inspect.signature(self._tool.coroutine)
63
- if 'tool_context' in signature.parameters:
64
- args_to_call['tool_context'] = tool_context
65
- return await self._tool.coroutine(**args_to_call) or {}
66
- return [GoogleADKTool(tool) for tool in tools]
@@ -1,169 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: blaxel
3
- Version: 0.1.21rc69
4
- Summary: Add your description here
5
- Project-URL: Homepage, https://blaxel.ai
6
- Project-URL: Documentation, https://docs.blaxel.ai
7
- Project-URL: Repository, https://github.com/blaxel-ai/sdk-python
8
- Project-URL: Changelog, https://docs.blaxel.ai/changelog
9
- Author-email: cploujoux <cploujoux@blaxel.ai>
10
- License-File: LICENSE
11
- Requires-Python: >=3.10
12
- Requires-Dist: attrs>=21.3.0
13
- Requires-Dist: httpx>=0.27.0
14
- Requires-Dist: mcp<=1.7.1
15
- Requires-Dist: opentelemetry-api>=1.28.0
16
- Requires-Dist: opentelemetry-exporter-otlp>=1.28.0
17
- Requires-Dist: opentelemetry-instrumentation-anthropic==0.40.6
18
- Requires-Dist: opentelemetry-instrumentation-cohere==0.40.6
19
- Requires-Dist: opentelemetry-instrumentation-fastapi==0.54b1
20
- Requires-Dist: opentelemetry-instrumentation-ollama==0.40.6
21
- Requires-Dist: opentelemetry-instrumentation-openai==0.40.6
22
- Requires-Dist: opentelemetry-instrumentation-system-metrics
23
- Requires-Dist: opentelemetry-sdk>=1.28.0
24
- Requires-Dist: pydantic<2.11.0,>=2.10.3
25
- Requires-Dist: pyjwt>=2.10.1
26
- Requires-Dist: python-dateutil>=2.8.0
27
- Requires-Dist: pyyaml<6.1.0,>=6.0.2
28
- Requires-Dist: requests<2.33.0,>=2.32.3
29
- Requires-Dist: tomli>=2.2.1
30
- Requires-Dist: websockets<15.0.0
31
- Provides-Extra: crewai
32
- Requires-Dist: crewai>=0.120.1; extra == 'crewai'
33
- Requires-Dist: opentelemetry-instrumentation-crewai>=0.40.6; extra == 'crewai'
34
- Provides-Extra: google-adk
35
- Requires-Dist: google-adk>=1.1.1; extra == 'google-adk'
36
- Requires-Dist: litellm>=1.63.11; extra == 'google-adk'
37
- Provides-Extra: langchain
38
- Requires-Dist: langchain-anthropic>=0.3.10; extra == 'langchain'
39
- Requires-Dist: langchain-cerebras>=0.5.0; extra == 'langchain'
40
- Requires-Dist: langchain-cohere>=0.4.3; extra == 'langchain'
41
- Requires-Dist: langchain-community<0.4.0,>=0.3.3; extra == 'langchain'
42
- Requires-Dist: langchain-core<0.4.0,>=0.3.13; extra == 'langchain'
43
- Requires-Dist: langchain-deepseek-official>=0.1.0.post1; extra == 'langchain'
44
- Requires-Dist: langchain-openai>=0.3.10; extra == 'langchain'
45
- Requires-Dist: langchain-xai>=0.2.2; extra == 'langchain'
46
- Requires-Dist: langgraph<0.3.0,>=0.2.40; extra == 'langchain'
47
- Requires-Dist: opentelemetry-instrumentation-langchain>=0.35.0; extra == 'langchain'
48
- Requires-Dist: pillow>=10.0.0; extra == 'langchain'
49
- Provides-Extra: livekit
50
- Requires-Dist: livekit-agents[anthropic,cartesia,deepgram,elevenlabs,groq,openai,silero,turn-detector]~=1.0; extra == 'livekit'
51
- Requires-Dist: livekit-plugins-noise-cancellation~=0.2; extra == 'livekit'
52
- Provides-Extra: llamaindex
53
- Requires-Dist: llama-index-llms-anthropic>=0.6.10; extra == 'llamaindex'
54
- Requires-Dist: llama-index-llms-cerebras>=0.2.2; extra == 'llamaindex'
55
- Requires-Dist: llama-index-llms-cohere>=0.4.0; extra == 'llamaindex'
56
- Requires-Dist: llama-index-llms-deepseek>=0.1.1; extra == 'llamaindex'
57
- Requires-Dist: llama-index-llms-google-genai>=0.1.7; extra == 'llamaindex'
58
- Requires-Dist: llama-index-llms-groq>=0.3.1; extra == 'llamaindex'
59
- Requires-Dist: llama-index-llms-mistralai>=0.4.0; extra == 'llamaindex'
60
- Requires-Dist: llama-index-llms-openai>=0.3.28; extra == 'llamaindex'
61
- Requires-Dist: llama-index>=0.12.26; extra == 'llamaindex'
62
- Requires-Dist: opentelemetry-instrumentation-llamaindex>=0.35.0; extra == 'llamaindex'
63
- Provides-Extra: openai-agents
64
- Requires-Dist: openai-agents>=0.0.7; extra == 'openai-agents'
65
- Provides-Extra: pydantic-ai
66
- Requires-Dist: pydantic-ai>=0.0.48; extra == 'pydantic-ai'
67
- Description-Content-Type: text/markdown
68
-
69
- # Blaxel Python SDK
70
-
71
- <p align="center">
72
- <img src="https://blaxel.ai/logo-bg.png" alt="Blaxel"/>
73
- </p>
74
-
75
- **Blaxel is a computing platform for AI agent builders, with all the services and infrastructure to build and deploy agents efficiently.** This repository contains the Python SDK to create and manage resources on Blaxel.
76
-
77
- ## Table of Contents
78
-
79
- - [Installation](#installation)
80
- - [Authentication](#authentication)
81
- - [Features](#features)
82
- - [Quickstart](#quickstart)
83
- - [Contributing](#contributing)
84
- - [License](#license)
85
-
86
-
87
-
88
- ## Installation
89
-
90
- Install Blaxel SDK which lets you manage Blaxel resources.
91
-
92
- ```bash
93
- ## Using pip
94
- pip install blaxel
95
-
96
- ## Using uv
97
- uv pip install blaxel
98
-
99
- ## Using uv add
100
- uv add blaxel
101
- ```
102
-
103
-
104
-
105
- ### Authentication
106
-
107
- The Blaxel SDK authenticates with your workspace using credentials from these sources, in priority order:
108
- 1. When running on Blaxel, authentication is handled automatically
109
- 2. Variables in your .env file (`BL_WORKSPACE` and `BL_API_KEY`, or see [this page](https://docs.blaxel.ai/Agents/Variables-and-secrets) for other authentication options).
110
- 3. Environment variables from your machine
111
- 4. Configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
112
-
113
- When developing locally, the recommended method is to just log in to your workspace with Blaxel CLI. This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, this connection persists automatically.
114
-
115
- When running Blaxel SDK from a remote server that is not Blaxel-hosted, we recommend using environment variables as described in the third option above.
116
-
117
-
118
-
119
- ## Features
120
- - Agents & MCP servers
121
- - [Create MCP servers](https://docs.blaxel.ai/Functions/Create-MCP-server)
122
- - [Connect to MCP servers and model APIs hosted on Blaxel](https://docs.blaxel.ai/Agents/Develop-an-agent-ts)
123
- - [Call agents from another agent](https://docs.blaxel.ai/Agents/Develop-an-agent-ts#connect-to-another-agent-multi-agent-chaining)
124
- - [Deploy on Blaxel](https://docs.blaxel.ai/Agents/Deploy-an-agent)
125
- - Sandboxes
126
- - [Create and update sandboxes and sandbox previews](https://docs.blaxel.ai/Sandboxes/Overview)
127
- - [Run filesystem operations and processes on a sandbox](https://docs.blaxel.ai/Sandboxes/Processes)
128
- - [Use environment variables or secrets](https://docs.blaxel.ai/Agents/Variables-and-secrets)
129
-
130
-
131
-
132
- ## Quickstart
133
-
134
- Blaxel CLI gives you a quick way to create new applications: agents, MCP servers, jobs, etc - and deploy them to Blaxel.
135
-
136
- **Prerequisites**:
137
- - **Node.js:** v18 or later.
138
- - **Blaxel CLI:** Make sure you have Blaxel CLI installed. If not, [install it](https://docs.blaxel.ai/cli-reference/introduction):
139
- ```bash
140
- curl -fsSL \
141
- https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh \
142
- | BINDIR=/usr/local/bin sudo -E sh
143
- ```
144
- - **Blaxel login:** Login to Blaxel:
145
- ```bash
146
- bl login YOUR-WORKSPACE
147
- ```
148
-
149
- ```bash
150
- bl create-agent-app myfolder
151
- cd myfolder
152
- bl deploy
153
- ```
154
-
155
- Also available:
156
- - `bl create-mcp-server`
157
- - `bl create-job`
158
-
159
-
160
-
161
- ## Contributing
162
-
163
- Contributions are welcome! Please feel free to submit a Pull Request.
164
-
165
-
166
-
167
- ## License
168
-
169
- This project is licensed under the MIT License - see the LICENSE file for details.