in this video I'll be showing you step by step how to connect your custom gpts to Whatsapp this has been a highly requested video because many of you have created awesome gpts and want to break them out of the chat GPT site and start using them in the real world via things like WhatsApp and get access to its over 2 billion monthly active users by connecting your gpts to Whatsapp you can tap into this massive user base and completely automate key tasks within a business like customer support or lead generation or even appointment setting for your business or for the businesses of your clients the issue with all this is that connecting AI assistants to Whatsapp can be an extremely painful process so I wanted to create this video to walk you through the easiest method that I've found so that you can get things set up and avoid the mistakes that I've made in my own experiences to show how this integration works I will be setting up a WhatsApp lead generation chatport for my own education business from start to finish and as always I will be giving away the templates the code everything that you see in this video at the end so that you can steal this build and start to use it in your own business or sell it to others if you're new to the channel and don't know who I am my name is Li otley and I run my own AI development company called Morningside Ai and I also run the largest community of AI agency owners in the world where my students learn how to make money by selling AI solutions to businesses just like the lead generation chatbot that you're going to build in this video let's get into it so what are we actually going to be building in this video we are creating a lead generation chatbot for my AAA accelerator program which allows people to ask questions via WhatsApp to my assistant which is how helping them to learn more about the program and then eventually go for a lead capture once they're ready to purchase which is going to grab their phone number and their full name and we're going to log that to a CRM using air table then we have the system set up that allows them to learn more about the product from a knowledge base I'm going to give it a document that you guys will get access to as well a document that has a ton of information from my website and elsewhere that tells the the AI essentially everything it needs to know about the program and allows people to ask questions about that before capturing their lead and allowing our sales te to follow up from there in order to create this functionality we need a few few things firstly we'll be using the assistant API writing that within repet and then connecting repet to mini chat and mini chat is going to send a messages automatically to WhatsApp I know that might sound like a lot but I've done 99% of the work for you you just need to download the templates and connect them up on your end and then you're ready to go it is worth mentioning for those that are new to the channel that what we are building today is different from the gpts that you've probably built in chat GPT on your own and go through the chat gbt Builder and creating them there what we are building today is different from that and that we are able to take this functionality that we create and then connect it to different applications in this case we are doing WhatsApp I've also got a video on Instagram I've also got a video on putting it on websites so what we are building allows us to create a GPT and then connect that functionality to wherever we want to put it now with the gpts you create on the chat gbt site it's locked within chat gbt and you can't start to use that functionality elsewhere so we are building with the assistant API to allow us to deploy to different channels like WhatsApp Instagram Etc and that's why I'm so big on teaching this assistant API side because it allows you to do so much more and create so much more value for your business and for other businesses as well when you know how to use it properly to start this build off you need to clone my replit which is going to be available in the first link in the description you can sign up to my resource Hub or log in if you already have an account once you sign up there then you can click on the replit which would be one of the links you should be greeted with this page you'll need to sign up to riplet and create an account it is free and on the top right you can click on this Fork button which is going to clone or copy my entire code base so that you can use it yourself and make a couple edits as needed so I'm just going to put Fork at the end of this I'm going to Fork the rapple give it a second to boot up and you'll see something like this which might look familiar to many of you by now I don't want to get stuck in the weeds trying to explain this because there's not much you actually need to modify but I will say if you hit to the functions. P file if you do want to change the document here's the knowledge based document as I mentioned this chatbot this lead generation chatbot has a couple of components if you go back to my three ingredients idea or concept for these uh gpts we have knowledge prompting and actions in this case I have given the prompting which is available in this prompt P file so if you want to change the prompting for your WhatsApp assistant you can come to the prompts file modify this and these changes will be reflected in the new assistant you can create so here's how you can change the prompting if you want to change the knowledge I have a document here on the left panel called knowledge. dox This is referenced down here in the create assistant function if you want to change the document you need to delete it on the left panel you need to upload a new one and then in the functions.
P you need to change this document name to be the same as the one on the left panel so that's going to allow you to change the document and the knowledge component then we have the tools component we have the retrieval tool which is necessary to add the knowledge base so you have to have this if you want to have custom knowledge then we have the tools this is the lead capture tool as I mentioned this chatbot has a lead capture functionality this is the only thing I've put in it just to keep it as simple as possible so if you want to change your functions or your tools you can copy and paste this whole function into chat GPT and ask it for new functionality or new tools to be added to get this working on your end you just need to change three things before running this first thing we need to get an open AI key so I'm sure you know how to do this platform. openai [Music] you can create an account if you haven't already you can log into your account and then on the left panel you will have an API key section and you can click create a new key and copy that key as I mentioned in my last video if you want to use this properly and for it to work you do need to head to your settings and go to your billing you need to add a card to your account and you also need to buy some credits here by clicking buy credits you can add $5 or $10 so that it can charge your account properly and be ready to give you access to all of the latest models that will make this thing work so you do have to do that I will mention that now once you have your open AI API key you can head back to riplet scroll down on the bottom left to the secrets panel and then if you click on the uh edit button here the three dots and paste this in then you can get your open AI API key in there you can update the secret next what you need to do is get your air table API key so if you haven't already created an account you can go to my resource Hub there'll be a link to not only sign up to air table and create an account there will be a link to copy this base here that you can see on screen so this is what you'll need has the name the phone number for the lead capture and there's a button up the top corner here called copy base you'll click that and you'll be greeted with something like this where you've actually copied the entire CRM and you have it editable on your end so phone numbers names questions Etc to get your AIT table API key you can click on your profile in the top corner here click on developer Hub and then under this personal access token you can click create a new token and it's going to appear here you can copy that personal access token and then head back to repet and then again you need to click three dots on the air table API key delete it and paste in yours with the air table API key you need to make sure that it says beer space than your key this is something that a lot of people get stuck on and you need to make sure that you can click this eyeball button so it shows you the entire key make sure that it says capital b e a r e r Bearer space and then your long token if you haven't included Bearer space your token and then saved it then it's not going to work with both of those air table API Keys updated you can head back to air table and in this case we want to stay on this Developers page but click on the web API documentation you can scroll down to click on the Smith solar CRM that you've just cloned from my resource Hub then on the left panel you can click on the accelerator leads table then create records then you will see this URL here which is going to allow you to push and create new leads on your air table base and with this you need to copy it bring it back to this create lead function and then replace this section here so boom boom and we all ready to go with that we are ready to run our application for the first time it's important to note that this is when the assistant creation step happens and here's the function that we need to go over so the way I've set this up is that if there is a file in the left hand panel called assistant. Json as you can see here it's going to attempt to load the assistant ID from that file if there isn't a assistant.
Json file meaning you haven't already run this app before then it's going to create a new one with the settings that you provided here when I run this app for the first time what it's going to do is run this create assistant function and as you can see on the left hand panel it just created a new file called assistant. Json inside this is where it's going to be storing the key or the identifier for the assistant that you just created so the assistants are a combination of knowledge prompting tooling and that all gets combined together when you interact with the open AI API it's going to create that assistant as a single being and it's going to give you back the ID to be able to talk to that programmatically later in your application so what happens if there's no assistant. JSO file meaning you haven't run the app already it's going to create a new assistant and save the ID here and then every time you run the app after that it's going to load from the file if it is there so in this case if I stop this app right now and I reboot it it's just going to read the assistant ID from that file which means that if I want to modify my assistant I want to go into the functions.
py file and I want to change the knowledge document I want to change the tooling I want to change the prompting what I need to do is delete my assistant.