语音增强

语音增强服务使用 AI 清理和改进语音转录文本。

增强转录文本

POST /api/voice/enhance

使用配置的 LLM 提供商增强语音转录文本。

字段类型必填描述
transcriptstring原始转录文本
languagestring语言代码(默认: zh-CN)
options.enableSelfCorrectionboolean自动纠错
options.enableListFormattingboolean格式化列表
options.enableFillerRemovalboolean删除填充词
options.enableToneAdjustmentboolean调整语气
options.targetTonestringformal/casual/professional
const result = await client.enhanceVoice({
  transcript: '嗯,我觉得我们应该明天部署...',
  language: 'zh-CN',
  options: {
    enableSelfCorrection: true,
    enableFillerRemoval: true,
  },
})
shadowob voice-enhance enhance \
  --transcript "嗯,我觉得我们应该明天部署..." \
  --language zh-CN \
  --no-filler-removal \
  --json

增强转录文本 (查询参数)

GET /api/voice/enhance?transcript=...&language=zh-CN

与 POST 版本相同,但使用查询参数。

参数类型必填描述
transcriptstring原始转录文本
languagestring语言代码
enableSelfCorrectionboolean自动纠错
enableListFormattingboolean列表格式化
enableFillerRemovalboolean删除填充词
enableToneAdjustmentboolean调整语气
targetTonestringformal/casual/professional
const result = await client.enhanceVoiceQuery({
  transcript: '你好世界',
  language: 'zh-CN',
  enableFillerRemoval: true,
})

获取语音增强配置

GET /api/voice/config

返回当前语音增强配置(API 密钥已脱敏)。

const config = await client.getVoiceConfig()
shadowob voice-enhance config --json

更新语音增强配置

POST /api/voice/config

仅管理员。更新语音增强的 LLM 配置。

字段类型必填描述
providerstringopenai / anthropic / alibaba / custom
apiKeystring提供商 API 密钥
baseUrlstring自定义基础 URL
modelstring模型名称
temperaturenumber0-2
maxTokensnumber最大响应令牌数
timeoutnumber请求超时(毫秒)
enabledboolean启用/禁用服务
await client.updateVoiceConfig({
  provider: 'openai',
  apiKey: 'sk-...',
  model: 'gpt-4',
  enabled: true,
})

健康检查

GET /api/voice/health

仅管理员。检查语音增强服务是否已配置并正常运行。

const health = await client.voiceHealthCheck()