| name | deepgram-go-voice-agent |
| description | Use when writing or reviewing Go code in this repo that runs a Deepgram Voice Agent session over WebSockets, including runtime settings, prompt updates, speak updates, injected messages, and event handling. Route standalone STT/TTS work to deepgram-go-speech-to-text or deepgram-go-text-to-speech. |
Using Deepgram Voice Agent from the Go SDK
When to use this product
Use this skill for live Voice Agent runtime flows in pkg/client/agent.
- open an agent WebSocket session
- send initial settings
- stream audio
- react to agent events and function-call messages
- update prompt/speak settings during the session
Use a different skill when:
- you only need STT (
deepgram-go-speech-to-text)
- you only need TTS (
deepgram-go-text-to-speech)
- you need management/admin endpoints (
deepgram-go-management-api)
Authentication
Set DEEPGRAM_API_KEY before opening the agent connection.
export DEEPGRAM_API_KEY="your_api_key"
Quick start
package main
import (
"context"
"fmt"
"log"
agentws "github.com/deepgram/deepgram-go-sdk/v3/pkg/api/agent/v1/websocket"
agent "github.com/deepgram/deepgram-go-sdk/v3/pkg/client/agent"
)
func main {
err := run(); err != {
log.Fatal(err)
}
}
{
ctx := context.Background()
settings := agent.NewSettingsConfigurationOptions()
handler := agentws.NewDefaultChanHandler()
conn, err := agent.NewWSUsingChanWithDefaults(ctx, settings, handler)
err != {
err
}
conn.Stop()
ok := conn.Connect(); !ok {
fmt.Errorf()
}
conn.Start()
}