为 tools-pve 个人语音输入启用 SMART
This commit is contained in:
@@ -241,12 +241,12 @@ embedding 模型禁止使用自动追踪 latest 的别名,否则升级会混
|
||||
[Hindsight 配置](https://hindsight.vectorize.io/developer/configuration)。
|
||||
# 个人语音输入热词路由(2026-10-25)
|
||||
|
||||
独立别名 `gemini-transcribe-personal` 使用 `gemini/gemini-3.5-transcribe`,经 Google AI Studio 凭据转发。客户端调用现有 `/v1/audio/transcriptions`,无需自行传词表。该别名附带 `personal_vocabulary: true`;启动适配器仅对明确标记的 Gemini 转写请求注入原生 `generation_config.transcription_config.custom_vocabulary`,普通路由不变。
|
||||
独立别名 `gemini-transcribe-personal` 使用 `gemini/gemini-3.5-transcribe`,经 Google AI Studio 凭据转发。客户端调用现有 `/v1/audio/transcriptions`,无需自行传词表。该别名附带 `personal_vocabulary: true`;启动适配器仅对明确标记的 Gemini 转写请求注入原生 `generation_config.transcription_config.custom_vocabulary` 和 `mode: smart`,普通路由不变。SMART 与 HK 保持相同的功能意图,但 AI Studio 使用小写字符串 `smart`,不是 Vertex 的大写 `SMART` 和 camelCase 字段。
|
||||
|
||||
个人词表来自既有 asr-pipeline 的 SQLite alias 表,只取 confirmed=1 的正确 canonical 值,优先 learned/review,再按命中次数排序,去重后最多100词。私有文件位于 tools-pve `/opt/litellm/personal-vocabulary.json`(0600),不提交 Git。词表每次请求读取;更新数据文件无需重启,但目前没有自动同步调度。
|
||||
|
||||
语音输入使用 `response_format=json` 或 `text`;不支持词级时间戳、字幕及说话人分离。Google 目前不允许原生热词与说话人分离或词级时间戳组合。不要把这条路由用于需要 diarization 的会议流程。
|
||||
语音输入推荐 `response_format=json`,与 HK 的 Spokenly 设置一致;不支持词级时间戳、字幕及说话人分离。Google 目前不允许 SMART/原生热词与说话人分离或词级时间戳组合。不要把这条路由用于需要 diarization 的会议流程。
|
||||
|
||||
LiteLLM 1.104.2 原生适配未映射热词,因此 `personal_transcription.py` 使用受路由开关约束的启动适配。升级 LiteLLM 后必须重跑 `scripts/test-personal-transcription-wire.py`,确认私有开关不泄漏上游、普通请求不变、Google 请求体中存在原生词表。不要将 mock 验证等同于识别质量提升。
|
||||
LiteLLM 1.104.2 原生适配未映射热词/SMART,因此 `personal_transcription.py` 使用受路由开关约束的启动适配。升级 LiteLLM 后必须重跑 `scripts/test-personal-transcription-wire.py`,确认私有开关不泄漏上游、普通请求不变、Google 请求体中存在原生词表和 `mode: smart`。不要将 mock 验证等同于识别质量提升。
|
||||
|
||||
首次上线通过两次合成词 HTTP mock 验证,以及一秒合成静音的真实 Google HTTP 200 测试;未使用私人录音,未改会议配置。LAN 客户端 key 已单独增加本别名权限,其他受限 key 需按需授权。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Add native vocabulary only to explicitly opted-in Gemini transcription calls."""
|
||||
"""Add native SMART mode and vocabulary only to opted-in dictation calls."""
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
@@ -34,6 +34,7 @@ def install():
|
||||
# Fail closed if a future LiteLLM version enables conflicting features by default.
|
||||
if config.get('mode'):
|
||||
raise ValueError('Unexpected Gemini transcription mode')
|
||||
config['mode'] = 'smart'
|
||||
config['custom_vocabulary'] = vocabulary()
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user