Subhashish Jung Shah
10/23/2024, 5:18 AMVapi
10/23/2024, 5:20 AM{{variableName}}. Here's how you can do it:
1. Define your templates with placeholders for the dynamic content. For example:
- System Prompt Template: "Hello {{userName}}, how can I assist you today?"
- First Message Template: "I see you're interested in {{productInterest}}. Let's get started!"
2. When starting a call or session through the API, you would pass the actual values for these placeholders as part of the API request. For instance:
- userName could be replaced with the actual user's name, e.g., "Alex".
- productInterest could be replaced with the actual product the user is interested in, e.g., "voice-enabled applications".
3. The API will then replace the placeholders with the actual values and use the customized prompts and messages for that specific call.
If you need to implement this and require the exact API endpoint or method to set these templates, please provide the specific details of the API or the system you are using, and I can guide you further. If this is a feature you'd like to add to your existing API and need assistance with the implementation, please ask support for more info on this.Vapi
10/23/2024, 5:20 AMSubhashish Jung Shah
10/23/2024, 5:21 AMVapi
10/23/2024, 5:22 AMjson
{
"systemPrompt": "Welcome to our service. How can we assist you today?",
"firstMessage": "To get started, please tell me what you need help with."
}
And the corresponding API call might look like this in a programming language like JavaScript using `fetch`:
javascript
fetch('https://api.voice.example.com/settings/prompts', {
method: 'POST', // or 'PUT' depending on the API specification
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN'
},
body: JSON.stringify({
systemPrompt: "Welcome to our service. How can we assist you today?",
firstMessage: "To get started, please tell me what you need help with."
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch((error) => console.error('Error:', error));
Please replace https://api.voice.example.com/settings/prompts with the actual endpoint you need to call and YOUR_API_TOKEN with your actual API token.
If you need the exact details on how to make this API call for VAPI, you would need to consult the API documentation provided by the service. If such documentation is not available or if you are unsure about the process, please ask support for more info on this.Vapi
10/23/2024, 5:22 AMSubhashish Jung Shah
10/23/2024, 5:22 AM