From 3e6ed26b95af47bcb362598d62e18373ff5ae489 Mon Sep 17 00:00:00 2001 From: Sri Date: Wed, 20 Aug 2025 21:27:23 -0700 Subject: [PATCH] Added voicemail audio messages docs --- fern/calls/voicemail-detection.mdx | 56 ++++++++++++++++++++++++++++ fern/tools/voicemail-tool.mdx | 59 +++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 1 deletion(-) diff --git a/fern/calls/voicemail-detection.mdx b/fern/calls/voicemail-detection.mdx index ed39b8549..f8f7fff66 100644 --- a/fern/calls/voicemail-detection.mdx +++ b/fern/calls/voicemail-detection.mdx @@ -453,6 +453,60 @@ Choose between two detection methods based on provider performance: --- +## **Pre-recorded Audio Messages** + +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: + + +```json title="API Configuration" +{ + "name": "Sales Assistant with Audio Message", + "model": { + "provider": "openai", + "model": "gpt-4o" + }, + "voicemailDetection": { + "provider": "vapi" + }, + "voicemailMessage": "https://example.com/sales-voicemail.mp3" +} +``` +```typescript title="TypeScript SDK" +const assistant = await vapi.assistants.create({ + name: "Sales Assistant with Audio Message", + model: { + provider: "openai", + model: "gpt-4o" + }, + voicemailDetection: { + provider: "vapi" + }, + voicemailMessage: "https://example.com/sales-voicemail.wav" +}); +``` +```python title="Python SDK" +assistant = client.assistants.create( + name="Sales Assistant with Audio Message", + model={ + "provider": "openai", + "model": "gpt-4o" + }, + voicemail_detection={ + "provider": "vapi" + }, + voicemail_message="https://example.com/sales-voicemail.mp3" +) +``` + + +**Supported formats**: `.wav` and `.mp3` files + + +Pre-recorded audio messages provide consistent quality and pronunciation, especially useful for brand-specific messaging or complex information like phone numbers and website URLs. + + +--- + ## **Disabling Voicemail Detection** 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 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. + + ## **Related Documentation** - **[Voicemail Tool](/tools/voicemail-tool)** - Alternative assistant-controlled voicemail approach for maximum flexibility diff --git a/fern/tools/voicemail-tool.mdx b/fern/tools/voicemail-tool.mdx index 502bc9b22..465b1f999 100644 --- a/fern/tools/voicemail-tool.mdx +++ b/fern/tools/voicemail-tool.mdx @@ -131,6 +131,8 @@ assistant = client.assistants.create( Define the voicemail message in the tool configuration: +### **Text-to-Speech Messages** + ```json { "messages": [ @@ -146,9 +148,64 @@ Define the voicemail message in the tool configuration: Use template variables like `{{company}}`, `{{message}}`, and `{{phone}}` to make your voicemail messages dynamic while keeping them consistent. +### **Pre-recorded Audio Messages** + +For consistent quality and pronunciation, use pre-recorded audio files by providing the URL in the `content` field: + +```json +{ + "messages": [ + { + "type": "request-start", + "content": "https://example.com/voicemail.mp3" + } + ] +} +``` + +**Supported formats**: `.wav` and `.mp3` files + + +Pre-recorded audio messages are ideal for brand-specific messaging or when you need precise pronunciation of phone numbers, website URLs, or company names. + + ## Advanced Examples -### Dynamic voicemail with context +### **Pre-recorded Audio Example** + +Using pre-recorded audio for professional voicemail messages: + +```json +{ + "model": { + "provider": "openai", + "model": "gpt-4o", + "messages": [ + { + "type": "system", + "content": "You are a sales representative calling prospects. If you reach voicemail, use the leave_voicemail tool to play our professional pre-recorded message." + } + ], + "tools": [ + { + "type": "voicemail", + "function": { + "name": "leave_voicemail", + "description": "Leave a professional pre-recorded voicemail message" + }, + "messages": [ + { + "type": "request-start", + "content": "https://example.com/professional-sales-voicemail.mp3" + } + ] + } + ] + } +} +``` + +### **Dynamic voicemail with context** ```json {