binaryruel
05/03/2024, 2:34 PMjson
{
"maxDurationSeconds": 1800,
"assistantId": "------------------",
"phoneNumberId": "------------------",
"customer": {
"number": "{{3.phone}}",
"name": "{{3.full_name}}"
},
"metadata": {
"message": "{{3.`How can we help you?`}}"
}
}
How can I instruct my assistant to get the following:
1. Get the customer.name and say, "...May I speak with [name]?"
2. "We would like to confirm that you wanted [metadata.message]?"Vapi Support
05/03/2024, 2:34 PMVapi Support
05/03/2024, 2:34 PMcustomer.name
and metadata.message
in its conversation—you'll need to incorporate these elements directly into the assistant's system prompt or first message, as these parameters are not automatically utilized in the conversation by Vapi.
Based on the information in the documents, the customer.name
attribute and metadata
are for your own reference and are not inherently included in the conversation by the assistant. To ensure the assistant mentions the customer’s name and their message, you'll need to dynamically generate the firstMessage
or system prompt to include these details before making the POST request to create a phone call.
From the scenario you provided, here's a way to structure your POST request body with pseudo-code placeholders for dynamic content to be replaced with actual values from your system:
json
{
"maxDurationSeconds": 1800,
"assistantId": "your-assistant-id",
"phoneNumberId": "your-phone-number-id",
"customer": {
"number": "{{customer_phone_number}}",
"name": "{{customer_full_name}}"
},
"metadata": {
"message": "{{customer_message}}"
},
"assistant": {
"firstMessage": "May I speak with {{customer_full_name}}? We would like to confirm that you wanted {{customer_message}}?"
}
}
Vapi Support
05/03/2024, 2:34 PMfirstMessage
, replace {{customer_full_name}}
and {{customer_message}}
with the actual customer's name and their message. This dynamic content needs to be processed and inserted into the request by your backend or integration layer (e.g., GHL automation or Make Scenario) before sending it to Vapi.
Note: This approach assumes that the assistant is capable of handling dynamic firstMessage
content per call, which aligns with Vapi's flexible assistant configuration as indicated in the documentation [(1)]() . However, the direct manipulation of firstMessage
to include custom variables from metadata
or any other dynamic source isn't explicitly covered in the provided documents. Therefore, ensure your implementation preprocesses these variables into the request payloads as needed.
For more detailed guidance on creating assistants and calls, please refer to the official Vapi documentation on creating a phone calland creating an assistant [(2)]() .Sahil
05/03/2024, 3:10 PMbinaryruel
05/03/2024, 4:45 PM