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

@@ -289,86 +289,7 @@ GET /api/v1/history/{call_id}/audio/{turn_index}
---
### 8. 搜索通话记录
```http
GET /api/v1/history/search
```
**Query Parameters:**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| q | string | 是 | 搜索关键词 |
| page | int | 否 | 页码 |
| limit | int | 否 | 每页数量 |
**Response:**
```json
{
"total": 5,
"page": 1,
"limit": 20,
"list": [
{
"id": "call_001",
"started_at": "2024-01-15T14:30:00Z",
"matched_content": "用户咨询产品A的售后服务"
}
]
}
```
---
### 9. 获取统计信息
```http
GET /api/v1/history/stats
```
**Query Parameters:**
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| start_date | string | 否 | 开始日期 |
| end_date | string | 否 | 结束日期 |
| assistant_id | string | 否 | 助手ID |
**Response:**
```json
{
"total_calls": 150,
"connected_calls": 135,
"missed_calls": 15,
"failed_calls": 0,
"avg_duration_seconds": 180,
"total_cost": 7.50,
"by_status": {
"connected": 135,
"missed": 15,
"failed": 0
},
"by_source": {
"debug": 100,
"external": 50
},
"daily_trend": [
{
"date": "2024-01-15",
"calls": 20,
"connected": 18,
"avg_duration": 175
}
]
}
```
---
## 推荐的 Schema 定义
## Schema 定义
```python
# ============ Call Record ============
@@ -440,17 +361,6 @@ class TranscriptOut(TranscriptCreate):
class Config:
from_attributes = True
class HistoryStats(BaseModel):
total_calls: int
connected_calls: int
missed_calls: int
failed_calls: int
avg_duration_seconds: float
total_cost: float
by_status: dict
by_source: dict
daily_trend: List[dict]
```
---