feat: complete voice session safety and confirmation flow

This commit is contained in:
2026-04-20 16:10:15 +08:00
parent dbb512719d
commit fab2094e34
9 changed files with 1256 additions and 28 deletions

View File

@@ -568,6 +568,22 @@ async def create_voice_turn_from_text(...)
async def get_voice_turn(...)
```
### 解决低置信度确认
```python
@router.post(
"/voice-sessions/{session_id}/turns/{turn_id}/confirm",
response_model=VoiceTurnSummaryResponse,
)
async def resolve_voice_turn_confirmation(...)
```
支持:
- `accept`: 按当前理解继续本轮
- `retry_recording`: 撤回当前理解,重新录音
- `switch_to_text`: 撤回当前理解,切换到文本输入
### 结束并保存
```python
@@ -578,6 +594,13 @@ async def get_voice_turn(...)
async def finalize_voice_session(...)
```
### 获取语音共创 analytics
```python
@router.get("/voice-sessions/analytics", response_model=VoiceSessionAnalyticsResponse)
async def get_voice_session_analytics(...)
```
### 放弃会话
```python