add deepgram api key env var and config support

This commit is contained in:
leonardotrapani
2026-02-01 02:00:17 +01:00
parent 319a0ef8e2
commit 1865de74ef
5 changed files with 22 additions and 9 deletions
+3
View File
@@ -51,6 +51,9 @@ func (c *Config) resolveAPIKeyForProvider(provider string) string {
case "elevenlabs": case "elevenlabs":
providerName = "elevenlabs" providerName = "elevenlabs"
envVar = "ELEVENLABS_API_KEY" envVar = "ELEVENLABS_API_KEY"
case "deepgram":
providerName = "deepgram"
envVar = "DEEPGRAM_API_KEY"
} }
if c.Providers != nil { if c.Providers != nil {
+2
View File
@@ -46,6 +46,8 @@ keywords = []
# api_key = "" # Mistral API key (or set MISTRAL_API_KEY env var) # api_key = "" # Mistral API key (or set MISTRAL_API_KEY env var)
# [providers.elevenlabs] # [providers.elevenlabs]
# api_key = "" # ElevenLabs API key (or set ELEVENLABS_API_KEY env var) # api_key = "" # ElevenLabs API key (or set ELEVENLABS_API_KEY env var)
# [providers.deepgram]
# api_key = "" # Deepgram API key (or set DEEPGRAM_API_KEY env var)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# Audio Recording # Audio Recording
+2 -1
View File
@@ -17,7 +17,7 @@ type ConfigureResult struct {
} }
// AllProviders is the list of all supported cloud providers (require API keys) // AllProviders is the list of all supported cloud providers (require API keys)
var AllProviders = []string{"openai", "groq", "mistral", "elevenlabs"} var AllProviders = []string{"openai", "groq", "mistral", "elevenlabs", "deepgram"}
// LocalProviders is the list of local providers (no API key required) // LocalProviders is the list of local providers (no API key required)
var LocalProviders = []string{"whisper-cpp"} var LocalProviders = []string{"whisper-cpp"}
@@ -28,6 +28,7 @@ var providerDisplayNames = map[string]string{
"groq": "Groq", "groq": "Groq",
"mistral": "Mistral", "mistral": "Mistral",
"elevenlabs": "ElevenLabs", "elevenlabs": "ElevenLabs",
"deepgram": "Deepgram",
"whisper-cpp": "Whisper.cpp (local)", "whisper-cpp": "Whisper.cpp (local)",
} }
+7
View File
@@ -418,3 +418,10 @@ Started: Sun Feb 1 12:22:47 AM CET 2026
- Updated tests: streaming models now succeed (not error) - Updated tests: streaming models now succeed (not error)
- Added tests for deepgram and openai-realtime streaming models - Added tests for deepgram and openai-realtime streaming models
- All tests passing with -race flag, typecheck passes - All tests passing with -race flag, typecheck passes
### Task 43: Add DEEPGRAM_API_KEY env var support
- Added `case "deepgram"` to `resolveAPIKeyForProvider()` in convert.go
- Maps to providerName="deepgram" and envVar="DEEPGRAM_API_KEY"
- Updated config template in save.go with commented deepgram section
- Added "deepgram" to AllProviders and providerDisplayNames in configure.go for TUI
- All tests passing, typecheck passes
+7 -7
View File
@@ -1002,13 +1002,13 @@
"Update providers config section to include deepgram", "Update providers config section to include deepgram",
"Update config template in save.go with deepgram section" "Update config template in save.go with deepgram section"
], ],
"verify": [ "verify": [
"Deepgram API key resolved from config or DEEPGRAM_API_KEY env", "Deepgram API key resolved from config or DEEPGRAM_API_KEY env",
"Config template includes deepgram section", "Config template includes deepgram section",
"Typecheck passes" "Typecheck passes"
], ],
"passes": false "passes": true
}, },
// ============================================================================ // ============================================================================
// PHASE 9: DOCUMENTATION // PHASE 9: DOCUMENTATION
// Consolidated at the end - update all docs once architecture is stable // Consolidated at the end - update all docs once architecture is stable