Voice Agent v1 API Migration
Guide for migrating from Voice Agent API v0 to v1.
The Voice Agent v1 Migration guide provides a comprehensive overview of the changes and updates required to migrate from Voice Agent v0 to v1.
The Deepgram API Spec and Voice Agent API Reference have more details on the new Voice Agent API.
WebSocket Connection
The WebSocket path has changed to:
- v0:
wss://agent.deepgram.com/agent
- v1:
wss://agent.deepgram.com/v1/agent/converse
Settings Configuration Changes
- Object name changed from
settings_configuration
tosettings
- Under the
agent
object, thelisten
,think
andspeak
objects now have an additionalprovider
object Settings
now contains a newexperimental
field to opt-in to experimental Agent featuresSettings
now contains a newmip_opt_out
field to opt-out of the Deepgram Model Improvement Program
New Settings Example
For a detailed explanation of all the options available for Settings
, refer to our documentation on how to Configure the Voice Agent.
Audio Configuration Changes
Input Audio:
- Object structure is now
audio.input.option
audio.input
is now required instead of nullable- Default values:
encoding="linear16"
,sample_rate=16000
Output Audio:
- Object structure is now
audio.output.option
Provider Configuration Changes
Speak Provider:
- Object structure is now
agent.speak.provider
- For Deepgram TTS, only
type
andmodel
are required - Other fields like
model_id
,voice
,language
,language_code
are optional and only used for other providers
Think Provider:
- Object structure is now
agent.think.provider
- For Deepgram LLM, only
type
andmodel
are required - Other fields like
endpoint
,temperature
,functions
,prompt
are optional and only used for other providers
LLM Instructions Changes
Prompt / LLM Instructions Location:
- v0: Instructions were set in
agent.think.instructions
- v1: All instructions are now set in
agent.think.prompt
Prompt / LLM Instructions Message Types:
- v0:
UpdateInstructions
usedinstructions
field. - v1:
UpdateInstructions
now usesprompt
field.
New Agent Server Messages
PromptUpdated
: Confirms prompt updatesSpeakUpdated
: Confirms speak model changesWarning
: For non-fatal errors
API Deprecations
UpdateInstructions
is now deprecatedFunctionCallingMessage
is now deprecated
Experimental Features
AgentStartedSpeaking
is now experimental
Server Messages Changes
Welcome
- Confirms WebSocket connection success
v0
Welcome message includedsession_id
v1
Welcome message now includesrequest_id
instead ofsession_id
Function Calling Changes
For more detailed information about function calling, see our Function Calling Documentation.
Message Structure Changes:
- v0: Used a single
FunctionCallingMessage
type - v1: Split into
FunctionCallRequest
andFunctionCallResponse
types
Function Call Configuration:
- Object structure is
agent.think.functions
in theSettings
message
Function Call Execution:
- Client-side functions:
- Executed locally in the client application
- No endpoint configuration required
- Set
client_side: true
in function definition
- Server-side functions:
- Executed on the server
- Requires endpoint configuration
- Set
client_side: false
in function definition
Migration Checklist
Consider the following checklist to ensure a smooth migration:
- WebSocket connection establishes successfully
- Settings message is accepted without errors
- Audio data is processed correctly
- Voice agent responds appropriately
- Function calls work as expected
- Error handling works correctly
- Warning messages are handled properly
- Client-side and server-side functions work as expected
- Audio input/output configuration is correct
- Provider configurations are properly set up
- All server messages are properly handled
- Client messages are correctly formatted
- Error and warning handling is implemented
- Audio streaming works in both directions