How to Build an Outbound Transient VAPI Assistant to Call Your Leads

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in this video we're going to be creating a dynamic or also called transient uh vapy assistant for outbound calling and we're going to do that inside of make using the vapy API so I have this board here going over the process of how we create these transient assistants and just a quick little recap what transient assistants are uh they're pretty much uh assistance that you create on the Fly um tailored for every single call that you make whether it's inbound or outbound in our case um like let's say we have a phone number that we want to call uh make an outbound call too depending on the phone number we might want to put the the you know the lead if we're calling a lead we want to put their first name or some information about them in the prompt or in the first message of uh the assistant when they you know get connected to a call um that all has to be done dynamically you can't really do that in the papy dashboard and that's why we create transient or dynamic assistance using the API so we can enable um powerful sort of actions like that so if you take a look at this diagram here um the way that this works is that we want to connect to our data first um so in my case that's going to be a spreadsheet inside of Google sheets I'm going to connect to that spreadsheet and read all of that data in and then I'm going to build a loop and uh what I do with this Loop is that I'm going through each and every lead and Performing uh this sort of process right over here um which is I'm getting the information on that lead um taking a base assistant template that I've kind of created and then I'm kind of mashing those two together to create a transient assistant um so let's say for example I want to create a transient assistant that has the information of the customer like their uh first name and I want to include it in the first message of the assistant what I can do is I can take that base assistant that doesn't have the first name and I can take their lead info so like their first name and I can kind of combine them together and create that transient uh assistant in a Json format and then from there I will take that B on definition and uh put it into a post request uh using V's API the outbound calling endpoint and and make that post request and it will you know send the outbound call to that lead um and then we do that for every single lead so that's how it how it works um in in short so I'm now in make and we can start by creating our new scenario and I'm going to begin with with the Google Sheets module and then right there search rows because before we we create the loop we have to take every single lead and put it into a list or array like structure so that's what we're going to do first so I selected my lead spreadsheet and then select the leads sheet inside of that spreadsheet and then go ahead and put a to z doesn't really matter too much but I just put it there um just because I don't have too many columns and then what we want to do is uh I'm going to be using the first name in my transient assistant and then also uh a reason for call I'm going to include that data um inside of my transient assistant and then also we want to make sure that they have a phone number so the way that we we kind of filter by is a phone number exists we need to make sure that they have a phone number and then also make sure that they have a first name that we can use and then also we want to make sure we have a reason like an an entry inside of that column um it looks good and before I proceed let me go over to the spreadsheet and this is just some dummy data that I have right here um but you can get a sense for what it looks like have customer ID first name last name phone number and then the reason for for call such as troubleshooting and in our example uh the assistant that we're creating is a assistant that's going to gather feedback on these leads and uh some of the experiences that they've had with the customer support team for the company and it's going to be using this reason for call column inside of its uh first message for each lead so going back into the make automation um just a couple Fields left for this specific module um we can order by row number row number is a number and we're just going to return by or we're going to return a maximum of one row just for testing purposes you can leave that blank if you'd like for all of the rows so the next module in this automation is going to be taking all of these leads in the in the data and putting it into a list or in a aray and the way we can do that is say the source module is going to be the Google Sheets module and then we're going to get the total number of bundles or the total number of leads that's pretty much what that field is don't need the spreadsheet ID uh R number don't really uh we could use that R number sheet don't need customer ID first name last name and phone number and reason for call that's all we need and then once we build the list in the array we're going to go through each lead and create that Loop um we're going to iterate through the list or array and the way we do that is through the iterator and flow control and we can say iterate through the array hit okay and we're good and then now comes the actual building of the base template that we had mentioned earlier in the diagram so if you head over to tools and go go to set variable we're going to store the Json definition of the base assistant which we're about to create um so we can call this assistant and just hit okay on that right now um and we'll head over to the vapy API so if you head over to the documentation for the vapy API you'll see a uh create assistant tab right over here and that's where you want to go and that's uh the place where we're going to actually create our base template for our assistant um vapy has this really nice feature where you can uh pretty much inside of their documentation uh add in all the the setup for your assistant and it will create the Json definition or construct for the assistant on the side which we'll be able to pretty much copy over into our make automation um and we can fill in all of these different sort of options for the assistant right on the left left hand side right over here so I'm going to go through this uh base template for the assistant pretty quickly but you can fill it out um with the options you'd like obviously um but starting with the transcriber we're going to go with deep gr you can change it here if you like but deep G deep G as a provider Nova 2 language will be English and then the model will be open AI we're going to stick with open AI um let's skip on to provider again open AI GPT 40 model and then the messages will be we want to set the system prompt um this is where the system prompt goes select system and then I already have the prompt ready so I have the prompt over here so I'm just going to copy and paste this and for you guys you can either you know paste in your own prompt or you can you know adjust this one as you'd like so from here um once we've set the prompt up there's a couple other options I want to quickly go over that I think are at least important for this simple um build because I don't want to concentrate too much on the the base build um but it is needed obviously so set the temperature to 0.2 I like to set it pretty low for um these types of assistant and then the voice we're going to go with Azure um I think that's fine and speed keep it at one provider is going to be AER we'll go with Andrew on The Voice ID and then the first message mode uh we'll pick assistant speaks First Recording yes Hippa no client messages server messages we're not going to worry about right now so name is another field we can quickly add in so outbound feedback assistant doesn't matter too much what you put down here just I guess use for identification purposes for yourself but the first message is where we actually want to focus on for this specific example because that's where all of the dynamic ability for this trans assistant that we're about to build it's going to come into the first message um you could also do uh add some Dynamic abilities and or add the the custom variables that we're going to add you could add it into the system prompt but for our case we're just going to use it in the first message and you'll see right over here we have the first message um and we have some variables that we're going to replace later on which is where that transient or dynamic ability comes into play so the first name and then the reason and you can see how we use it in the in the message so copy that back to the API documentation just paste it in there and then the other sort of options don't have to worry about it too much um all extras if you'd like you can fill it out um however you'd like for your specific use case so once we're done with setting up this base template um just make sure you've you've added your custom variables to maybe like the prompt or the the first message however you'd like um the bracket notation is just something I'm using you don't really have to use it it's just something I'm using to tell myself hey this is where I want to insert the custom variable and we'll kind of replace these variables later on in the process when we're building the the automation even more so now we have the base assistant template generated in a Json format on the side so we can take uh take the part from the opening brace up until the closing brace and just copy that entire part and then you want to paste in that generated Json sort of string into an editor like this Json editor online and catch any mistakes because sometimes it generates also some Escape characters that we didn't want so right there you saw one some just extra quotes that we're not looking for um and then also one over here and there you go so you see no more errors and then can copy that and go into make and then paste it into the variable value so make sure you've hit okay uh once you've pasted in the based assistant template in that Json format um and I'm just going to run it real quick just to make sure everything looks good um has the entire string in there make sure it's iterating as well through the leads um and I'm only doing one lead for now so only shows one lead so looks good so what we want to do next is extract all of those fields in that Json like string and put it into a list like or array like structure and then we can turn that structure that LT like or array like structure into a Json object which we going to need for the Post request to create the outbound call at the end so you can hit add another module hit Json and then parse it as a Json and since we're putting it in that array likee structure we can put the bracket notation and put the assistant inside of those brackets there we go and then hit okay and then I'm going to quickly run this to make sure it's being parsed correctly um the way that we want it to be parsed so we can hit run run anyways and it should print out all of the fields in a Json like format not just like a string like it was before but actually print it out nicely and then from here we can add the flow control array aggregation to create the array object say the source module is this module here parse Json module number and then we want all of these fields so transcriber model voice looks good so now that we've put all the fields for our assistance Json definition into an array we can actually package all of that into a real Json object so we can hit Json and then go all the way down to transform to Jon and what we're going to do here is use the make function first and hit array and what we're going to do is pretty much take that first element of the output array in the previous module and we just want the first entry that has that entire assistant definition so we can package only that into the Json object and then from there we can can add the module for the Post request to create the outbound call so if we hit HTTP and then select make a request and here we can add the endpoint from the vapy API to create the outbound call and we can add the header for our vapy API key and then fill out the actual content of the request um like all of the different parameters that we have to send whenever creating an outbound call so if you head back over to the vapy API documentation you'll see a create phone call request um a post request that we want to send as part of our automation which allows us to specify uh the type of assistant the uh customer's phone number things like that um all the things that are needed to create a a outbound call and what we're going to do is pretty similar to what we did with uh creating the based uh assistant template which is we're going to use um this feature that vapy has to fill out the fields for the Post request and then just copy and paste so what we need here to start with is a customer ID or customer so we're going to go with customer and then you can just enter in the just just a random because we're going to substitute in the actual leads uh data um so I'm just going to add in some filler data there and then same thing with the name we already have the name uh read in and remember if we we created the loop where we read all the the leads data so this is all going to be filled in later the extension we don't really have an extension to our phone number so we can just hit space and then delete it just make sure there but just an empty string and then next we want the phone number ID which you can get from your dashboard um once you've set up your phone number you go over to phone number in the dashboard and either you import from toio or Vonage or you added in um and you bought it from vapy um you should have the phone number ID here which you can just copy and paste so I've just added in a filler ID for now um which I'll replace later and then from here we have the assistant object which we'll use to actually put our real assistant so I'm just going to type something in real quick or select something and then quickly delete it um or this is actual delete right there um because we just want the field in that we want to copy and then we'll replace this part later on so that's all we need um we can copy this part now so copy from the opening brace to the closing brace and then go into make and hit raw for the body type make sure you pick um application sljs and then the request content is going to be what we just copied over and then we also want to make sure we get the endpoint from the vapy API so if you head over to the documentation and then go up to the create phone call make sure you copy this this will copy the endpoint for you and then we can just paste that in there and should be good and then lastly we also need a header for our API key so if you do authorization and then bear and then put your API key right there after bear um and you can see this also in the documentation if you go up to authorization bear the bear token is your vapy API key and the vapy API Key by the way you can get right over here the bottom left API keys and then it's this private API key so just make sure you have your API key in there and then we also want to make sure everything looks good on the request content so we'll make sure that for number we'll put the actual leads phone number and and then the name we can put first name last name this doesn't really matter this is more like metadata um that you can keep track for the call the extension we're going to leave blank and then for the phone number ID you want to make sure you put your phone number ID in there um and then for the assistant we also want to put our Json string that uh our Json string that we got over here it's an actual Json object we want to put that in the assistant field and then just make sure you hit okay on there and then there's one more step that we might have forgotten to to add in and that is in the setting the variable part so if you remember we want to actually put our first name of our lead and the the reason in there we just left these template variables in so we can delete those and then actually replace it with the real variables so reason for call and then replace first name with the actual first name of the lead and should be good now just make sure you save your scenario and before we actually run this uh scenario um just make sure that the leads or the spreadsheet or whatever database you're pulling from the first row you're probably going to be testing on if you're doing it um kind of like I am you want to make sure that the number that you want to call which is probably your phone number you want to make sure that's in here so it's not calling this random you know dummy data that like I put in here I'll replace this number as well right before I run the uh automation with my number so I can test it so real quick uh just a couple things with the HTTP post request um forgot to mention you want to make sure obviously this is this post and not uh get or anything um and then also you want to make sure you're adding a plus sign right in front of the phone number um which is needed when you're making this request otherwise it'll throw like a 400 error and now we're actually ready to test this out and we can go ahead and run it and see how it goes see the call here we go hey Luka this is Chris from Bay Ridge utilities I'm following up from a recent troubleshooting related customer support call you had and was wondering if you had a moment to discuss your experience with our team uh sure great thank you for taking the time on a scale of 1 to 10 how would you rate your call with our customer support team uh I would say eight thank you for that rating was your problem or question successfully resolved during the call uh yes it was I'm glad to hear that do you have any suggestions on how our customer support team can improve uh not at the moment no thank you for your feedback Luca we appreciate it and we'll take it into account for future improvements have a great day all right you too thanks all right so there you go um that is the outbound transient or dynamic uh assistant with fappy if you guys have any other uh questions or topics you want me to cover let me know um and for any sort of consulting or business inquiries if you want voice agents like these with your business feel free to reach out to me on the email in the description and yeah that's all I have appreciate it thanks
Info
Channel: Ibrahim Munir
Views: 898
Rating: undefined out of 5
Keywords: vapi, transient assistant, conversationalai, gpt4o, make.com, aiautomation, vapi transient assistant, vapi dynamic assistant
Id: jJjD5UsO46o
Channel Id: undefined
Length: 23min 21sec (1401 seconds)
Published: Fri Jun 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.