Introduction

Imagine you’re selling a service, online. Your website contains a contact form where potential customers can request a demo. You know deals will close way more often if you call leads within 5 minutes of their form submission. Unfortunately, you don’t have enough hands on deck to make those calls yourself, so you’ve decided to automate those calls with an AI voice agent.

In this example, we’ll show you how to call your inbound leads with a personalized prompt. Let’s get started!

Prompt for the phone call

Your phone call prompt should be written as a template string (a string that you can pass variables to). That way, you can insert the data captured from the form into your prompt.

Here’s what your prompt should look like (before you insert the data from the form).

Did you notice how detailed the prompt is? It provides so much context, and explains what character the AI phone agent is playing, why it’s playing it, how it should speak, how the call should progress, and even provides an example dialogue.

Now, check out what the prompt looks like after we insert the form variables.

Customizing the phone agent

In this case, our phone agent’s name is Matt. So we’ll use a male voice.

Note, by default, the voice latency parameter reduce_latency is set to true. And the default voice_id is 0 (a male voice). Therefore, we’ll just use the default voice settings.

For clarity’s sake, we’ll include those in our code example anyone.

Code example

The code example is present on the right hand section of this page. You can copy it, either in Javascript or Python.

Have additional questions? Want to see other use cases? Join our discord community!