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.
- blaxel/__init__.py +6 -3
- blaxel/core/__init__.py +44 -0
- blaxel/core/agents/__init__.py +115 -0
- blaxel/{authentication → core/authentication}/apikey.py +1 -0
- blaxel/{authentication → core/authentication}/clientcredentials.py +6 -2
- blaxel/{client → core/client}/api/agents/create_agent.py +1 -1
- blaxel/{client → core/client}/api/agents/update_agent.py +1 -1
- blaxel/{client → core/client}/api/compute/create_sandbox.py +1 -1
- blaxel/{client → core/client}/api/compute/create_sandbox_preview.py +1 -1
- blaxel/{client → core/client}/api/compute/create_sandbox_preview_token.py +1 -1
- blaxel/{client → core/client}/api/compute/update_sandbox.py +1 -1
- blaxel/{client → core/client}/api/compute/update_sandbox_preview.py +1 -1
- blaxel/{client → core/client}/api/functions/create_function.py +1 -1
- blaxel/{client → core/client}/api/functions/update_function.py +1 -1
- blaxel/{client → core/client}/api/integrations/create_integration_connection.py +1 -1
- blaxel/{client → core/client}/api/integrations/update_integration_connection.py +1 -1
- blaxel/{client → core/client}/api/jobs/create_job.py +1 -1
- blaxel/{client → core/client}/api/jobs/update_job.py +1 -1
- blaxel/{client → core/client}/api/knowledgebases/create_knowledgebase.py +1 -1
- blaxel/{client → core/client}/api/knowledgebases/update_knowledgebase.py +1 -1
- blaxel/{client → core/client}/api/models/create_model.py +1 -1
- blaxel/{client → core/client}/api/models/update_model.py +1 -1
- blaxel/{client → core/client}/api/policies/create_policy.py +1 -1
- blaxel/{client → core/client}/api/policies/update_policy.py +1 -1
- blaxel/{client → core/client}/api/service_accounts/create_api_key_for_service_account.py +1 -1
- blaxel/{client → core/client}/api/service_accounts/create_workspace_service_account.py +1 -1
- blaxel/{client → core/client}/api/service_accounts/update_workspace_service_account.py +1 -1
- blaxel/{client → core/client}/api/workspaces/check_workspace_availability.py +1 -1
- blaxel/{client → core/client}/api/workspaces/create_worspace.py +1 -1
- blaxel/{client → core/client}/api/workspaces/invite_workspace_user.py +1 -1
- blaxel/{client → core/client}/api/workspaces/update_workspace.py +1 -1
- blaxel/{client → core/client}/api/workspaces/update_workspace_user_role.py +1 -1
- blaxel/{client → core/client}/models/__init__.py +18 -0
- blaxel/{client → core/client}/models/agent.py +1 -1
- blaxel/{client → core/client}/models/agent_spec.py +2 -2
- blaxel/core/client/models/billable_time_metric.py +70 -0
- blaxel/{client → core/client}/models/core_spec.py +1 -1
- blaxel/{client → core/client}/models/function.py +1 -1
- blaxel/{client → core/client}/models/function_schema_properties.py +1 -1
- blaxel/{client → core/client}/models/function_spec.py +2 -2
- blaxel/{client → core/client}/models/integration.py +2 -2
- blaxel/{client → core/client}/models/integration_endpoints.py +1 -1
- blaxel/{client → core/client}/models/job.py +1 -1
- blaxel/{client → core/client}/models/job_spec.py +1 -1
- blaxel/{client → core/client}/models/jobs_chart_value.py +2 -2
- blaxel/{client → core/client}/models/knowledgebase.py +1 -1
- blaxel/{client → core/client}/models/location_response.py +1 -1
- blaxel/core/client/models/logs_response.py +63 -0
- blaxel/core/client/models/logs_response_data.py +99 -0
- blaxel/core/client/models/memory_allocation_by_name.py +70 -0
- blaxel/{client → core/client}/models/metadata.py +9 -0
- blaxel/{client → core/client}/models/model.py +1 -1
- blaxel/{client → core/client}/models/model_spec.py +1 -1
- blaxel/{client → core/client}/models/policy_spec.py +2 -2
- blaxel/core/client/models/resource.py +79 -0
- blaxel/core/client/models/resource_log_chart.py +133 -0
- blaxel/core/client/models/resource_log_response.py +83 -0
- blaxel/{client → core/client}/models/resource_metrics.py +27 -3
- blaxel/core/client/models/resource_trace.py +97 -0
- blaxel/{client → core/client}/models/runtime.py +1 -1
- blaxel/{client → core/client}/models/sandbox.py +1 -1
- blaxel/{client → core/client}/models/sandbox_definition.py +1 -1
- blaxel/{client → core/client}/models/sandbox_spec.py +1 -1
- blaxel/{client → core/client}/models/store_agent.py +1 -1
- blaxel/{client → core/client}/models/store_configuration.py +1 -1
- blaxel/{client → core/client}/models/template.py +1 -1
- blaxel/core/client/models/websocket_message.py +106 -0
- blaxel/core/common/__init__.py +6 -0
- blaxel/core/common/autoload.py +21 -0
- blaxel/{common → core/common}/internal.py +34 -62
- blaxel/core/common/logger.py +131 -0
- blaxel/{jobs → core/jobs}/__init__.py +41 -61
- blaxel/core/mcp/__init__.py +4 -0
- blaxel/{mcp → core/mcp}/client.py +13 -7
- blaxel/{mcp → core/mcp}/server.py +76 -17
- blaxel/core/models/__init__.py +52 -0
- blaxel/core/sandbox/__init__.py +29 -0
- blaxel/core/sandbox/action.py +79 -0
- blaxel/{sandbox → core/sandbox}/client/api/filesystem/put_filesystem_path.py +1 -1
- blaxel/{sandbox → core/sandbox}/client/api/network/post_network_process_pid_monitor.py +1 -1
- blaxel/core/sandbox/client/api/process/__init__.py +0 -0
- blaxel/{sandbox → core/sandbox}/client/api/process/delete_process_identifier_kill.py +0 -26
- blaxel/{sandbox → core/sandbox}/client/api/process/post_process.py +1 -1
- blaxel/{sandbox → core/sandbox}/client/models/__init__.py +2 -2
- blaxel/{sandbox → core/sandbox}/client/models/directory.py +2 -2
- blaxel/{sandbox → core/sandbox}/client/models/process_request.py +25 -1
- blaxel/core/sandbox/client/models/process_request_env.py +49 -0
- blaxel/core/sandbox/filesystem.py +280 -0
- blaxel/core/sandbox/network.py +10 -0
- blaxel/{sandbox → core/sandbox}/preview.py +45 -17
- blaxel/core/sandbox/process.py +159 -0
- blaxel/{sandbox → core/sandbox}/sandbox.py +62 -5
- blaxel/core/sandbox/session.py +124 -0
- blaxel/core/sandbox/types.py +103 -0
- blaxel/{tools → core/tools}/__init__.py +63 -91
- blaxel/crewai/__init__.py +4 -0
- blaxel/{models/crewai.py → crewai/model.py} +4 -2
- blaxel/crewai/py.typed +0 -0
- blaxel/crewai/tools.py +26 -0
- blaxel/googleadk/__init__.py +4 -0
- blaxel/{models/googleadk.py → googleadk/model.py} +8 -2
- blaxel/googleadk/py.typed +0 -0
- blaxel/googleadk/tools.py +72 -0
- blaxel/langgraph/__init__.py +4 -0
- blaxel/{models/langchain.py → langgraph/model.py} +8 -4
- blaxel/langgraph/py.typed +0 -0
- blaxel/{tools/langchain.py → langgraph/tools.py} +7 -3
- blaxel/livekit/__init__.py +4 -0
- blaxel/{models/livekit.py → livekit/model.py} +7 -1
- blaxel/livekit/py.typed +0 -0
- blaxel/{tools/livekit.py → livekit/tools.py} +8 -1
- blaxel/llamaindex/__init__.py +4 -0
- blaxel/{models/llamaindex.py → llamaindex/model.py} +6 -3
- blaxel/llamaindex/py.typed +0 -0
- blaxel/{tools/llamaindex.py → llamaindex/tools.py} +7 -4
- blaxel/openai/__init__.py +4 -0
- blaxel/{models/openai.py → openai/model.py} +4 -2
- blaxel/openai/py.typed +0 -0
- blaxel/{tools/openai.py → openai/tools.py} +7 -3
- blaxel/pydantic/__init__.py +4 -0
- blaxel/{models/custom/pydantic → pydantic/custom}/gemini.py +0 -1
- blaxel/{models/pydantic.py → pydantic/model.py} +6 -4
- blaxel/pydantic/py.typed +0 -0
- blaxel/{tools/pydantic.py → pydantic/tools.py} +6 -3
- blaxel/telemetry/__init__.py +6 -0
- blaxel/telemetry/instrumentation/blaxel_core.py +124 -0
- blaxel/telemetry/instrumentation/blaxel_langgraph.py +74 -0
- blaxel/telemetry/instrumentation/blaxel_langgraph_gemini.py +360 -0
- blaxel/telemetry/instrumentation/blaxel_llamaindex.py +89 -0
- blaxel/telemetry/instrumentation/map.py +61 -0
- blaxel/telemetry/instrumentation/utils.py +74 -0
- blaxel/{common → telemetry/log}/logger.py +6 -12
- blaxel/{instrumentation → telemetry}/manager.py +20 -12
- blaxel/telemetry/py.typed +0 -0
- blaxel/{instrumentation → telemetry}/span.py +12 -1
- blaxel-0.2.0rc1.dist-info/METADATA +224 -0
- blaxel-0.2.0rc1.dist-info/RECORD +408 -0
- blaxel/agents/__init__.py +0 -135
- blaxel/common/autoload.py +0 -9
- blaxel/instrumentation/map.py +0 -49
- blaxel/mcp/__init__.py +0 -3
- blaxel/models/__init__.py +0 -104
- blaxel/sandbox/base.py +0 -68
- blaxel/sandbox/client/models/process_kill_request.py +0 -60
- blaxel/sandbox/filesystem.py +0 -104
- blaxel/sandbox/process.py +0 -56
- blaxel/tools/crewai.py +0 -22
- blaxel/tools/googleadk.py +0 -66
- blaxel-0.1.21rc69.dist-info/METADATA +0 -169
- blaxel-0.1.21rc69.dist-info/RECORD +0 -370
- /blaxel/{authentication → core/authentication}/__init__.py +0 -0
- /blaxel/{authentication → core/authentication}/devicemode.py +0 -0
- /blaxel/{authentication → core/authentication}/oauth.py +0 -0
- /blaxel/{authentication → core/authentication}/types.py +0 -0
- /blaxel/{cache → core/cache}/__init__.py +0 -0
- /blaxel/{cache → core/cache}/cache.py +0 -0
- /blaxel/{client → core/client}/__init__.py +0 -0
- /blaxel/{client → core/client}/api/__init__.py +0 -0
- /blaxel/{client → core/client}/api/agents/__init__.py +0 -0
- /blaxel/{client → core/client}/api/agents/delete_agent.py +0 -0
- /blaxel/{client → core/client}/api/agents/get_agent.py +0 -0
- /blaxel/{client → core/client}/api/agents/list_agent_revisions.py +0 -0
- /blaxel/{client → core/client}/api/agents/list_agents.py +0 -0
- /blaxel/{client → core/client}/api/compute/__init__.py +0 -0
- /blaxel/{client → core/client}/api/compute/delete_sandbox.py +0 -0
- /blaxel/{client → core/client}/api/compute/delete_sandbox_preview.py +0 -0
- /blaxel/{client → core/client}/api/compute/delete_sandbox_preview_token.py +0 -0
- /blaxel/{client → core/client}/api/compute/get_sandbox.py +0 -0
- /blaxel/{client → core/client}/api/compute/get_sandbox_preview.py +0 -0
- /blaxel/{client → core/client}/api/compute/list_sandbox_preview_tokens.py +0 -0
- /blaxel/{client → core/client}/api/compute/list_sandbox_previews.py +0 -0
- /blaxel/{client → core/client}/api/compute/list_sandboxes.py +0 -0
- /blaxel/{client → core/client}/api/compute/start_sandbox.py +0 -0
- /blaxel/{client → core/client}/api/compute/stop_sandbox.py +0 -0
- /blaxel/{client → core/client}/api/configurations/__init__.py +0 -0
- /blaxel/{client → core/client}/api/configurations/get_configuration.py +0 -0
- /blaxel/{client → core/client}/api/default/__init__.py +0 -0
- /blaxel/{client → core/client}/api/default/get_template.py +0 -0
- /blaxel/{client → core/client}/api/default/list_mcp_hub_definitions.py +0 -0
- /blaxel/{client → core/client}/api/default/list_sandbox_hub_definitions.py +0 -0
- /blaxel/{client → core/client}/api/functions/__init__.py +0 -0
- /blaxel/{client → core/client}/api/functions/delete_function.py +0 -0
- /blaxel/{client → core/client}/api/functions/get_function.py +0 -0
- /blaxel/{client → core/client}/api/functions/list_function_revisions.py +0 -0
- /blaxel/{client → core/client}/api/functions/list_functions.py +0 -0
- /blaxel/{client → core/client}/api/integrations/__init__.py +0 -0
- /blaxel/{client → core/client}/api/integrations/delete_integration_connection.py +0 -0
- /blaxel/{client → core/client}/api/integrations/get_integration.py +0 -0
- /blaxel/{client → core/client}/api/integrations/get_integration_connection.py +0 -0
- /blaxel/{client → core/client}/api/integrations/get_integration_connection_model.py +0 -0
- /blaxel/{client → core/client}/api/integrations/get_integration_connection_model_endpoint_configurations.py +0 -0
- /blaxel/{client → core/client}/api/integrations/list_integration_connection_models.py +0 -0
- /blaxel/{client → core/client}/api/integrations/list_integration_connections.py +0 -0
- /blaxel/{client → core/client}/api/invitations/__init__.py +0 -0
- /blaxel/{client → core/client}/api/invitations/list_all_pending_invitations.py +0 -0
- /blaxel/{client → core/client}/api/jobs/__init__.py +0 -0
- /blaxel/{client → core/client}/api/jobs/delete_job.py +0 -0
- /blaxel/{client → core/client}/api/jobs/get_job.py +0 -0
- /blaxel/{client → core/client}/api/jobs/list_job_revisions.py +0 -0
- /blaxel/{client → core/client}/api/jobs/list_jobs.py +0 -0
- /blaxel/{client → core/client}/api/knowledgebases/__init__.py +0 -0
- /blaxel/{client → core/client}/api/knowledgebases/delete_knowledgebase.py +0 -0
- /blaxel/{client → core/client}/api/knowledgebases/get_knowledgebase.py +0 -0
- /blaxel/{client → core/client}/api/knowledgebases/list_knowledgebase_revisions.py +0 -0
- /blaxel/{client → core/client}/api/knowledgebases/list_knowledgebases.py +0 -0
- /blaxel/{client → core/client}/api/locations/__init__.py +0 -0
- /blaxel/{client → core/client}/api/locations/list_locations.py +0 -0
- /blaxel/{client → core/client}/api/models/__init__.py +0 -0
- /blaxel/{client → core/client}/api/models/delete_model.py +0 -0
- /blaxel/{client → core/client}/api/models/get_model.py +0 -0
- /blaxel/{client → core/client}/api/models/list_model_revisions.py +0 -0
- /blaxel/{client → core/client}/api/models/list_models.py +0 -0
- /blaxel/{client → core/client}/api/policies/__init__.py +0 -0
- /blaxel/{client → core/client}/api/policies/delete_policy.py +0 -0
- /blaxel/{client → core/client}/api/policies/get_policy.py +0 -0
- /blaxel/{client → core/client}/api/policies/list_policies.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/__init__.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/create_private_cluster.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/delete_private_cluster.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/get_private_cluster.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/get_private_cluster_health.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/list_private_clusters.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/update_private_cluster.py +0 -0
- /blaxel/{client → core/client}/api/privateclusters/update_private_cluster_health.py +0 -0
- /blaxel/{client → core/client}/api/service_accounts/__init__.py +0 -0
- /blaxel/{client → core/client}/api/service_accounts/delete_api_key_for_service_account.py +0 -0
- /blaxel/{client → core/client}/api/service_accounts/delete_workspace_service_account.py +0 -0
- /blaxel/{client → core/client}/api/service_accounts/get_workspace_service_accounts.py +0 -0
- /blaxel/{client → core/client}/api/service_accounts/list_api_keys_for_service_account.py +0 -0
- /blaxel/{client → core/client}/api/templates/__init__.py +0 -0
- /blaxel/{client → core/client}/api/templates/list_templates.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/__init__.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/accept_workspace_invitation.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/decline_workspace_invitation.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/delete_workspace.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/get_workspace.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/leave_workspace.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/list_workspace_users.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/list_workspaces.py +0 -0
- /blaxel/{client → core/client}/api/workspaces/remove_workspace_user.py +0 -0
- /blaxel/{client → core/client}/client.py +0 -0
- /blaxel/{client → core/client}/errors.py +0 -0
- /blaxel/{client → core/client}/models/acl.py +0 -0
- /blaxel/{client → core/client}/models/api_key.py +0 -0
- /blaxel/{client → core/client}/models/check_workspace_availability_body.py +0 -0
- /blaxel/{client → core/client}/models/configuration.py +0 -0
- /blaxel/{client → core/client}/models/continent.py +0 -0
- /blaxel/{client → core/client}/models/core_event.py +0 -0
- /blaxel/{client → core/client}/models/core_spec_configurations.py +0 -0
- /blaxel/{client → core/client}/models/country.py +0 -0
- /blaxel/{client → core/client}/models/create_api_key_for_service_account_body.py +0 -0
- /blaxel/{client → core/client}/models/create_workspace_service_account_body.py +0 -0
- /blaxel/{client → core/client}/models/create_workspace_service_account_response_200.py +0 -0
- /blaxel/{client → core/client}/models/delete_sandbox_preview_token_response_200.py +0 -0
- /blaxel/{client → core/client}/models/delete_workspace_service_account_response_200.py +0 -0
- /blaxel/{client → core/client}/models/entrypoint.py +0 -0
- /blaxel/{client → core/client}/models/entrypoint_env.py +0 -0
- /blaxel/{client → core/client}/models/flavor.py +0 -0
- /blaxel/{client → core/client}/models/form.py +0 -0
- /blaxel/{client → core/client}/models/form_config.py +0 -0
- /blaxel/{client → core/client}/models/form_oauth.py +0 -0
- /blaxel/{client → core/client}/models/form_secrets.py +0 -0
- /blaxel/{client → core/client}/models/function_kit.py +0 -0
- /blaxel/{client → core/client}/models/function_schema.py +0 -0
- /blaxel/{client → core/client}/models/function_schema_not.py +0 -0
- /blaxel/{client → core/client}/models/function_schema_or_bool.py +0 -0
- /blaxel/{client → core/client}/models/get_workspace_service_accounts_response_200_item.py +0 -0
- /blaxel/{client → core/client}/models/histogram_bucket.py +0 -0
- /blaxel/{client → core/client}/models/histogram_stats.py +0 -0
- /blaxel/{client → core/client}/models/integration_additional_infos.py +0 -0
- /blaxel/{client → core/client}/models/integration_connection.py +0 -0
- /blaxel/{client → core/client}/models/integration_connection_spec.py +0 -0
- /blaxel/{client → core/client}/models/integration_connection_spec_config.py +0 -0
- /blaxel/{client → core/client}/models/integration_connection_spec_secret.py +0 -0
- /blaxel/{client → core/client}/models/integration_endpoint.py +0 -0
- /blaxel/{client → core/client}/models/integration_endpoint_token.py +0 -0
- /blaxel/{client → core/client}/models/integration_headers.py +0 -0
- /blaxel/{client → core/client}/models/integration_model.py +0 -0
- /blaxel/{client → core/client}/models/integration_organization.py +0 -0
- /blaxel/{client → core/client}/models/integration_query_params.py +0 -0
- /blaxel/{client → core/client}/models/integration_repository.py +0 -0
- /blaxel/{client → core/client}/models/invite_workspace_user_body.py +0 -0
- /blaxel/{client → core/client}/models/job_execution_config.py +0 -0
- /blaxel/{client → core/client}/models/job_metrics.py +0 -0
- /blaxel/{client → core/client}/models/job_metrics_executions_chart.py +0 -0
- /blaxel/{client → core/client}/models/job_metrics_executions_total.py +0 -0
- /blaxel/{client → core/client}/models/job_metrics_tasks_chart.py +0 -0
- /blaxel/{client → core/client}/models/job_metrics_tasks_total.py +0 -0
- /blaxel/{client → core/client}/models/jobs_chart.py +0 -0
- /blaxel/{client → core/client}/models/jobs_executions.py +0 -0
- /blaxel/{client → core/client}/models/jobs_network_chart.py +0 -0
- /blaxel/{client → core/client}/models/jobs_success_failed_chart.py +0 -0
- /blaxel/{client → core/client}/models/jobs_tasks.py +0 -0
- /blaxel/{client → core/client}/models/jobs_total.py +0 -0
- /blaxel/{client → core/client}/models/knowledgebase_spec.py +0 -0
- /blaxel/{client → core/client}/models/knowledgebase_spec_options.py +0 -0
- /blaxel/{client → core/client}/models/last_n_requests_metric.py +0 -0
- /blaxel/{client → core/client}/models/latency_metric.py +0 -0
- /blaxel/{client → core/client}/models/mcp_definition.py +0 -0
- /blaxel/{client → core/client}/models/mcp_definition_entrypoint.py +0 -0
- /blaxel/{client → core/client}/models/mcp_definition_form.py +0 -0
- /blaxel/{client → core/client}/models/memory_allocation_metric.py +0 -0
- /blaxel/{client → core/client}/models/metadata_labels.py +0 -0
- /blaxel/{client → core/client}/models/metric.py +0 -0
- /blaxel/{client → core/client}/models/metrics.py +0 -0
- /blaxel/{client → core/client}/models/metrics_models.py +0 -0
- /blaxel/{client → core/client}/models/metrics_request_total_per_code.py +0 -0
- /blaxel/{client → core/client}/models/metrics_rps_per_code.py +0 -0
- /blaxel/{client → core/client}/models/model_private_cluster.py +0 -0
- /blaxel/{client → core/client}/models/o_auth.py +0 -0
- /blaxel/{client → core/client}/models/owner_fields.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation_accept.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation_render.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation_render_invited_by.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation_render_workspace.py +0 -0
- /blaxel/{client → core/client}/models/pending_invitation_workspace_details.py +0 -0
- /blaxel/{client → core/client}/models/pod_template_spec.py +0 -0
- /blaxel/{client → core/client}/models/policy.py +0 -0
- /blaxel/{client → core/client}/models/policy_location.py +0 -0
- /blaxel/{client → core/client}/models/policy_max_tokens.py +0 -0
- /blaxel/{client → core/client}/models/port.py +0 -0
- /blaxel/{client → core/client}/models/preview.py +0 -0
- /blaxel/{client → core/client}/models/preview_metadata.py +0 -0
- /blaxel/{client → core/client}/models/preview_spec.py +0 -0
- /blaxel/{client → core/client}/models/preview_spec_request_headers.py +0 -0
- /blaxel/{client → core/client}/models/preview_spec_response_headers.py +0 -0
- /blaxel/{client → core/client}/models/preview_token.py +0 -0
- /blaxel/{client → core/client}/models/preview_token_metadata.py +0 -0
- /blaxel/{client → core/client}/models/preview_token_spec.py +0 -0
- /blaxel/{client → core/client}/models/private_cluster.py +0 -0
- /blaxel/{client → core/client}/models/private_location.py +0 -0
- /blaxel/{client → core/client}/models/repository.py +0 -0
- /blaxel/{client → core/client}/models/request_duration_over_time_metric.py +0 -0
- /blaxel/{client → core/client}/models/request_duration_over_time_metrics.py +0 -0
- /blaxel/{client → core/client}/models/request_total_by_origin_metric.py +0 -0
- /blaxel/{client → core/client}/models/request_total_by_origin_metric_request_total_by_origin.py +0 -0
- /blaxel/{client → core/client}/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +0 -0
- /blaxel/{client → core/client}/models/request_total_metric.py +0 -0
- /blaxel/{client → core/client}/models/request_total_metric_request_total_per_code.py +0 -0
- /blaxel/{client → core/client}/models/request_total_metric_rps_per_code.py +0 -0
- /blaxel/{client → core/client}/models/request_total_response_data.py +0 -0
- /blaxel/{client → core/client}/models/resource_log.py +0 -0
- /blaxel/{client → core/client}/models/resource_metrics_request_total_per_code.py +0 -0
- /blaxel/{client → core/client}/models/resource_metrics_request_total_per_code_previous.py +0 -0
- /blaxel/{client → core/client}/models/resource_metrics_rps_per_code.py +0 -0
- /blaxel/{client → core/client}/models/resource_metrics_rps_per_code_previous.py +0 -0
- /blaxel/{client → core/client}/models/revision_configuration.py +0 -0
- /blaxel/{client → core/client}/models/revision_metadata.py +0 -0
- /blaxel/{client → core/client}/models/runtime_configuration.py +0 -0
- /blaxel/{client → core/client}/models/runtime_startup_probe.py +0 -0
- /blaxel/{client → core/client}/models/serverless_config.py +0 -0
- /blaxel/{client → core/client}/models/serverless_config_configuration.py +0 -0
- /blaxel/{client → core/client}/models/spec_configuration.py +0 -0
- /blaxel/{client → core/client}/models/start_sandbox.py +0 -0
- /blaxel/{client → core/client}/models/stop_sandbox.py +0 -0
- /blaxel/{client → core/client}/models/store_agent_labels.py +0 -0
- /blaxel/{client → core/client}/models/store_configuration_option.py +0 -0
- /blaxel/{client → core/client}/models/template_variable.py +0 -0
- /blaxel/{client → core/client}/models/time_fields.py +0 -0
- /blaxel/{client → core/client}/models/time_to_first_token_over_time_metrics.py +0 -0
- /blaxel/{client → core/client}/models/token_rate_metric.py +0 -0
- /blaxel/{client → core/client}/models/token_rate_metrics.py +0 -0
- /blaxel/{client → core/client}/models/token_total_metric.py +0 -0
- /blaxel/{client → core/client}/models/trace_ids_response.py +0 -0
- /blaxel/{client → core/client}/models/trigger.py +0 -0
- /blaxel/{client → core/client}/models/trigger_configuration.py +0 -0
- /blaxel/{client → core/client}/models/update_workspace_service_account_body.py +0 -0
- /blaxel/{client → core/client}/models/update_workspace_service_account_response_200.py +0 -0
- /blaxel/{client → core/client}/models/update_workspace_user_role_body.py +0 -0
- /blaxel/{client → core/client}/models/websocket_channel.py +0 -0
- /blaxel/{client → core/client}/models/workspace.py +0 -0
- /blaxel/{client → core/client}/models/workspace_labels.py +0 -0
- /blaxel/{client → core/client}/models/workspace_runtime.py +0 -0
- /blaxel/{client → core/client}/models/workspace_user.py +0 -0
- /blaxel/{client → core/client}/py.typed +0 -0
- /blaxel/{client → core/client}/types.py +0 -0
- /blaxel/{common → core/common}/env.py +0 -0
- /blaxel/{common → core/common}/settings.py +0 -0
- /blaxel/{sandbox/client/api/filesystem/__init__.py → core/py.typed} +0 -0
- /blaxel/{sandbox → core/sandbox}/client/__init__.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/__init__.py +0 -0
- /blaxel/{sandbox/client/api/network → core/sandbox/client/api/filesystem}/__init__.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/filesystem/delete_filesystem_path.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_filesystem_path.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_watch_filesystem_path.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/filesystem/get_ws_watch_filesystem_path.py +0 -0
- /blaxel/{sandbox/client/api/process → core/sandbox/client/api/network}/__init__.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/network/delete_network_process_pid_monitor.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/network/get_network_process_pid_ports.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/delete_process_identifier.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/get_process.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier_logs.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/get_process_identifier_logs_stream.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/api/process/get_ws_process_identifier_logs_stream.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/client.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/errors.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/delete_network_process_pid_monitor_response_200.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/error_response.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/file.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/file_request.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/file_with_content.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/get_network_process_pid_ports_response_200.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/port_monitor_request.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/post_network_process_pid_monitor_response_200.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/process_logs.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/process_response.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/process_response_status.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/subdirectory.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/models/success_response.py +0 -0
- /blaxel/{sandbox → core/sandbox}/client/py.typed +0 -0
- /blaxel/{sandbox → core/sandbox}/client/types.py +0 -0
- /blaxel/{tools → core/tools}/common.py +0 -0
- /blaxel/{tools → core/tools}/types.py +0 -0
- /blaxel/{models/custom/langchain → langgraph/custom}/gemini.py +0 -0
- /blaxel/{models/custom/llamaindex → llamaindex/custom}/cohere.py +0 -0
- /blaxel/{instrumentation → telemetry}/exporters.py +0 -0
- /blaxel/{instrumentation → telemetry/log}/log.py +0 -0
- {blaxel-0.1.21rc69.dist-info → blaxel-0.2.0rc1.dist-info}/WHEEL +0 -0
- {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
|
blaxel/sandbox/filesystem.py
DELETED
@@ -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.
|