跳转到内容

模块怎么选

UI / App
↕ events
@ottervoice/core ← 会话、状态机、VAD、打断、用量
↕ RuntimeAdapter
runtime-web | react-native | node
↕ Provider interfaces
provider-deepgram | elevenlabs | openrouter | azure-speech | 自研
何时用
@ottervoice/core 始终需要。createVoiceSession / createOtterVoiceSession、事件、Mock。
@ottervoice/runtime-web 浏览器麦克风 + 播放。
@ottervoice/runtime-react-native Expo / RN,注入原生音频能力。
@ottervoice/runtime-node CLI / 服务端音频与网络。
Providers 按云厂商选;也可实现同一接口自研。
@ottervoice/protocol 跨进程 / 跨端转发 Session 事件时。
@ottervoice/provider-utils 写自定义 Provider:凭证、SSE、WebSocket ASR。

一种客户端契约,两种后端实现

Section titled “一种客户端契约,两种后端实现”
后端 AudioLLMProvider 内部路径 客户端差异
原生 audio in → 原生语音模型 → text + audio out
复合 audio in → ASR → LLM → TTS → text + audio out

VoiceSession 始终只接收 providers.audioLlm,需要独立字幕时再加可选 providers.asr。模型数量与厂商选择全部封装在 Provider 或可信网关后。

OpenRouter 等只是仓库附带适配器,不是固定线上通路。