diff --git a/fern/assistants/personalization.mdx b/fern/assistants/personalization.mdx
index 6b719de7..44dde42a 100644
--- a/fern/assistants/personalization.mdx
+++ b/fern/assistants/personalization.mdx
@@ -105,7 +105,7 @@ This approach is ideal for use cases like customer support, account management,
name: "Dynamic Customer Support Assistant",
model: {
provider: "openai",
- model: "gpt-4",
+ model: "gpt-4o",
messages: [{
role: "system",
content: `You are helping ${customer.name}, a ${customer.tier} member since ${customer.createdAt}.`
diff --git a/fern/customization/custom-llm/tool-calling-integration.mdx b/fern/customization/custom-llm/tool-calling-integration.mdx
index 4ec070e2..252343fe 100644
--- a/fern/customization/custom-llm/tool-calling-integration.mdx
+++ b/fern/customization/custom-llm/tool-calling-integration.mdx
@@ -241,7 +241,7 @@ Once your endpoints are set up, try testing them with these cURL commands.
curl -X POST https://custom-llm-url/chat/completions \
-H "Content-Type: application/json" \
-d '{
- "model": "gpt-3.5-turbo",
+ "model": "gpt-4o",
"messages": [
{"role": "user", "content": "I need a payment link."}
],
@@ -268,7 +268,7 @@ Streaming chunks eventually include the result (e.g., a payment link) returned b
curl -X POST https://custom-llm-url/chat/completions \
-H "Content-Type: application/json" \
-d '{
- "model": "gpt-3.5-turbo",
+ "model": "gpt-4o",
"messages": [
{"role": "user", "content": "Please transfer my call."}
],
@@ -423,4 +423,4 @@ By building each layer step by step and testing with cURL, you can fine-tune you
For your convenience, you can find the complete source code for this Custom LLM integration here:
**[Custom LLM with Vapi Integration – Complete Code](https://codesandbox.io/p/devbox/gfwztp)**
-```
\ No newline at end of file
+```
diff --git a/fern/customization/custom-transcriber.mdx b/fern/customization/custom-transcriber.mdx
index 24e14855..6157c8e8 100644
--- a/fern/customization/custom-transcriber.mdx
+++ b/fern/customization/custom-transcriber.mdx
@@ -63,8 +63,26 @@ You'll learn how to:
mkdir vapi-custom-transcriber
cd vapi-custom-transcriber
npm init -y
+ ```
+
+
+ ```bash title="npm"
npm install ws express dotenv @deepgram/sdk
```
+
+ ```bash title="yarn"
+ yarn add ws express dotenv @deepgram/sdk
+ ```
+
+ ```bash title="pnpm"
+ pnpm add ws express dotenv @deepgram/sdk
+ ```
+
+ ```bash title="bun"
+ bun add ws express dotenv @deepgram/sdk
+ ```
+
+
Create a `.env` file with the following content:
```env
DEEPGRAM_API_KEY=your_deepgram_api_key
diff --git a/fern/customization/jwt-authentication.mdx b/fern/customization/jwt-authentication.mdx
index 70261c57..3535854d 100644
--- a/fern/customization/jwt-authentication.mdx
+++ b/fern/customization/jwt-authentication.mdx
@@ -31,7 +31,7 @@ For example, it can be used to restrict which API endpoints the token can access
As of writing, the only publicly scoped API endpoint is
- https://api.vapi.ai//call/web, which is used for Web Call creation. All other
+ https://api.vapi.ai/call/web, which is used for Web Call creation. All other
endpoints are privately scoped.
@@ -136,18 +136,7 @@ If you set the scope to `public`, you can use it to make authenticated API reque
```
import Vapi from '@vapi-ai/web';
-const vapi = new Vapi({
- token: 'your-jwt-token',
-});
+const vapi = new Vapi('your-jwt-token');
vapi.start('your-assistant-id');
```
-
-## Notes
-
-- With the generated token, you can authenticate API requests to any endpoint requiring authentication. The token will be valid for the duration specified in the options (1 hour in this case).
-- If you don't specify `token` in the JWT payload, the token will be public.
-
-## Conclusion
-
-This documentation covered the basics of generating a JWT token and demonstrated how to use the token to make authenticated API requests. Ensure that your environment variables (e.g., `ORG_ID` and `PRIVATE_KEY`) are correctly set up before running the code.
diff --git a/fern/docs.yml b/fern/docs.yml
index 9c0b446b..5b3214ce 100644
--- a/fern/docs.yml
+++ b/fern/docs.yml
@@ -746,15 +746,13 @@ redirects:
- source: "/multilingual/introduction"
destination: "/multilingual"
- source: "/outbound_sales"
- destination: "/examples/outbound-sales"
+ destination: "/examples/lead-qualification"
- source: "/technical_support"
destination: "/examples/inbound-support"
- source: "/pizza_website"
destination: "/examples/inbound-support"
- source: "/examples/pizza-website"
destination: "/examples/inbound-support"
- - source: "/outbound_call_python"
- destination: "/examples/outbound-call-python"
- source: "/voice_widget"
destination: "/examples/voice-widget"
- source: "/clients"
diff --git a/fern/examples/docs-agent.mdx b/fern/examples/docs-agent.mdx
index 26e54cb3..1b21f4ae 100644
--- a/fern/examples/docs-agent.mdx
+++ b/fern/examples/docs-agent.mdx
@@ -8,7 +8,7 @@ Try our live implementation using the voice widget in the bottom-right corner of
## Overview
-Build a voice-powered documentation assistant step by step. Use API requests (shown below) or the [Vapi Dashboard](https://dashboard.vapi.ai/).
+Build a voice-powered documentation assistant step by step. Choose between using the Dashboard interface or programmatic APIs to suit your workflow.
You'll learn to:
- Index your docs with LlamaCloud
@@ -20,7 +20,7 @@ You'll learn to:
## Prerequisites
- [Vapi account](https://dashboard.vapi.ai/) with API access
-- Documentation content - use your `llms-full.txt` file ([example](https://docs.vapi.ai/llms-full.txt)), available out-of-box on [Fern](https://buildwithfern.com/learn/docs/developer-tools/llms-txt) or [Mintlify](https://mintlify.com/docs/ai-ingestion#%2Fllms-full-txt)
+- Documentation content - `llms.txt` file ([example](https://docs.vapi.ai/llms.txt)) could work great; it could be available out-of-box with your documentation framework (e.g. [Fern](https://buildwithfern.com/learn/docs/developer-tools/llms-txt), [Mintlify](https://mintlify.com/docs/ai-ingestion#%2Fllms-full-txt))
- [LlamaCloud account](https://cloud.llamaindex.ai/) for indexing
## Get started
@@ -41,177 +41,682 @@ You'll learn to:
- Create a tool that connects your assistant to your LlamaCloud index using the [Tools API](/api-reference/tools/create).
-
- You can also create this tool in the [Vapi Dashboard](https://dashboard.vapi.ai/).
- ```bash
- curl -X POST https://api.vapi.ai/tool \
- -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
- -H "Content-Type: application/json" \
- -d '{
- "type": "apiRequest",
- "name": "docsquery",
- "function": {
- "name": "docsquery",
- "parameters": {
- "type": "object",
- "properties": {
- "query": {
- "type": "string",
- "description": "The search query to find relevant documentation"
+ Create a tool that connects your assistant to your LlamaCloud index.
+
+
+
+ 1. Navigate to **Tools** in your [Vapi Dashboard](https://dashboard.vapi.ai/)
+ 2. Click **Create Tool**
+ 3. Select **API Request** as the tool type
+ 4. Configure the tool:
+ - **Name**: `docsquery`
+ - **Function Name**: `docsquery`
+ - **Description**: `Search through documentation to find relevant information`
+ - **URL**: `https://api.cloud.llamaindex.ai/api/v1/pipelines/YOUR_PIPELINE_ID/retrieve`
+ - **Method**: `POST`
+ - **Headers**: Add `Authorization: Bearer YOUR_LLAMACLOUD_API_KEY`
+ - **Body**: Configure to send the query parameter
+ 5. Save the tool and note the tool ID
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ // Initialize Vapi server SDK
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Create the documentation query tool
+ const tool = await vapi.tools.create({
+ type: "function",
+ function: {
+ name: "docsquery",
+ parameters: {
+ type: "object",
+ properties: {
+ query: {
+ type: "string",
+ description: "The search query to find relevant documentation"
+ }
+ },
+ required: ["query"]
+ }
+ },
+ server: {
+ // LlamaCloud API endpoint for your pipeline
+ url: `https://api.cloud.llamaindex.ai/api/v1/pipelines/${YOUR_PIPELINE_ID}/retrieve`,
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ "Authorization": `Bearer ${YOUR_LLAMACLOUD_API_KEY}`
+ },
+ // Send user query to LlamaCloud
+ body: {
+ query: "{{query}}"
+ }
+ }
+ });
+
+ console.log(`Tool created with ID: ${tool.id}`);
+ ```
+
+
+ ```python
+ from vapi import Vapi
+
+ # Initialize Vapi server SDK
+ client = Vapi(token="YOUR_VAPI_API_KEY")
+
+ # Define system prompt for documentation assistant
+ system_prompt = """You are a helpful documentation assistant. Use the docsquery tool to find relevant information when users ask questions about the documentation.
+
+Guidelines:
+- Always be helpful, friendly, and concise
+- Provide accurate information based on the documentation
+- When you don't know something, say so clearly
+- Keep responses conversational for voice interaction
+- Use the docsquery tool whenever users ask specific questions about features, setup, or implementation
+- Summarize complex information in an easy-to-understand way
+- Ask clarifying questions if the user's request is unclear
+- Provide step-by-step guidance when explaining processes"""
+
+ # Create the documentation assistant
+ assistant = client.assistants.create(
+ name="Docs agent",
+ model={
+ "provider": "anthropic",
+ "model": "claude-3-5-sonnet-20241022", # Valid Claude model
+ "maxTokens": 400,
+ "messages": [
+ {
+ "role": "system",
+ "content": system_prompt
+ }
+ ],
+ "toolIds": [YOUR_TOOL_ID_FROM_STEP_2] # Replace with actual tool ID
+ },
+ // Configure voice settings
+ voice={
+ "provider": "vapi",
+ "voice_id": "Harry"
+ },
+ // Configure transcription
+ transcriber={
+ "provider": "deepgram",
+ "model": "nova-2",
+ "language": "en"
+ },
+ // Set greeting message
+ first_message="Hey I'm Harry, a support agent. How can I help you today? You can ask me questions about Vapi, how to get started or our documentation.",
+ end_call_message="Goodbye.",
+ background_sound="off",
+ // Enable call analysis for continuous improvement
+ analysis_plan={
+ "summaryPlan": {
+ "enabled": True,
+ "prompt": "Summarize this documentation support call, focusing on the user's questions and how well they were answered."
+ },
+ "successEvaluationPlan": {
+ "enabled": True,
+ "prompt": "Evaluate if this documentation support call was successful. Did the user get helpful answers to their questions?",
+ "rubric": "NumericScale"
+ }
+ }
+ )
+
+ print(f"Assistant created with ID: {assistant.id}")
+ ```
+
+
+ ```bash
+ curl -X POST https://api.vapi.ai/tool \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "type": "apiRequest",
+ "name": "docsquery",
+ "function": {
+ "name": "docsquery",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "description": "The search query to find relevant documentation"
+ }
+ },
+ "required": ["query"]
}
},
- "required": ["query"]
- }
- },
- "url": "https://api.cloud.llamaindex.ai/api/v1/pipelines/YOUR_PIPELINE_ID/retrieve",
- "method": "POST",
- "headers": {
- "type": "object",
- "properties": {
- "Content-Type": {
- "type": "string",
- "value": "application/json"
+ "url": "https://api.cloud.llamaindex.ai/api/v1/pipelines/YOUR_PIPELINE_ID/retrieve",
+ "method": "POST",
+ "headers": {
+ "type": "object",
+ "properties": {
+ "Content-Type": {
+ "type": "string",
+ "value": "application/json"
+ },
+ "Authorization": {
+ "type": "string",
+ "value": "Bearer YOUR_LLAMACLOUD_API_KEY"
+ }
+ }
},
- "Authorization": {
- "type": "string",
- "value": "Bearer YOUR_LLAMACLOUD_API_KEY"
- }
- }
- },
- "body": {
- "type": "object",
- "properties": {
- "query": {
- "type": "string",
- "value": "{{query}}"
+ "body": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "value": "{{query}}"
+ }
+ }
}
- }
- }
- }'
- ```
+ }'
+ ```
+
+
Replace `YOUR_PIPELINE_ID` with your LlamaCloud pipeline ID and `YOUR_LLAMACLOUD_API_KEY` with your API key. Save the tool ID from the response for the next step.
- Create an assistant using the [Assistant API](/api-reference/assistants/create) with the RAG tool attached.
-
- You can also create this assistant in the [Vapi Dashboard](https://dashboard.vapi.ai/).
-
- ```bash
- curl -X POST https://api.vapi.ai/assistant \
- -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
- -H "Content-Type: application/json" \
- -d '{
- "name": "Docs agent",
- "model": {
- "provider": "anthropic",
- "model": "claude-3-5-sonnet-20241022",
- "maxTokens": 400,
- "messages": [
- {
- "role": "system",
- "content": "You are a helpful documentation assistant. Use the docsquery tool to find relevant information. Always be helpful, friendly, and concise. Provide accurate information based on the documentation. When you don'\''t know something, say so clearly. Keep responses conversational for voice interaction."
+ Create an assistant with the RAG tool attached.
+
+
+
+ 1. Navigate to **Assistants** in your [Vapi Dashboard](https://dashboard.vapi.ai/)
+ 2. Click **Create Assistant**
+ 3. Configure the assistant:
+ - **Name**: `Docs agent`
+ - **Model**: Claude Sonnet 4 (Anthropic)
+ - **Voice**: Harry (Vapi)
+ - **First Message**: `Hey I'm Harry, a support agent. How can I help you today? You can ask me questions about Vapi, how to get started or our documentation.`
+ - **System Prompt**: Use a helpful documentation assistant prompt with guidelines for using the docsquery tool
+ 4. Add the `docsquery` tool in the Tools section
+ 5. Configure analysis plan for call monitoring
+ 6. Publish the assistant
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ // Initialize Vapi server SDK
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Define system prompt for documentation assistant
+ const systemPrompt = `You are a helpful documentation assistant. Use the docsquery tool to find relevant information when users ask questions about the documentation.
+
+Guidelines:
+- Always be helpful, friendly, and concise
+- Provide accurate information based on the documentation
+- When you don't know something, say so clearly
+- Keep responses conversational for voice interaction
+- Use the docsquery tool whenever users ask specific questions about features, setup, or implementation
+- Summarize complex information in an easy-to-understand way
+- Ask clarifying questions if the user's request is unclear
+- Provide step-by-step guidance when explaining processes`;
+
+ // Create the documentation assistant
+ const assistant = await vapi.assistants.create({
+ name: "Docs agent",
+ model: {
+ provider: "anthropic",
+ model: "claude-3-5-sonnet-20241022", # Valid Claude model
+ maxTokens: 400,
+ messages: [
+ {
+ role: "system",
+ content: systemPrompt
+ }
+ ],
+ toolIds: [YOUR_TOOL_ID_FROM_STEP_2] // Replace with actual tool ID
+ },
+ // Configure voice settings
+ voice: {
+ provider: "vapi",
+ voice_id: "Harry"
+ },
+ // Configure transcription
+ transcriber: {
+ provider: "deepgram",
+ model: "nova-2",
+ language: "en"
+ },
+ // Set greeting message
+ firstMessage: "Hey I'm Harry, a support agent. How can I help you today? You can ask me questions about Vapi, how to get started or our documentation.",
+ endCallMessage: "Goodbye.",
+ backgroundSound: "off",
+ // Enable call analysis for continuous improvement
+ analysisPlan: {
+ summaryPlan: {
+ enabled: true,
+ prompt: "Summarize this documentation support call, focusing on the user's questions and how well they were answered."
+ },
+ successEvaluationPlan: {
+ enabled: true,
+ prompt: "Evaluate if this documentation support call was successful. Did the user get helpful answers to their questions?",
+ rubric: "NumericScale"
+ }
+ }
+ });
+
+ console.log(`Assistant created with ID: ${assistant.id}`);
+ ```
+
+
+ ```python
+ from vapi import Vapi
+
+ # Initialize Vapi server SDK
+ client = Vapi(token="YOUR_VAPI_API_KEY")
+
+ # Define system prompt for documentation assistant
+ system_prompt = """You are a helpful documentation assistant. Use the docsquery tool to find relevant information when users ask questions about the documentation.
+
+Guidelines:
+- Always be helpful, friendly, and concise
+- Provide accurate information based on the documentation
+- When you don't know something, say so clearly
+- Keep responses conversational for voice interaction
+- Use the docsquery tool whenever users ask specific questions about features, setup, or implementation
+- Summarize complex information in an easy-to-understand way
+- Ask clarifying questions if the user's request is unclear
+- Provide step-by-step guidance when explaining processes"""
+
+ # Create the documentation assistant
+ assistant = client.assistants.create(
+ name="Docs agent",
+ model={
+ "provider": "anthropic",
+ "model": "claude-3-5-sonnet-20241022", # Valid Claude model
+ "maxTokens": 400,
+ "messages": [
+ {
+ "role": "system",
+ "content": system_prompt
+ }
+ ],
+ "toolIds": [YOUR_TOOL_ID_FROM_STEP_2] # Replace with actual tool ID
+ },
+ // Configure voice settings
+ voice={
+ "provider": "vapi",
+ "voice_id": "Harry"
+ },
+ // Configure transcription
+ transcriber={
+ "provider": "deepgram",
+ "model": "nova-2",
+ "language": "en"
+ },
+ // Set greeting message
+ first_message="Hey I'm Harry, a support agent. How can I help you today? You can ask me questions about Vapi, how to get started or our documentation.",
+ end_call_message="Goodbye.",
+ background_sound="off",
+ // Enable call analysis for continuous improvement
+ analysis_plan={
+ "summaryPlan": {
+ "enabled": True,
+ "prompt": "Summarize this documentation support call, focusing on the user's questions and how well they were answered."
+ },
+ "successEvaluationPlan": {
+ "enabled": True,
+ "prompt": "Evaluate if this documentation support call was successful. Did the user get helpful answers to their questions?",
+ "rubric": "NumericScale"
+ }
+ }
+ )
+
+ print(f"Assistant created with ID: {assistant.id}")
+ ```
+
+
+ ```bash
+ curl -X POST https://api.vapi.ai/tool \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "type": "apiRequest",
+ "name": "docsquery",
+ "function": {
+ "name": "docsquery",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "description": "The search query to find relevant documentation"
+ }
+ },
+ "required": ["query"]
+ }
+ },
+ "url": "https://api.cloud.llamaindex.ai/api/v1/pipelines/YOUR_PIPELINE_ID/retrieve",
+ "method": "POST",
+ "headers": {
+ "type": "object",
+ "properties": {
+ "Content-Type": {
+ "type": "string",
+ "value": "application/json"
+ },
+ "Authorization": {
+ "type": "string",
+ "value": "Bearer YOUR_LLAMACLOUD_API_KEY"
+ }
+ }
+ },
+ "body": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "value": "{{query}}"
+ }
+ }
}
- ],
- "toolIds": ["YOUR_TOOL_ID_FROM_STEP_2"]
- },
- "voice": {
- "provider": "vapi",
- "voiceId": "Harry"
- },
- "transcriber": {
- "provider": "deepgram",
- "model": "nova-3",
- "language": "en"
- },
- "firstMessage": "Hey I'\''m Harry, a support agent. How can I help you today? You can ask me questions about Vapi, how to get started or our documentation.",
- "endCallMessage": "Goodbye.",
- "backgroundSound": "off",
- "analysisPlan": {
- "summaryPlan": {
- "enabled": true,
- "prompt": "Summarize this documentation support call, focusing on the user'\''s questions and how well they were answered."
- },
- "successEvaluationPlan": {
- "enabled": true,
- "prompt": "Evaluate if this documentation support call was successful. Did the user get helpful answers to their questions?",
- "rubric": "NumericScale"
- }
- }
- }'
- ```
-
- Replace `YOUR_TOOL_ID_FROM_STEP_2` with the tool ID from step 2. Save the assistant ID from the response for the next step.
+ }'
+ ```
+
+
-
- See our [complete documentation agent prompt](/docs-agent-prompt.txt) that includes detailed personality, style guidelines, and interaction patterns.
-
+ Replace `YOUR_PIPELINE_ID` with your LlamaCloud pipeline ID and `YOUR_LLAMACLOUD_API_KEY` with your API key. Save the tool ID from the response for the next step.
-
- Use the Vapi Web SDK to create a voice widget.
-
- ```bash
- npm install @vapi-ai/web
- ```
-
- Replace `YOUR_PUBLIC_API_KEY` and `YOUR_ASSISTANT_ID` with your actual values:
-
- ```typescript
- import { useState, useEffect } from 'react';
- import Vapi from '@vapi-ai/web';
-
- export default function VoiceWidget() {
- const [vapi, setVapi] = useState(null);
- const [isConnected, setIsConnected] = useState(false);
- const [transcript, setTranscript] = useState([]);
+
+ Customize your assistant's behavior and responses after creation.
+
+
+
+ 1. Navigate to your assistant in the [Vapi Dashboard](https://dashboard.vapi.ai/)
+ 2. Edit any properties like system prompt, first message, or voice settings
+ 3. Changes apply immediately - no republishing needed
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Update the assistant's first message
+ const updatedAssistant = await vapi.assistants.update("YOUR_ASSISTANT_ID", {
+ firstMessage: "Hello! I'm your documentation assistant. What would you like to know about our platform?",
+ // Update system prompt for better responses
+ model: {
+ provider: "anthropic",
+ model: "claude-3-5-sonnet-20241022",
+ messages: [
+ {
+ role: "system",
+ content: "Enhanced system prompt with more specific guidelines for documentation assistance"
+ }
+ ]
+ }
+ });
- useEffect(() => {
- const vapiInstance = new Vapi('YOUR_PUBLIC_API_KEY');
- setVapi(vapiInstance);
+ console.log("Assistant updated successfully");
+ ```
+
+
+ ```python
+ import requests
+
+ # Update assistant properties
+ url = f"https://api.vapi.ai/assistant/{YOUR_ASSISTANT_ID}"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ # Update first message and system prompt
+ data = {
+ "firstMessage": "Hello! I'\''m your documentation assistant. What would you like to know about our platform?",
+ "model": {
+ "provider": "anthropic",
+ "model": "claude-3-5-sonnet-20241022",
+ "messages": [
+ {
+ "role": "system",
+ "content": "Enhanced system prompt with more specific guidelines for documentation assistance"
+ }
+ ]
+ }
+ }
+
+ response = requests.patch(url, headers=headers, json=data)
+ print("Assistant updated successfully")
+ ```
+
+
+ ```bash
+ curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "firstMessage": "Hello! I'\''m your documentation assistant. What would you like to know about our platform?",
+ "model": {
+ "provider": "anthropic",
+ "model": "claude-3-5-sonnet-20241022",
+ "messages": [
+ {
+ "role": "system",
+ "content": "Enhanced system prompt with more specific guidelines for documentation assistance"
+ }
+ ]
+ }
+ }'
+ ```
+
+
+
+
+ SDK changes apply immediately. Unlike Dashboard publishing, programmatic updates take effect right away.
+
+
- vapiInstance.on('call-start', () => setIsConnected(true));
- vapiInstance.on('call-end', () => setIsConnected(false));
- vapiInstance.on('message', (msg) => {
- if (msg.type === 'transcript') {
- setTranscript(prev => [...prev, { role: msg.role, text: msg.transcript }]);
- }
+
+ Create test scenarios to validate your documentation assistant's responses.
+
+
+
+ 1. Navigate to **Test** > **Voice Test Suites** in your dashboard
+ 2. Click **Create Test Suite**
+ 3. Add test scenarios with expected behaviors
+ 4. Run tests to validate assistant performance
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Create test suite for documentation assistant
+ const testSuite = await vapi.testSuites.create({
+ name: "Documentation Assistant Tests",
+ assistantId: "YOUR_ASSISTANT_ID",
+ testCases: [
+ {
+ name: "Basic greeting test",
+ scenario: "User says hello",
+ expectedBehavior: "Assistant responds with greeting and asks how to help"
+ },
+ {
+ name: "Documentation query test",
+ scenario: "User asks about API endpoints",
+ expectedBehavior: "Assistant uses docsquery tool and provides relevant information"
+ },
+ {
+ name: "Unknown topic test",
+ scenario: "User asks about unrelated topic",
+ expectedBehavior: "Assistant politely redirects to documentation topics"
+ }
+ ]
});
- return () => vapiInstance?.stop();
- }, []);
-
- const startCall = () => vapi?.start('YOUR_ASSISTANT_ID');
- const endCall = () => vapi?.stop();
-
- return (
-
- {!isConnected ? (
-
- ) : (
-
-
- {transcript.map((msg, i) => (
-
-
- {msg.text}
-
+ console.log(`Test suite created with ID: ${testSuite.id}`);
+ console.log("Next: Go to Dashboard to run the test suite");
+ ```
+
+
+ ```python
+ import requests
+
+ # Create test suite for documentation assistant
+ url = "https://api.vapi.ai/test-suite"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "name": "Documentation Assistant Tests",
+ "assistantId": "YOUR_ASSISTANT_ID",
+ "testCases": [
+ {
+ "name": "Basic greeting test",
+ "scenario": "User says hello",
+ "expectedBehavior": "Assistant responds with greeting and asks how to help"
+ },
+ {
+ "name": "Documentation query test",
+ "scenario": "User asks about API endpoints",
+ "expectedBehavior": "Assistant uses docsquery tool and provides relevant information"
+ },
+ {
+ "name": "Unknown topic test",
+ "scenario": "User asks about unrelated topic",
+ "expectedBehavior": "Assistant politely redirects to documentation topics"
+ }
+ ]
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ test_suite = response.json()
+ print(f"Test suite created with ID: {test_suite['id']}")
+ print("Next: Go to Dashboard to run the test suite")
+ ```
+
+
+ ```bash
+ curl -X POST https://api.vapi.ai/test-suite \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Documentation Assistant Tests",
+ "assistantId": "YOUR_ASSISTANT_ID",
+ "testCases": [
+ {
+ "name": "Basic greeting test",
+ "scenario": "User says hello",
+ "expectedBehavior": "Assistant responds with greeting and asks how to help"
+ },
+ {
+ "name": "Documentation query test",
+ "scenario": "User asks about API endpoints",
+ "expectedBehavior": "Assistant uses docsquery tool and provides relevant information"
+ },
+ {
+ "name": "Unknown topic test",
+ "scenario": "User asks about unrelated topic",
+ "expectedBehavior": "Assistant politely redirects to documentation topics"
+ }
+ ]
+ }'
+ ```
+
+
+
+
+ Test suites can only be executed through the Dashboard. Navigate to **Test** > **Voice Test Suites** to run your created tests.
+
+
+
+
+ Use the Vapi Web SDK to create a voice widget for your documentation assistant.
+
+
+
+
+ ```bash title="npm"
+ npm install @vapi-ai/web
+ ```
+
+ ```bash title="yarn"
+ yarn add @vapi-ai/web
+ ```
+
+ ```bash title="pnpm"
+ pnpm add @vapi-ai/web
+ ```
+
+ ```bash title="bun"
+ bun add @vapi-ai/web
+ ```
+
+
+ Replace `YOUR_PUBLIC_API_KEY` and `YOUR_ASSISTANT_ID` with your actual values:
+
+ ```typescript
+ import { useState, useEffect } from 'react';
+ import Vapi from '@vapi-ai/web';
+
+ export default function VoiceWidget() {
+ const [vapi, setVapi] = useState(null);
+ const [isConnected, setIsConnected] = useState(false);
+ const [transcript, setTranscript] = useState([]);
+
+ useEffect(() => {
+ // Initialize Vapi Web SDK for client-side voice interactions
+ const vapiInstance = new Vapi('YOUR_PUBLIC_API_KEY');
+ setVapi(vapiInstance);
+
+ // Handle call lifecycle events
+ vapiInstance.on('call-start', () => setIsConnected(true));
+ vapiInstance.on('call-end', () => setIsConnected(false));
+
+ // Handle real-time conversation messages
+ vapiInstance.on('message', (msg) => {
+ if (msg.type === 'transcript') {
+ setTranscript(prev => [...prev, { role: msg.role, text: msg.transcript }]);
+ }
+ });
+
+ // Cleanup on component unmount
+ return () => vapiInstance?.stop();
+ }, []);
+
+ // Start voice conversation with documentation assistant
+ const startCall = () => vapi?.start('YOUR_ASSISTANT_ID');
+ const endCall = () => vapi?.stop();
+
+ return (
+
+ {!isConnected ? (
+
+ ) : (
+
+
+ {transcript.map((msg, i) => (
+
+
+ {msg.text}
+
+
+ ))}
- ))}
-
-
+
+
+ )}
- )}
-
- );
- }
- ```
+ );
+ }
+ ```
+
+
For a complete implementation with waveform visualization, real-time transcripts, and responsive design, check out our [voice widget component](https://github.com/VapiAI/docs/blob/7879817ad2789d5929842cecff4ef3f4ec82acae/fern/widget/voice-widget.tsx) on GitHub.
@@ -221,20 +726,106 @@ You'll learn to:
Vapi automatically analyzes every call. The assistant above includes an [`analysisPlan`](/api-reference/assistants/create#request.body.analysisPlan) with summary and success evaluation configured.
- Configure additional analysis options in your assistant:
- - **Summary plan**: Custom prompts for call summaries
- - **Structured data plan**: Extract specific information using JSON schemas
- - **Success evaluation plan**: Score calls with custom rubrics
- - **Structured data multi plan**: Multiple extraction schemas
-
- Retrieve analysis results using the [Get Call API](/api-reference/calls/get#response.body.analysis):
-
- ```bash
- curl https://api.vapi.ai/call/{CALL_ID} \
- -H "Authorization: Bearer YOUR_VAPI_API_KEY"
- ```
-
- The response includes `call.analysis` with your configured analysis results. Learn more about [call analysis configuration](/assistants/call-analysis).
+
+
+ 1. Navigate to **Logs** > **Calls** in your dashboard
+ 2. Click on any completed call to view analysis
+ 3. Review summary and success evaluation
+ 4. Use insights to improve your assistant's prompts and responses
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Retrieve call analysis for continuous improvement
+ async function getCallAnalysis(callId: string) {
+ try {
+ const call = await vapi.calls.get(callId);
+
+ if (call.analysis) {
+ console.log("Call Summary:", call.analysis.summary);
+ console.log("Success Score:", call.analysis.successEvaluation);
+
+ // Use analysis data to improve prompts
+ return {
+ summary: call.analysis.summary,
+ successScore: call.analysis.successEvaluation,
+ improvements: extractImprovements(call.analysis)
+ };
+ }
+ } catch (error) {
+ console.error("Error fetching call analysis:", error);
+ }
+
+ return call;
+ }
+
+ // Extract improvement suggestions from analysis
+ function extractImprovements(analysis: any) {
+ // Analyze patterns to suggest prompt improvements
+ return {
+ promptSuggestions: "Based on call analysis...",
+ commonQueries: "Users frequently ask about...",
+ successFactors: "Successful calls typically..."
+ };
+ }
+
+ // Get analysis for a specific call
+ const analysis = await getCallAnalysis("CALL_ID");
+ ```
+
+
+ ```python
+ import requests
+
+ def get_call_analysis(call_id):
+ """Retrieve and analyze call data for continuous improvement"""
+ url = f"https://api.vapi.ai/call/{call_id}"
+ headers = {"Authorization": f"Bearer {YOUR_VAPI_API_KEY}"}
+
+ try:
+ response = requests.get(url, headers=headers)
+ call_data = response.json()
+
+ if 'analysis' in call_data:
+ print("Call Summary:", call_data['analysis']['summary'])
+ print("Success Score:", call_data['analysis']['successEvaluation'])
+
+ # Extract insights for improvement
+ return {
+ 'summary': call_data['analysis']['summary'],
+ 'success_score': call_data['analysis']['successEvaluation'],
+ 'improvements': extract_improvements(call_data['analysis'])
+ }
+
+ except Exception as error:
+ print(f"Error fetching call analysis: {error}")
+
+ return call_data
+
+ def extract_improvements(analysis):
+ """Extract improvement suggestions from analysis data"""
+ return {
+ 'prompt_suggestions': "Based on call analysis...",
+ 'common_queries': "Users frequently ask about...",
+ 'success_factors': "Successful calls typically..."
+ }
+
+ # Get analysis for a specific call
+ analysis = get_call_analysis("CALL_ID")
+ ```
+
+
+ Retrieve analysis results using the Get Call API:
+
+ ```bash
+ curl https://api.vapi.ai/call/CALL_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY"
+ ```
+
+
**Iterative improvements:**
- Review analysis summaries to identify common user questions
diff --git a/fern/examples/inbound-support.mdx b/fern/examples/inbound-support.mdx
index df3a751e..d8628ade 100644
--- a/fern/examples/inbound-support.mdx
+++ b/fern/examples/inbound-support.mdx
@@ -26,7 +26,6 @@ Build a banking support agent with function tools, CSV knowledge bases, and voic
We will be creating a customer support agent for VapiBank, a bank that wants to provide 24/7 support to consumers.
-
---
## 1. Create a Knowledge Base
@@ -42,36 +41,193 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
-
- In your Vapi dashboard, click `Files` in the left sidebar.
-
-
- - Click `Choose file`. Upload both `accounts.csv` and `transactions.csv` files.
- - Note the file IDs. We'll need them later to create tools.
+
+
+
+ 1. Navigate to **Files** in your [Vapi Dashboard](https://dashboard.vapi.ai/)
+ 2. Click **Choose file** and upload both `accounts.csv` and `transactions.csv`
+ 3. Note the file IDs for use in creating tools
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+ import fs from 'fs';
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ async function uploadFile(filePath: string) {
+ try {
+ const file = await vapi.files.create({
+ file: fs.createReadStream(filePath)
+ });
+
+ console.log(`File ${filePath} uploaded with ID: ${file.id}`);
+ return file;
+ } catch (error) {
+ console.error(`Error uploading file ${filePath}:`, error);
+ throw error;
+ }
+ }
+
+ // Upload both files
+ const accountsFile = await uploadFile("accounts.csv");
+ const transactionsFile = await uploadFile("transactions.csv");
+
+ console.log(`Accounts file ID: ${accountsFile.id}`);
+ console.log(`Transactions file ID: ${transactionsFile.id}`);
+ ```
+
+
+ ```python
+ import requests
+
+ def upload_file(file_path):
+ url = "https://api.vapi.ai/file"
+ headers = {"Authorization": f"Bearer {YOUR_VAPI_API_KEY}"}
+
+ with open(file_path, 'rb') as file:
+ files = {'file': file}
+ response = requests.post(url, headers=headers, files=files)
+ return response.json()
+
+ # Upload both files
+ accounts_file = upload_file("accounts.csv")
+ transactions_file = upload_file("transactions.csv")
+
+ print(f"Accounts file ID: {accounts_file['id']}")
+ print(f"Transactions file ID: {transactions_file['id']}")
+ ```
+
+
+ ```bash
+ # Upload accounts.csv
+ curl -X POST https://api.vapi.ai/file \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -F "file=@accounts.csv"
+
+ # Upload transactions.csv
+ curl -X POST https://api.vapi.ai/file \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -F "file=@transactions.csv"
+ ```
+
+
-
-
---
## 2. Create an Assistant
-
-
- Go to [dashboard.vapi.ai](https://dashboard.vapi.ai) and log in to your account.
-
-
- Click `Assistants` in the left sidebar.
-
-
- - Click `Create Assistant`.
- - Select `Blank Template` as your starting point.
- - Change assistant name to `Tom`.
-
-
+
+
+
+
+ Go to [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Assistants` in the left sidebar.
+
+
+ - Click `Create Assistant`.
+ - Select `Blank Template` as your starting point.
+ - Change assistant name to `Tom`.
+
+
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ const systemPrompt = `You are Tom, a friendly VapiBank customer support assistant. Help customers check balances and view recent transactions. Always verify identity with phone number first.`;
+
+ const assistant = await vapi.assistants.create({
+ name: "Tom",
+ firstMessage: "Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?",
+ model: {
+ provider: "openai",
+ model: "gpt-4o",
+ messages: [
+ {
+ role: "system",
+ content: systemPrompt
+ }
+ ]
+ },
+ voice: {
+ provider: "11labs",
+ voice_id: "burt"
+ }
+ });
+
+ console.log(`Assistant created with ID: ${assistant.id}`);
+ ```
+
+
+ ```python
+ import requests
+
+ url = "https://api.vapi.ai/assistant"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
-
+ system_prompt = "You are Tom, a friendly VapiBank customer support assistant. Help customers check balances and view recent transactions. Always verify identity with phone number first."
+
+ data = {
+ "name": "Tom",
+ "firstMessage": "Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?",
+ "model": {
+ "provider": "openai",
+ "model": "gpt-4o",
+ "messages": [
+ {
+ "role": "system",
+ "content": system_prompt
+ }
+ ]
+ },
+ "voice": {
+ "provider": "11labs",
+ "voice_id": "burt"
+ }
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ assistant = response.json()
+ print(f"Assistant created with ID: {assistant['id']}")
+ ```
+
+
+ ```bash
+ curl -X POST https://api.vapi.ai/assistant \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Tom",
+ "firstMessage": "Hello, you'\''ve reached VapiBank customer support! My name is Tom, how may I assist you today?",
+ "model": {
+ "provider": "openai",
+ "model": "gpt-4o",
+ "messages": [
+ {
+ "role": "system",
+ "content": "You are Tom, a friendly VapiBank customer support assistant. Help customers check balances and view recent transactions. Always verify identity with phone number first."
+ }
+ ]
+ },
+ "voice": {
+ "provider": "11labs",
+ "voice_id": "burt"
+ }
+ }'
+ ```
+
+
---
@@ -79,16 +235,62 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
- Update `First Message` to:
+
+
+ Update `First Message` to:
- ```txt title="First Message" wordWrap
- Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?
- ```
+ ```txt title="First Message" wordWrap
+ Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?
+ ```
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ const updatedAssistant = await vapi.assistants.update("YOUR_ASSISTANT_ID", {
+ firstMessage: "Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?"
+ });
+
+ console.log("First message updated successfully");
+ ```
+
+
+ ```python
+ import requests
+
+ url = f"https://api.vapi.ai/assistant/{YOUR_ASSISTANT_ID}"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "firstMessage": "Hello, you've reached VapiBank customer support! My name is Tom, how may I assist you today?"
+ }
+
+ response = requests.patch(url, headers=headers, json=data)
+ assistant = response.json()
+ print("First message updated successfully")
+ ```
+
+
+ ```bash
+ curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "firstMessage": "Hello, you'\''ve reached VapiBank customer support! My name is Tom, how may I assist you today?"
+ }'
+ ```
+
+
- Update `System Prompt` to:
+ First, create this system prompt:
-```txt title="System Prompt" maxLines=10
+ ```txt title="System Prompt" maxLines=10
# VapiBank - Phone Support Agent Prompt
## Identity & Purpose
@@ -139,166 +341,802 @@ You have access to CSV files with account and transaction data:
* **Technical issues** → apologize and offer callback or transfer
(Remember: only share account information with verified account holders.)
-```
+ ```
+
+ Then update your assistant:
+
+
+
+ Copy the system prompt above and paste it into the `System Prompt` field in your assistant configuration.
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Use the system prompt from above
+ const systemPrompt = `# VapiBank - Phone Support Agent Prompt...`;
+
+ const updatedAssistant = await vapi.assistants.update("YOUR_ASSISTANT_ID", {
+ model: {
+ messages: [
+ {
+ role: "system",
+ content: systemPrompt
+ }
+ ]
+ }
+ });
+
+ console.log("System prompt updated successfully");
+ ```
+
+
+ ```python
+ import requests
+
+ url = f"https://api.vapi.ai/assistant/{YOUR_ASSISTANT_ID}"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ # Use the system prompt from above
+ system_prompt = """# VapiBank - Phone Support Agent Prompt..."""
+
+ data = {
+ "model": {
+ "messages": [
+ {
+ "role": "system",
+ "content": system_prompt
+ }
+ ]
+ }
+ }
+
+ response = requests.patch(url, headers=headers, json=data)
+ assistant = response.json()
+ print("System prompt updated successfully")
+ ```
+
+
+ ```bash
+ curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": {
+ "messages": [
+ {
+ "role": "system",
+ "content": "# VapiBank - Phone Support Agent Prompt\n\n## Identity & Purpose\nYou are **Tom**, VapiBank'\''s friendly, 24x7 phone-support voice assistant. Do not introduce yourself after the first message.\nYou help customers with account inquiries:\n\n1. **Check balance**\n2. **View recent transactions**\n\n## Data Sources\nYou have access to CSV files with account and transaction data:\n- **accounts.csv**: account_id, name, phone_last4, balance, card_status, email\n- **transactions.csv**: transaction history for all accounts\n\n## Available Tools\n1. **lookup_account** → verify customer identity using phone number\n2. **get_balance** → returns current balance for verified account\n3. **get_recent_transactions** → returns recent transaction history\n\n## Conversation Flow\n1. **Greeting**\n > \"Hello, you'\''ve reached VapiBank customer support! My name is Tom, how may I assist you today?\"\n\n2. **Account Verification**\n * After caller provides phone digits → call **lookup_account**\n * Read back the returned name for confirmation\n * If no match after 2 tries → apologize and offer to transfer\n\n3. **Handle Request**\n Ask: \"How can I help you today—check your balance or review recent transactions?\"\n\n **Balance** → call **get_balance** → read current balance\n **Transactions** → call **get_recent_transactions** → summarize recent activity\n\n4. **Close**\n > \"Is there anything else I can help you with today?\"\n If no → thank the caller and end the call\n\n## Style & Tone\n* Warm, concise, ≤ 30 words per reply\n* One question at a time\n* Repeat important numbers slowly and clearly\n* Professional but friendly tone\n\n## Edge Cases\n* **No account match** → offer to transfer to human agent\n* **Multiple requests** → handle each request, then ask if anything else needed\n* **Technical issues** → apologize and offer callback or transfer\n\n(Remember: only share account information with verified account holders.)"
+ }
+ ]
+ }
+ }'
+ ```
+
+
- Configure the LLM settings to your liking.
- - Select any provider and model you like (you will see cost and latency estimates).
- - You can configure the files available to the LLM as knowledge base.
- - You can specify the temperature and max tokens of the LLM.
+
+
+ Configure the LLM settings to your liking.
+ - Select any provider and model you like (you will see cost and latency estimates).
+ - You can configure the files available to the LLM as knowledge base.
+ - You can specify the temperature and max tokens of the LLM.
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ async function updateAssistantLLMSettings(assistantId: string) {
+ const updatedAssistant = await vapi.assistants.update(assistantId, {
+ model: {
+ provider: "openai",
+ model: "gpt-4o",
+ temperature: 0.7,
+ maxTokens: 150,
+ messages: [
+ {
+ role: "system",
+ content: "You are Tom, VapiBank's customer support assistant..."
+ }
+ ]
+ }
+ });
+
+ return updatedAssistant;
+ }
+
+ // Update LLM settings
+ const assistant = await updateAssistantLLMSettings('YOUR_ASSISTANT_ID');
+ console.log('Assistant LLM settings updated');
+ ```
+
+
+ ```python
+ import requests
+
+ def update_assistant_llm_settings(assistant_id):
+ url = f"https://api.vapi.ai/assistant/{assistant_id}"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "model": {
+ "provider": "openai",
+ "model": "gpt-4o",
+ "temperature": 0.7,
+ "maxTokens": 150,
+ "messages": [
+ {
+ "role": "system",
+ "content": "You are Tom, VapiBank's customer support assistant..."
+ }
+ ]
+ }
+ }
+
+ response = requests.patch(url, headers=headers, json=data)
+ return response.json()
+
+ # Update LLM settings
+ assistant = update_assistant_llm_settings('YOUR_ASSISTANT_ID')
+ print("Assistant LLM settings updated")
+ ```
+
+
+ ```bash
+ curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": {
+ "provider": "openai",
+ "model": "gpt-4o",
+ "temperature": 0.7,
+ "maxTokens": 150,
+ "messages": [
+ {
+ "role": "system",
+ "content": "You are Tom, VapiBank'\''s customer support assistant..."
+ }
+ ]
+ }
+ }'
+ ```
+
+
- Click `Publish` to save your changes.
+ **Dashboard only:** Click `Publish` to save your changes.
+
+
+ When using the Server SDKs, changes are applied immediately when you make API calls. There's no separate "publish" step required.
+
- Click `Talk to Assistant` to test it out.
+
+
+ Click `Talk to Assistant` to test it out.
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ async function testAssistantWithCall(assistantId: string) {
+ const call = await vapi.calls.create({
+ assistantId: assistantId,
+ customer: {
+ number: "+1234567890" // Your test number
+ }
+ });
+
+ console.log(`Test call created: ${call.id}`);
+ return call;
+ }
+
+ // Create a test call
+ const testCall = await testAssistantWithCall('YOUR_ASSISTANT_ID');
+ ```
+
+
+ ```python
+ import requests
+
+ def test_assistant_with_call(assistant_id):
+ url = "https://api.vapi.ai/call"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "assistantId": assistant_id,
+ "customer": {
+ "number": "+1234567890" # Your test number
+ }
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ call = response.json()
+ print(f"Test call created: {call['id']}")
+ return call
+
+ # Create a test call
+ test_call = test_assistant_with_call('YOUR_ASSISTANT_ID')
+ ```
+
+
+ ```bash
+ # Create a test call
+ curl -X POST https://api.vapi.ai/call \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "assistantId": "YOUR_ASSISTANT_ID",
+ "customer": {
+ "number": "+1234567890"
+ }
+ }'
+ ```
+
+
-
-
---
## 4. Add Tools to an Assistant
-
-
- Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Tools` in the left sidebar.
-
-
- - Click `Create Tool`.
- - Select `Function` as your tool type.
- - Change tool name to `get_balance`.
- - Add the following function description:
-
- ```txt title="Function Description" wordWrap
- Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number.
- ```
- - Scroll down to the `Knowledge Bases` section and add the following knowledge base:
-
- - Name: `accounts`
- Description: `Use this to retrieve account information`
- File IDs: ``
-
-
- - Click `Create Tool`.
- - Select `Function` as your tool type.
- - Change tool name to `get_recent_transactions`.
- - Add the following function description:
-
- ```txt title="Function Description" wordWrap
- Return the three most recent transactions for a specific account.
- ```
- - Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
-
- - Name: `accounts`
- Description: `Use this to retrieve account information`
- File IDs: ``
-
- - Name: `transactions`
- Description: `Use this to retrieve transactions`
- File IDs: ``
-
-
- - Click `Create Tool`.
- - Select `Function` as your tool type.
- - Change tool name to `lookup_account`.
- - Add the following function description:
-
- ```txt title="Function Description" wordWrap
- Look up account based on provided name and last 4 digits of the phone number.
- ```
- - Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
-
- - Name: `accounts`
- Description: `Use this to retrieve account information`
- File IDs: ``
-
-
- - Click `Assistants` in the left sidebar.
- - Make sure `Tom` is selected in the list of assistants.
- - Scroll down until you see `Tools` accordion. Expand it.
- - In the expanded accordion, add `get_balance` and `get_recent_transactions` tools.
- - Click `Publish` to save your changes.
-
-
- - While we're here, let's give our assistant ability to hang up.
- - Expand the `Predefined Functions` accordion.
- - Toggle `Enable End Call Function` to `On`.
- - Here you can add a forwarding phone number to transfer the call to (in case assistant is unable to resolve the issue).
- - Click `Publish` to save your changes.
-
-
+
+
+
+
+ Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Tools` in the left sidebar.
+
+
+ - Click `Create Tool`.
+ - Select `Function` as your tool type.
+ - Change tool name to `get_balance`.
+ - Add the following function description:
+
+ ```txt title="Function Description" wordWrap
+ Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number.
+ ```
+ - Scroll down to the `Knowledge Bases` section and add the following knowledge base:
+
+ - Name: `accounts`
+ Description: `Use this to retrieve account information`
+ File IDs: ``
+
+
+ - Click `Create Tool`.
+ - Select `Function` as your tool type.
+ - Change tool name to `get_recent_transactions`.
+ - Add the following function description:
+
+ ```txt title="Function Description" wordWrap
+ Return the three most recent transactions for a specific account.
+ ```
+ - Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
+
+ - Name: `accounts`
+ Description: `Use this to retrieve account information`
+ File IDs: ``
+
+ - Name: `transactions`
+ Description: `Use this to retrieve transactions`
+ File IDs: ``
+
+
+ - Click `Create Tool`.
+ - Select `Function` as your tool type.
+ - Change tool name to `lookup_account`.
+ - Add the following function description:
+
+ ```txt title="Function Description" wordWrap
+ Look up account based on provided name and last 4 digits of the phone number.
+ ```
+ - Scroll down to the `Knowledge Bases` section and add the following knowledge bases:
+
+ - Name: `accounts`
+ Description: `Use this to retrieve account information`
+ File IDs: ``
+
+
+ - Click `Assistants` in the left sidebar.
+ - Make sure `Tom` is selected in the list of assistants.
+ - Scroll down until you see `Tools` accordion. Expand it.
+ - In the expanded accordion, add `get_balance` and `get_recent_transactions` tools.
+ - Click `Publish` to save your changes.
+
+
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ // Step 1: Create the account lookup tool
+ const lookupAccountTool = await vapi.tools.create({
+ type: "function",
+ function: {
+ name: "lookup_account",
+ description: "Look up account based on provided name and last 4 digits of the phone number."
+ },
+ knowledgeBases: [
+ {
+ name: "accounts",
+ description: "Use this to retrieve account information",
+ fileIds: ["YOUR_ACCOUNTS_FILE_ID"]
+ }
+ ]
+ });
+
+ console.log(`Created lookup_account tool: ${lookupAccountTool.id}`);
+
+ // Step 2: Create the balance retrieval tool
+ const getBalanceTool = await vapi.tools.create({
+ type: "function",
+ function: {
+ name: "get_balance",
+ description: "Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number."
+ },
+ knowledgeBases: [
+ {
+ name: "accounts",
+ description: "Use this to retrieve account information",
+ fileIds: ["YOUR_ACCOUNTS_FILE_ID"]
+ }
+ ]
+ });
+
+ console.log(`Created get_balance tool: ${getBalanceTool.id}`);
+
+ // Step 3: Create the transactions retrieval tool
+ const getTransactionsTool = await vapi.tools.create({
+ type: "function",
+ function: {
+ name: "get_recent_transactions",
+ description: "Return the three most recent transactions for a specific account."
+ },
+ knowledgeBases: [
+ {
+ name: "accounts",
+ description: "Use this to retrieve account information",
+ fileIds: ["YOUR_ACCOUNTS_FILE_ID"]
+ },
+ {
+ name: "transactions",
+ description: "Use this to retrieve transactions",
+ fileIds: ["YOUR_TRANSACTIONS_FILE_ID"]
+ }
+ ]
+ });
+
+ console.log(`Created get_recent_transactions tool: ${getTransactionsTool.id}`);
+
+ // Step 4: Add all tools to the assistant
+ const updatedAssistant = await vapi.assistants.update("YOUR_ASSISTANT_ID", {
+ model: {
+ toolIds: [
+ lookupAccountTool.id,
+ getBalanceTool.id,
+ getTransactionsTool.id
+ ]
+ }
+ });
+
+ console.log("All tools added to assistant successfully!");
+ ```
+
+
+ ```python
+ import requests
+
+ # Helper function to create tools
+ def create_tool(name, description, knowledge_bases):
+ url = "https://api.vapi.ai/tool"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "type": "function",
+ "function": {
+ "name": name,
+ "description": description
+ },
+ "knowledgeBases": knowledge_bases
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ return response.json()
+
+ # Step 1: Create the account lookup tool
+ lookup_account_tool = create_tool(
+ "lookup_account",
+ "Look up account based on provided name and last 4 digits of the phone number.",
+ [{"name": "accounts", "description": "Use this to retrieve account information", "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]}]
+ )
+ print(f"Created lookup_account tool: {lookup_account_tool['id']}")
+
+ # Step 2: Create the balance retrieval tool
+ get_balance_tool = create_tool(
+ "get_balance",
+ "Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number.",
+ [{"name": "accounts", "description": "Use this to retrieve account information", "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]}]
+ )
+ print(f"Created get_balance tool: {get_balance_tool['id']}")
+
+ # Step 3: Create the transactions retrieval tool
+ get_transactions_tool = create_tool(
+ "get_recent_transactions",
+ "Return the three most recent transactions for a specific account.",
+ [
+ {"name": "accounts", "description": "Use this to retrieve account information", "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]},
+ {"name": "transactions", "description": "Use this to retrieve transactions", "fileIds": ["YOUR_TRANSACTIONS_FILE_ID"]}
+ ]
+ )
+ print(f"Created get_recent_transactions tool: {get_transactions_tool['id']}")
+
+ # Step 4: Add all tools to the assistant
+ def update_assistant_with_tools(assistant_id, tool_ids):
+ url = f"https://api.vapi.ai/assistant/{assistant_id}"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "model": {
+ "toolIds": tool_ids
+ }
+ }
+
+ response = requests.patch(url, headers=headers, json=data)
+ return response.json()
+
+ tool_ids = [lookup_account_tool['id'], get_balance_tool['id'], get_transactions_tool['id']]
+ updated_assistant = update_assistant_with_tools("YOUR_ASSISTANT_ID", tool_ids)
+ print("All tools added to assistant successfully!")
+ ```
+
+
+ ```bash
+ # Step 1: Create the account lookup tool
+ curl -X POST https://api.vapi.ai/tool \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "type": "function",
+ "function": {
+ "name": "lookup_account",
+ "description": "Look up account based on provided name and last 4 digits of the phone number."
+ },
+ "knowledgeBases": [
+ {
+ "name": "accounts",
+ "description": "Use this to retrieve account information",
+ "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]
+ }
+ ]
+ }'
+
+ # Step 2: Create the balance retrieval tool
+ curl -X POST https://api.vapi.ai/tool \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "type": "function",
+ "function": {
+ "name": "get_balance",
+ "description": "Retrieve the balance for an account based on provided account holder name and last 4 digits of the phone number."
+ },
+ "knowledgeBases": [
+ {
+ "name": "accounts",
+ "description": "Use this to retrieve account information",
+ "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]
+ }
+ ]
+ }'
+
+ # Step 3: Create the transactions retrieval tool
+ curl -X POST https://api.vapi.ai/tool \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "type": "function",
+ "function": {
+ "name": "get_recent_transactions",
+ "description": "Return the three most recent transactions for a specific account."
+ },
+ "knowledgeBases": [
+ {
+ "name": "accounts",
+ "description": "Use this to retrieve account information",
+ "fileIds": ["YOUR_ACCOUNTS_FILE_ID"]
+ },
+ {
+ "name": "transactions",
+ "description": "Use this to retrieve transactions",
+ "fileIds": ["YOUR_TRANSACTIONS_FILE_ID"]
+ }
+ ]
+ }'
-
+ # Step 4: Add all tools to the assistant
+ curl -X PATCH https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": {
+ "toolIds": ["LOOKUP_ACCOUNT_TOOL_ID", "GET_BALANCE_TOOL_ID", "GET_TRANSACTIONS_TOOL_ID"]
+ }
+ }'
+ ```
+
+
---
## 5. Assign a Phone Number to an Assistant
-
-
- Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Phone Numbers` in the left sidebar.
-
-
- - Click `Create Phone Number`.
- - Stick with `Free Vapi Number`.
- - Enter your preferred area code (e.g. `530`).
-
-
- - Set the `Phone Number Name` to `Vapi Support Hotline`.
- - Under `Inbound Settings` find `Assistant` dropdown and select `Tom` from the list.
- - Changes are saved automatically.
-
-
+
+
+
+
+ Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Phone Numbers` in the left sidebar.
+
+
+ - Click `Create Phone Number`.
+ - Stick with `Free Vapi Number`.
+ - Enter your preferred area code (e.g. `530`).
+
+
+ - Set the `Phone Number Name` to `Vapi Support Hotline`.
+ - Under `Inbound Settings` find `Assistant` dropdown and select `Tom` from the list.
+ - Changes are saved automatically.
-
+
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
----
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
-## 6. Create a Test Suite for an Assistant
+ const phoneNumber = await vapi.phoneNumbers.create({
+ name: "Vapi Support Hotline",
+ assistantId: "YOUR_ASSISTANT_ID"
+ });
-
-
- - Open your [dashboard.vapi.ai](https://dashboard.vapi.ai).
- - Below the `Build` section, find and expand the `Test` section.
- - In the expanded section, click `Voice Test Suites`.
-
-
- - On the `Test Suites` page, click `Create Test Suite`.
- - Click on `New Test Suite` and change the name to `Support Hotline Test Suite`.
- - Set the `Assistant` to `Bobby`.
- - Set the `Phone Number` to `Vapi Support Hotline`.
- - Under `Test Cases`, click `Generate Tests`.
- - Use the following prompt to generate the test case:
-
- ```txt title="Test Case Prompt" wordWrap
- Test that the assistant can verify a customer account using phone number, retrieve their current balance, and provide recent transaction history.
+ console.log(`Phone number created: ${phoneNumber.number}`);
```
+
+
+ ```python
+ import requests
- - Accept the generated test case.
-
-
+ def create_phone_number(name, assistant_id):
+ url = "https://api.vapi.ai/phone-number"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "name": name,
+ "assistantId": assistant_id
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ return response.json()
-
+ # Create phone number for Tom
+ phone_number = create_phone_number("Vapi Support Hotline", assistant_id)
+ print(f"Phone number created: {phone_number['number']}")
+ ```
+
+
+ ```bash
+ # Create a phone number
+ curl -X POST https://api.vapi.ai/phone-number \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Vapi Support Hotline",
+ "assistantId": "YOUR_ASSISTANT_ID"
+ }'
+ ```
+
+
---
-## 7. Run the Test Suite on an Assistant
+## 6. Create a Test Suite for an Assistant
-
-
- Open your [dashboard.vapi.ai](https://dashboard.vapi.ai) and click `Assistants` in the left sidebar.
-
-
- - Click on `Support Hotline Test Suite` in the list of test suites.
- - Click on `Run Test Suite` button.
- - Wait for the test suite to finish running.
- - You will see the results of the test suite in the `Test Results` section.
-
-
+
+
+
+
+ - Open your [dashboard.vapi.ai](https://dashboard.vapi.ai).
+ - Below the `Build` section, find and expand the `Test` section.
+ - In the expanded section, click `Voice Test Suites`.
+
+
+ - On the `Test Suites` page, click `Create Test Suite`.
+ - Click on `New Test Suite` and change the name to `Support Hotline Test Suite`.
+ - Set the `Assistant` to `Tom`.
+ - Set the `Phone Number` to `Vapi Support Hotline`.
+ - Under `Test Cases`, click `Generate Tests`.
+ - Use the following prompt to generate the test case:
+
+ ```txt title="Test Case Prompt" wordWrap
+ Test that the assistant can verify a customer account using phone number, retrieve their current balance, and provide recent transaction history.
+ ```
+
+ - Accept the generated test case.
+ - Click `Run Test Suite` to execute the tests.
+
+
+
+
+ Click `Run Tests` to execute the tests.
+
+
+
+
+ ```typescript
+ import { VapiClient } from "@vapi-ai/server-sdk";
+
+ const vapi = new VapiClient({ token: "YOUR_VAPI_API_KEY" });
+
+ const testSuite = await vapi.testSuites.create({
+ name: "Support Hotline Test Suite",
+ assistantId: "YOUR_ASSISTANT_ID",
+ phoneNumberId: "YOUR_PHONE_NUMBER_ID",
+ testCases: [
+ {
+ name: "Account verification and balance check",
+ description: "Test that the assistant can verify a customer account using phone number, retrieve their current balance, and provide recent transaction history.",
+ steps: [
+ {
+ type: "userMessage",
+ content: "Hi, I need to check my account balance"
+ },
+ {
+ type: "assertion",
+ condition: "Assistant asks for phone number verification"
+ },
+ {
+ type: "userMessage",
+ content: "My phone number ends in 1234"
+ },
+ {
+ type: "assertion",
+ condition: "Assistant provides balance information"
+ }
+ ]
+ }
+ ]
+ });
+
+ console.log(`Test suite created with ID: ${testSuite.id}`);
+ ```
+
+ **Next:** Go to your [Vapi Dashboard](https://dashboard.vapi.ai) → Test → Voice Test Suites to run the test suite and view results.
+
+
+ ```python
+ import requests
+
+ def create_test_suite():
+ url = "https://api.vapi.ai/test-suite"
+ headers = {
+ "Authorization": f"Bearer {YOUR_VAPI_API_KEY}",
+ "Content-Type": "application/json"
+ }
+
+ data = {
+ "name": "Support Hotline Test Suite",
+ "assistantId": "YOUR_ASSISTANT_ID",
+ "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
+ "testCases": [
+ {
+ "name": "Account verification and balance check",
+ "description": "Test that the assistant can verify a customer account using phone number, retrieve their current balance, and provide recent transaction history.",
+ "steps": [
+ {
+ "type": "userMessage",
+ "content": "Hi, I need to check my account balance"
+ },
+ {
+ "type": "assertion",
+ "condition": "Assistant asks for phone number verification"
+ },
+ {
+ "type": "userMessage",
+ "content": "My phone number ends in 1234"
+ },
+ {
+ "type": "assertion",
+ "condition": "Assistant provides balance information"
+ }
+ ]
+ }
+ ]
+ }
+
+ response = requests.post(url, headers=headers, json=data)
+ return response.json()
+
+ # Create the test suite
+ test_suite = create_test_suite()
+ print(f"Test suite created with ID: {test_suite['id']}")
+ ```
+
+ **Next:** Go to your [Vapi Dashboard](https://dashboard.vapi.ai) → Test → Voice Test Suites to run the test suite and view results.
+
+
+ ```bash
+ # Create the test suite
+ curl -X POST https://api.vapi.ai/test-suite \
+ -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name": "Support Hotline Test Suite",
+ "assistantId": "YOUR_ASSISTANT_ID",
+ "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
+ "testCases": [
+ {
+ "name": "Account verification and balance check",
+ "description": "Test that the assistant can verify a customer account using phone number, retrieve their current balance, and provide recent transaction history.",
+ "steps": [
+ {
+ "type": "userMessage",
+ "content": "Hi, I need to check my account balance"
+ },
+ {
+ "type": "assertion",
+ "condition": "Assistant asks for phone number verification"
+ },
+ {
+ "type": "userMessage",
+ "content": "My phone number ends in 1234"
+ },
+ {
+ "type": "assertion",
+ "condition": "Assistant provides balance information"
+ }
+ ]
+ }
+ ]
+ }'
+ ```
-
+ **Next:** Go to your [Vapi Dashboard](https://dashboard.vapi.ai) → Test → Voice Test Suites to run the test suite and view results.
+
+
## Next Steps
@@ -306,8 +1144,9 @@ Just like that, you've built a 24/7 customer support hotline that can handle inb
Consider the reading the following guides to further enhance your assistant:
-* [**Knowledge Bases**](../knowledge-base/) - Attach a Trieve KB so the agent can answer FAQs inline.
+* [**Knowledge Bases**](../knowledge-base/) - Learn more about knowledge bases to build knowledge-based agents.
* [**External Integrations**](../tools/) - Configure integrations with [Google Calendar](../tools/google-calendar), [Google Sheets](../tools/google-sheets), [Slack](../tools/slack), etc.
+* [**Workflows**](../workflows/) - Learn about workflows to build voice agents for more complex use cases.
Need help? Chat with the team on our [Discord](https://discord.com/invite/pUFNcf2WmH) or mention us on [X/Twitter](https://x.com/Vapi_AI).
diff --git a/fern/examples/outbound-call-python.mdx b/fern/examples/outbound-call-python.mdx
deleted file mode 100644
index 42e57389..00000000
--- a/fern/examples/outbound-call-python.mdx
+++ /dev/null
@@ -1,56 +0,0 @@
----
-title: Outbound Calls from Python 📞
-subtitle: Some sample code for placing an outbound call using Python
-slug: examples/outbound-call-python
----
-
-
-```python
-import requests
-
-# Your Vapi API Authorization token
-auth_token = ''
-# The Phone Number ID, and the Customer details for the call
-phone_number_id = ''
-customer_number = "+14151231234"
-
-# Create the header with Authorization token
-headers = {
- 'Authorization': f'Bearer {auth_token}',
- 'Content-Type': 'application/json',
-}
-
-# Create the data payload for the API request
-data = {
- 'assistant': {
- "firstMessage": "Hey, what's up?",
- "model": {
- "provider": "openai",
- "model": "gpt-3.5-turbo",
- "messages": [
- {
- "role": "system",
- "content": "You are an assistant."
- }
- ]
- },
- "voice": "jennifer-playht"
- },
- 'phoneNumberId': phone_number_id,
- 'customer': {
- 'number': customer_number,
- },
-}
-
-# Make the POST request to Vapi to create the phone call
-response = requests.post(
- 'https://api.vapi.ai/call/phone', headers=headers, json=data)
-
-# Check if the request was successful and print the response
-if response.status_code == 201:
- print('Call created successfully')
- print(response.json())
-else:
- print('Failed to create call')
- print(response.text)
-```
diff --git a/fern/examples/voice-widget.mdx b/fern/examples/voice-widget.mdx
index 61c78b45..1623631a 100644
--- a/fern/examples/voice-widget.mdx
+++ b/fern/examples/voice-widget.mdx
@@ -6,14 +6,15 @@ subtitle: >-
slug: examples/voice-widget
---
-
Improve your website's user interaction with the Vapi Voice Widget. This robust tool enables your visitors to engage with a voice assistant for support and interaction, offering a smooth and contemporary way to connect with your services.
-## Steps for Installation
+## Quick Implementation
+
+Choose your preferred implementation method:
-
-
- Copy the snippet below and insert it into your website's HTML, ideally before the closing `