Build a Voice Agent
Handshake
Headers
API key for authentication. Format should be token <DEEPGRAM_API_KEY>
Send
Configure the voice agent and sets the input and output audio formats
Send a message to give additional instructions to the Think model in the middle of a conversation
Send a message to change the Speak model in the middle of a conversation
Send a message to change the Speak model in the middle of a conversation
Configure the voice agent and configure the function call response
Send messages ensuring uninterrupted communication for your agent
Receive
Receive injection refused message
Receive a welcome message from the server to confirm the websocket has opened
Confirm the server has successfully received and applied the Settings Configuration message
Conversation Text facilitates real-time communication by relaying spoken statements from both the user and the assistant
User Started Speaking notifies the client that the user has begun speaking
Agent Thinking informs the client when the agent is processing information
Request to call a function by sending a Function Call Request message
Provides insights into function call workflows to assist in debugging
Get notified when the server begins streaming an agent’s audio response for playback
Get signals that the server has finished sending the final audio segment to the client
Receive an error message from the server when an error occurs