Skip to content

Commit 2069dec

Browse files
authored
Added voicemail audio messages docs (#634)
1 parent bbe05f6 commit 2069dec

File tree

2 files changed

+114
-1
lines changed

2 files changed

+114
-1
lines changed

fern/calls/voicemail-detection.mdx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,60 @@ Choose between two detection methods based on provider performance:
453453

454454
---
455455

456+
## **Pre-recorded Audio Messages**
457+
458+
Instead of text-to-speech, you can use pre-recorded audio files for your voicemail messages. Simply provide the URL to your audio file in the `voicemailMessage` property:
459+
460+
<CodeBlocks>
461+
```json title="API Configuration"
462+
{
463+
"name": "Sales Assistant with Audio Message",
464+
"model": {
465+
"provider": "openai",
466+
"model": "gpt-4o"
467+
},
468+
"voicemailDetection": {
469+
"provider": "vapi"
470+
},
471+
"voicemailMessage": "https://example.com/sales-voicemail.mp3"
472+
}
473+
```
474+
```typescript title="TypeScript SDK"
475+
const assistant = await vapi.assistants.create({
476+
name: "Sales Assistant with Audio Message",
477+
model: {
478+
provider: "openai",
479+
model: "gpt-4o"
480+
},
481+
voicemailDetection: {
482+
provider: "vapi"
483+
},
484+
voicemailMessage: "https://example.com/sales-voicemail.wav"
485+
});
486+
```
487+
```python title="Python SDK"
488+
assistant = client.assistants.create(
489+
name="Sales Assistant with Audio Message",
490+
model={
491+
"provider": "openai",
492+
"model": "gpt-4o"
493+
},
494+
voicemail_detection={
495+
"provider": "vapi"
496+
},
497+
voicemail_message="https://example.com/sales-voicemail.mp3"
498+
)
499+
```
500+
</CodeBlocks>
501+
502+
**Supported formats**: `.wav` and `.mp3` files
503+
504+
<Tip>
505+
Pre-recorded audio messages provide consistent quality and pronunciation, especially useful for brand-specific messaging or complex information like phone numbers and website URLs.
506+
</Tip>
507+
508+
---
509+
456510
## **Disabling Voicemail Detection**
457511

458512
To completely disable voicemail detection for your assistant, set the `voicemailDetection` property to `"off"`:
@@ -596,6 +650,8 @@ When voicemail detection is disabled, your assistant will continue the conversat
596650

597651
By using Vapi's detection system, you'll avoid the common pitfalls of voicemail detection, while creating a **faster, smarter, and more professional experience** for your users.
598652

653+
654+
599655
## **Related Documentation**
600656

601657
- **[Voicemail Tool](/tools/voicemail-tool)** - Alternative assistant-controlled voicemail approach for maximum flexibility

fern/tools/voicemail-tool.mdx

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ assistant = client.assistants.create(
131131

132132
Define the voicemail message in the tool configuration:
133133

134+
### **Text-to-Speech Messages**
135+
134136
```json
135137
{
136138
"messages": [
@@ -146,9 +148,64 @@ Define the voicemail message in the tool configuration:
146148
Use template variables like `{{company}}`, `{{message}}`, and `{{phone}}` to make your voicemail messages dynamic while keeping them consistent.
147149
</Tip>
148150

151+
### **Pre-recorded Audio Messages**
152+
153+
For consistent quality and pronunciation, use pre-recorded audio files by providing the URL in the `content` field:
154+
155+
```json
156+
{
157+
"messages": [
158+
{
159+
"type": "request-start",
160+
"content": "https://example.com/voicemail.mp3"
161+
}
162+
]
163+
}
164+
```
165+
166+
**Supported formats**: `.wav` and `.mp3` files
167+
168+
<Note>
169+
Pre-recorded audio messages are ideal for brand-specific messaging or when you need precise pronunciation of phone numbers, website URLs, or company names.
170+
</Note>
171+
149172
## Advanced Examples
150173

151-
### Dynamic voicemail with context
174+
### **Pre-recorded Audio Example**
175+
176+
Using pre-recorded audio for professional voicemail messages:
177+
178+
```json
179+
{
180+
"model": {
181+
"provider": "openai",
182+
"model": "gpt-4o",
183+
"messages": [
184+
{
185+
"type": "system",
186+
"content": "You are a sales representative calling prospects. If you reach voicemail, use the leave_voicemail tool to play our professional pre-recorded message."
187+
}
188+
],
189+
"tools": [
190+
{
191+
"type": "voicemail",
192+
"function": {
193+
"name": "leave_voicemail",
194+
"description": "Leave a professional pre-recorded voicemail message"
195+
},
196+
"messages": [
197+
{
198+
"type": "request-start",
199+
"content": "https://example.com/professional-sales-voicemail.mp3"
200+
}
201+
]
202+
}
203+
]
204+
}
205+
}
206+
```
207+
208+
### **Dynamic voicemail with context**
152209

153210
```json
154211
{

0 commit comments

Comments
 (0)