Quick Start Guide

Hello Voice Agent Example

Prerequisites

  • A VoiceRun account
  • Limited python experience
  • A little bit of creativity

Getting Started

1
Sign up for an account

Visit the signup page to create your VoiceRun account.

2
Create an agent

From your dashboard, navigate to the Agents Portal and click on "Create New Agent".

3
Add details

Give your agent a name, a description, and select a default voice. The description will be used to help the agent understand the user's request better by adding context.

3
Add an environment

Navigate to the "Environments" tab in your agent settings and click "+ Environment". Environments can be used to manage different configurations for your agent.

4
Create a function

In the "Functions" section, create a new function that will handle your agent's logic. Use the sample code below as a starting point.

async function handler(event, context, emit) {
    // Handle start of conversation with "StartEvent" and send a welcome message
    if (event instanceof StartEvent) {
        emit(new TextToSpeechEvent("Hello! I'm your voice agent. How can I help you today?"));
    }

    // Handle user input with "TextEvent" whether it is text or transcribed speech
    if (event instanceof TextEvent) {
        emit(new TextToSpeechEvent(event.data.text));
    }
}

5
Deploy to your environment

Once your function is ready, click the "Save" button and then the "Deploy Version" button from the three dot menu. Select the environment you created earlier to complete.

6
Test in debugger

Open the "Debugger" panel to test your agent. Click "Start" to begin a conversation with your agent and see how it responds to different inputs. You can view the event logs to troubleshoot any issues.

7
Test over the phone

From the "Environments" tab, you can select an environment and click the "Add Phone Number" button. This will add a phone number to your agent. You can then call the number and speak with your agent.

Next Steps