feat: complete voice session safety and confirmation flow
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -23,8 +23,12 @@
|
||||
本轮新增收束:
|
||||
|
||||
- 当 `transcript_confidence` 或 `intent_confidence` 偏低时,后端优先返回确认提示,而不是直接把这一轮写进故事正文
|
||||
- 已补完整确认流:支持“按这个理解继续”“重说本轮”“改成文本输入”
|
||||
- 前端明确展示“本轮系统理解为”与“建议家长确认后再继续”提示
|
||||
- 低置信度确认链路已有后端测试覆盖,可作为下一阶段继续接 ASR 与更细确认交互的基础
|
||||
- 已新增用户转写安全检查、assistant 输出柔性改写与 `safety_flags` 事件记录
|
||||
- finalize 会生成更稳定的标题/摘要,并在条件允许时自动衔接封面补全
|
||||
- 已新增 `voice session analytics` 聚合指标,可跟踪 turn 成功率、ASR/TTS 失败、低置信度触发和 finalize 转化率
|
||||
|
||||
Phase A 的核心目标不是做“完全实时的语音陪伴”,而是验证以下最小闭环:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user