SDK
四种语言客户端。TypeScript 是权威实现(基于
frontend/src/volo-ai-ctrl-kit),其他语言按 TS 接口平行映射。
选择你的语言
| 语言 | 状态 | 文档 |
|---|---|---|
| TypeScript / Node.js | 权威实现(基于 volo-ai-ctrl-kit) | TypeScript → |
| Python | 平行映射 · [TODO: 包发布中] | Python → |
| Java | 平行映射 · [TODO: 包发布中] | Java → |
| Go | 平行映射 · [TODO: 包发布中] | Go → |
三大核心能力
所有 SDK 围绕三个核心提供等价 API:
1 · Chat · 流式对话
封装 SSE 协议,开发者面对的是 AsyncIterator<Event> / Stream<Event> / chan Event,无需处理裸 SSE 帧。
ts
for await (const event of stream) {
if (event.type === 'ASSISTANT_DELTA') process.stdout.write(event.content)
}2 · Memory · 记忆相册
ts
await client.memory.upload({ file, userTitle: '春节家宴' })
const results = await client.memory.search({ query: '春节', topK: 10 })3 · Skill · 技能市场
ts
const skills = await client.skill.list({ category: 'design' })
await client.skill.install(skillId)
await client.skill.uninstall(skillId)通用设计
所有 SDK 遵循 VoloClient + 命名空间 模式:
VoloClient
├── chat // submitIntent / stop / resume / append
├── memory // upload / list / search / delete
├── skill // list / install / uninstall
├── auth // login / register / refresh
└── user // me / update错误处理
所有 SDK 抛出 VoloError 子类:
| 异常类 | HTTP | 含义 |
|---|---|---|
VoloAuthError | 401 | API Key 无效 |
VoloRateLimitError | 429 | 速率限制 |
VoloQuotaError | 403 | 配额耗尽 |
VoloServerError | 500 | 后端异常 |
VoloStreamError | — | SSE 连接异常 |
配置
ts
const client = new VoloClient({
apiKey: process.env.VOLO_API_KEY!,
baseURL: 'https://api.volo.ai', // 默认
timeout: 30000, // ms
retry: { maxAttempts: 3, backoff: 'exp' },
})相关
- API Reference — 底层 REST/SSE 端点
- Quickstart — 五分钟上手