Feature request: Add self-hosted STT input with FunASR/SenseVoice
Motivation
Rasa users building private or on-premise voice assistants need a way to send recorded utterances to a self-hosted speech-to-text service. A provider-neutral OpenAI-compatible transcription contract could support FunASR/SenseVoice deployments without adding a heavyweight model runtime to Rasa itself.
Current architecture
This is not currently a provider-only change. On Rasa main, TwilioVoiceInput receives Twilio's completed SpeechResult text. Its response uses Twilio <Gather input="speech">, so raw microphone/call audio never reaches Rasa. The repository also has no ASREngine interface or generic voice/ASR configuration to implement against.
Smallest viable scopes
A maintainer decision is needed between two materially different features:
Generic recorded-audio input channel
- Accept a multipart audio upload at a new Rasa input-channel route.
- Forward the file to a configurable
POST /v1/audio/transcriptionsendpoint. - Require at least
{ "text": "..." }, then create the normal RasaUserMessage. - Keep endpoint URL, optional bearer token, model, language, and timeout in server-side channel credentials.
- This is the smaller, provider-neutral slice, but it does not replace Twilio phone-call transcription.
Twilio Media Streams plus pluggable STT
- Add a WebSocket media route and call/session lifecycle.
- Decode or forward Twilio's 8 kHz mu-law audio, define utterance boundaries, and handle disconnect/retry behavior.
- Send completed audio to the configured transcription provider and preserve the existing tracker/output-channel flow.
- This is a substantially larger phone integration and should not be represented as a simple
FunASRASREngineclass.
Backend scope
- An OpenAI-compatible endpoint can point to a compatible self-hosted FunASR/SenseVoice deployment or adapter; no cloud API is required.
- Direct in-process FunASR support should be separate because it adds model downloads and large optional runtime dependencies.
- SenseVoiceSmall supports Chinese, Cantonese, English, Japanese, and Korean. Other FunASR checkpoints have different language, timestamp, and hardware characteristics.
- FunASR and SenseVoice repository source is MIT-licensed; model weights follow their individual model cards.
Acceptance criteria for the smaller HTTP slice
- Mocked tests for authenticated and unauthenticated requests, config parsing, model/language forwarding, timeout, non-2xx response, malformed JSON, and missing
text. - Temporary audio is bounded and cleaned up on both success and failure.
- Provider errors are sanitized before logging or returning them to clients.
- Documentation contains one generic endpoint example and one tested FunASR/SenseVoice-compatible deployment example.
References
- FunASR: https://github.com/modelscope/FunASR
- SenseVoice: https://github.com/FunAudioLLM/SenseVoice
- SenseVoiceSmall model card: https://huggingface.co/FunAudioLLM/SenseVoiceSmall
Source: RasaHQ/rasa