Introduction
superU lets you build a real-time conversational AI voice assistant for your website or app. It uses your microphone to capture audio, streams it to an AI model, and plays back the AI’s spoken response—all in just a few hundred milliseconds.Getting Started
1
Sign Up and Get Your API Key
- Go to dev.superu.ai and sign up for an account
- After signing up, visit your dashboard
- Copy your API key from the dashboard
For security, store your API key in an environment variable instead of
hard-coding it in your code.
Setup & Configuration
1
Install Dependencies
Open your terminal and run the appropriate command for your operating system:
2
Configure Audio
The code will use your system’s default microphone and speakers. No extra setup is needed, but make sure your devices are working properly.
Test your microphone and speakers before running the assistant to ensure optimal performance.
Create Basic Assistant
1
Copy and Run the Code
Create a new Python file (e.g.,
superu_voice_assistant.py
) and paste the following code. Replace <YOUR_API_KEY>
with your actual API key:2
Run the Application
Execute your Python file using the appropriate command:
You should see “Connected to WebSocket. Streaming audio…” in your terminal, indicating a successful connection.
Create Advance Assistant
1
Copy and Run the Code
Create a new Python file (e.g.,
superu_voice_assistant.py
) and paste the following code. Replace <YOUR_API_KEY>
with your actual API key:2
Run the Application
Execute your Python file using the appropriate command:
You should see “Connected to WebSocket. Streaming audio…” in your terminal, indicating a successful connection.
Available AI Voices
You can choose from many different AI voices by changing thevoice_id
parameter. Each voice has a unique ID and supports various languages.
Service provider: Elevenlab
Customizing Your Assistant
You can personalize your AI assistant by modifying several key components:Name
This is the name of the assistant.Transcriber
These are the options for the assistant’s transcriber- assembly-ai
- azure
- deepgram
- 11labs
Model (Pick one of the options)
- openai
Voice (Pick one of the options)
- 11labs
- Azure
Other Customization options
-
firstMessage
This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
If unspecified, assistant will wait for user to speak and use the model to respond once they speak.
-
firstMessageInterruptionsEnabled
boolean Optional Defaults to
false
-
firstMessageInterruptionsEnabled
boolean Optional Defaults to
-
firstMessageMode
This is the mode for the first message. Default is ‘assistant-speaks-first’.
Use:
- ‘assistant-speaks-first’ to have the assistant speak first.
- ‘assistant-waits-for-user’ to have the assistant wait for the user to speak first.
- ‘assistant-speaks-first-with-model-generated-message’ to have the assistant speak first with a message generated by the model based on the conversation state. (
assistant.model.messages
at call start,call.messages
at squad transfer points).
assistant-speaks-first
assistant-speaks-first-with-model-generated-message
assistant-waits-for-user
- silenceTimeoutSeconds
doubleOptional
>=10 <=3600
How many seconds of silence to wait before ending the call. Defaults to 30. @default 30 - maxDurationSeconds
doubleOptional
>=10 <=43200
This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended. @default 600 (10 minutes) - backgroundSound
This enables filtering of noise and background speech while the user is talking.
Default
false
while in beta. @default false - backgroundDenoisingEnabled
This enables filtering of noise and background speech while the user is talking.
Default
false
while in beta. @default false - voicemailMessage
<=1000 characters
This is the message that the assistant will say if the call is forwarded to voicemail. If unspecified, it will hang up. - endCallMessage
<=1000 characters
This is the message that the assistant will say if it ends the call. If unspecified, it will hang up without saying anything.
Additional Resources
Congratulations! You now have a real-time AI Voice Agent running on your
machine.