阿里云智能体沙箱极速版
内置内置CLI 和 Python SDK 的默认提供方。abx template deploy 在这里构建并登记模板。
使用
python
from agent_sandbox import Sandbox
# TemplateID from abx template deploy, or the --alias you passed.
sandbox = await Sandbox.create(template="<TemplateID>")能力 18 项能力
沙箱
创建、连接、列出、销毁
sandbox.lifecycle调整存活时间
sandbox.timeout暂停与恢复
sandbox.pause执行
运行命令
exec.run流式输出
exec.stream进程列表与信号
process.manage交互终端
pty文件
读写、目录、重命名
files.rw目录监听
files.watch上传下载 URL
files.transfer代码
代码解释器
code.interpret模板
读取模板
templates.read构建模板
templates.build网络与存储
端口访问 URL
ports.url自定义域名
ports.domain挂载存储
storage.mountVPC 网络
network.vpc会话
沙箱内命名命令
sessions配置项
密钥只从该提供方自己的环境变量读取,不会转发极速版的密钥。
| 名称 | 环境变量 | 说明 |
|---|---|---|
sandbox_api_key 密钥 | ABX_SANDBOX_API_KEY | 极速版的 API Key。 |
region | ALIBABA_CLOUD_REGION_ID | 地域。默认 cn-hangzhou。不是 ABX_SANDBOX_REGION。 |
sandbox_base_url | ABX_SANDBOX_BASE_URL | 覆盖平台 API 地址。 |
sandbox_domain | ABX_SANDBOX_DOMAIN | 端口访问 URL 使用的域名。 |
access_key_id 密钥 | ALICLOUD_ACCESS_KEY_ID | 模板部署用的 AccessKey ID。不是 ALIBABA_CLOUD_ACCESS_KEY_ID,也不是 AccessKey。 |
access_key_secret 密钥 | ALICLOUD_ACCESS_KEY_SECRET | AccessKey Secret。不是 ALIBABA_CLOUD_ACCESS_KEY_SECRET,也不是 AccessSecret。 |