feat: 语音确认、联调与运维增强
- 语音:序数解析(第一个/第二个等)、解析失败计数与 API detail.retry_remaining; 百度 ASR 固定 dev_pid 为普通话;SurgeryPipelineError 支持 extra 并入 HTTP detail。 - Demo:demo 路由与假 RTSP、客户端 index 与 README;BackendResolver 与配置调整。 - 可观测:消耗 TSV 日志、语音文件日志、终端 Markdown 辅助;相关测试与依赖更新。 - 注意:.env 仍被 gitignore,本地密钥不会进入本提交。 Made-with: Cursor
This commit is contained in:
@@ -13,6 +13,21 @@ def test_parse_voice_choice_numeric() -> None:
|
||||
assert parse_voice_choice("第2个", ["纱布", "缝线", "钳子"]) == "缝线"
|
||||
|
||||
|
||||
def test_parse_voice_choice_ordinal_chinese() -> None:
|
||||
opts = ["纱布", "缝线", "钳子"]
|
||||
assert parse_voice_choice("第一个", opts) == "纱布"
|
||||
assert parse_voice_choice("第一个。", opts) == "纱布"
|
||||
assert parse_voice_choice("第2个", opts) == "缝线"
|
||||
assert parse_voice_choice("第二", opts) == "缝线"
|
||||
assert parse_voice_choice("选3", opts) == "钳子"
|
||||
assert parse_voice_choice("选项2", ["纱布", "缝线"]) == "缝线"
|
||||
|
||||
|
||||
def test_parse_voice_choice_single_chinese_digit_with_few_options() -> None:
|
||||
assert parse_voice_choice("一", ["纱布", "缝线"]) == "纱布"
|
||||
assert parse_voice_choice("两", ["纱布", "缝线"]) == "缝线"
|
||||
|
||||
|
||||
def test_parse_voice_choice_negative() -> None:
|
||||
assert parse_voice_choice("不是", ["纱布", "缝线"]) is None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user