Enhance API documentation by adding new endpoints for ASR preview, assistant configuration retrieval, and knowledge base management. Update existing assistant and tool definitions for improved clarity and functionality. Remove outdated sections from history records documentation, ensuring a streamlined reference for users.

This commit is contained in:
Xin Wang
2026-03-02 01:56:38 +08:00
parent 1561056a3d
commit 531688aa6b
9 changed files with 829 additions and 135 deletions

View File

@@ -182,12 +182,14 @@ POST /api/v1/voices
| 字段 | 类型 | 必填 | 说明 |
|------|------|------|------|
| name | string | 是 | 声音名称 |
| vendor | string | 是 | 供应商 |
| vendor | string | 是 | 供应商: "Ali" \| "Volcano" \| "Minimax" \| "OpenAI Compatible" \| "DashScope" |
| gender | string | 是 | 性别: "Male" \| "Female" |
| language | string | 是 | 语言: "zh" \| "en" |
| description | string | 否 | 描述信息 |
| model | string | | 厂商语音模型标识 |
| voice_key | string | | 厂商voice_key |
| model | string | | 厂商语音模型标识 (可选,部分供应商有默认值) |
| voice_key | string | | 厂商 voice_key (可选,部分供应商有默认值) |
| api_key | string | 否 | 供应商 API Key (可选,也可通过环境变量配置) |
| base_url | string | 否 | API Base URL (可选,部分供应商有默认值) |
| speed | number | 否 | 默认语速 (0.5-2.0),默认 1.0 |
| gain | number | 否 | 音量增益 (-10~10 dB),默认 0 |
| pitch | number | 否 | 音调调整,默认 0 |
@@ -244,11 +246,14 @@ POST /api/v1/voices/{id}/preview
```json
{
"success": true,
"audio_url": "https://storage.example.com/preview/voice_001_preview.mp3",
"duration_ms": 2500
"audio_url": "data:audio/wav;base64,UklGRi...",
"duration_ms": 2500,
"error": null
}
```
**注意:** `audio_url` 返回 Base64 编码的音频数据 (data URI 格式),可直接在浏览器中播放或解码保存为音频文件。
---
### 7. 获取供应商声音列表