feat(voice): add Deepgram voice provider
What
Adds a Deepgram voice provider to @voltagent/voice, alongside the existing OpenAI, ElevenLabs, and xsai providers.
- Text-to-speech (
speak) via Deepgram Aura models - Speech-to-text (
listen) via Deepgram Nova models getVoicesreturning the Aura voice catalog- API key via the
apiKeyoption or theDEEPGRAM_API_KEYenvironment variable
It implements BaseVoiceProvider and follows the conventions of the existing providers (event emission, error wrapping, options shape), and is exported from the package entry point.
Real-time streaming (connect/send) currently throws as not-yet-supported, matching the OpenAI provider — it can be added as a follow-up.
Usage
import { createReadStream } from "node:fs";
import { DeepgramVoiceProvider } from "@voltagent/voice";
const voice = new DeepgramVoiceProvider({ apiKey: process.env.DEEPGRAM_API_KEY });
const audio = await voice.speak("Hello from VoltAgent", { voice: "aura-asteria-en" });
const transcript = await voice.listen(createReadStream("audio.wav"));
Tests
Added unit tests covering construction, API-key resolution (option + DEEPGRAM_API_KEY fallback), the voice catalog, empty-input handling, and the unsupported realtime methods.
Verification
pnpm --filter @voltagent/voice build— clean (JS + ESM + type declarations)pnpm --filter @voltagent/voice test— 6 passingpnpm --filter @voltagent/voice lint— clean- Added a changeset (
@voltagent/voice, minor)
Summary by cubic
Adds a Deepgram voice provider to @voltagent/voice with Aura text-to-speech (speak), Nova speech-to-text (listen), and the Aura voice catalog (getVoices).
New Features
DeepgramVoiceProviderimplementsBaseVoiceProvider, is exported from the package entry point, and accepts an API key via theapiKeyoption or theDEEPGRAM_API_KEYenvironment variable.ttsModel/voiceaccept known Aura voices with autocomplete while allowing arbitrary model strings.- Realtime
connect()andsend()throw as not-yet-supported, matching the OpenAI provider. - Adds
@deepgram/sdkas a dependency and a minor changeset for@voltagent/voice.
Summary by CodeRabbit
- New Features
- Added a Deepgram voice provider for generating speech from text and transcribing prerecorded audio.
- Choose from supported Aura voices and configure speech and transcription models, audio encoding, sample rate, and language.
- Supply an API key directly or through the
DEEPGRAM_API_KEYenvironment variable.
- Limitations
- Real-time voice connections and audio sending are not supported by this provider.