AI Chatbot Template you need: OpenAI Assistant API Step-by-Step Guide.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in my last video I created a real estate Legion chatbot using the open AI assistance API and you guys gave me so much feedback that I honestly didn't even know where to start so questions and problems and everything so in this video I made something truly unique and it actually impressed myself that this is possible to do and it works so amazingly that I just had to make a video about it and share it with you guys so I'm going to show you a templating engine for chatbots that you can use to create predefined actions through a with assistance API to simplify the term is we basically use AI to create our chatbots that integrate directly with the assistant API and whatever features we' like and the best of all of that is we can use that for any kind of industry so it is completely versatile you can customize it to whatever you need like literally for your specific needs and not just what I predefined if you've seen my last real estate Legion video I created a real estate Legion chatbot that could search through properties that could schedule viewings and that could create leads based on the people that that are interacting with it so if you are not specifically working only with three three actions and you would like to have custom features it is very hard to do that because you basically would need to write custom code so what I did here is I completely revamped everything I created a completely new repet template that works in a way that we can use AI to create those tools and actions for us so that you don't need to write them by yourself anymore and of course provide you everything you're going to see in this video for free within our resource Hub so you can simply head over to hub.in rus.com download the templates and follow me along in this video it's also going to be a bit more special cuz like I did in the last time in the last video I didn't prepare any actions we are literally creating the actions with AI from scratch so I'm very confident that we can still keep the video in a short amount of time even with creating those features completely from scratch so that you get a better understanding of how to use it and how it actually works so since we already familiar now with real estate Legion agents Etc I'm going to use that as an example as well so we are basically creating another chatbot for the real real estate Le at agents and I'm going to explain you the concept on how you can add your very own actions to the chatbot and how you set it up in the first place we are going to use again a implementation on the website using voice flow so we have the real estate Legion Jetport here and we have our repet template right here this is the one you can Fork directly within our resource up so I suggest you to do that right now so you can follow me along with it and the structure is a bit different but there are only three main things that we need to look into which is the config.py file the tools folder and the resources folder the resources folder is basically the easiest one it's still the same as last time you can add any kind of informations or documents in here and they will basically be used to train the assistant API so you don't need to write any custom code all you do is you either upload it or you right click it at file and you add a new custom file and what I did here is I basically just have some standard information about the Bright Horizon surity agency which is just a fictive agency that I came up with at some point with some information like phone numbers Etc so that is what I basically use it for you can add as many documents as you want or how many open AI supports so all you do is you just add it here then we come to the very first and interesting part which is of course the assistant prompt so the assistant prompt is the way your assistant works or whatever it should do like it has the constraints it has how it should react the features it should have Etc and I just use the same one as from last time as you can see here this assistant is designed to assist users with real estate inquiries Etc we have the key functions that it should do which is Property Search Assistant schedule property viewings and lead capture it also has some guidelines and it has some behavioral things down here so this is something specifically optimized for the real estate agent if you don't want to completely rewrite it from scratch I also created a new prompt directly with on our resource app which you will find here which is a prompt to create a new version for that specific chatbot that also automatically leverages the python code behind it so you don't need to worry that you break anything with a python code all you need to do is you need to replace the scope which is that part up here where you basically Jus Define whatever your assistant should do so all of the features it should have access to Etc and then you just fire it up and in the the end you will end up with something that looks similar to this which also basically then creates automatically specific functions for you like property search lead capture Etc so once you have something like that for your Niche specifically you can think about the features that you would actually like to implement or you probably should have already done that before the instructions so you probably will have them within here if you have additional ones you can also think about them and then create them later in as a tool so right now the chatboard would basically do nothing CU we have not even added any tools so to do that we are going to to use chat gbt and the custom prompts I'm going to show you now so to keep that example short and I'm not going to make the video too long I will focus only on one of those and I can either use scheduling probity viewings maybe or lead capture cuz I don't have any search API so let's say we're going to use the lead capture for example so I'm going to create the lead capture endpoint using the prompts and what that basically means is that I want to capture the leads from within the chatbot from that user that is interacting with it whenever it seems fit to collect the leads right so what I would do is I would head over to our resource up I scroll down to to the cat gbt tool ideation generator prompt which is pretty small and looks like this so we're going to copy that we head over to chat gbt we paste it in here and now we are going to replace that specific part which is replace this based on your tool requirements so a placeholder from my side and the action it should actually do so now we can basically tell it whatever it should do or what the action or the tool should do so we say the action should be able to collect leads of the user collect leads of the user let's say along with real estate information if available something like this and we also would like to use air table to do that so the way I want that is basically that whenever our chatbot creates or collects delete data from a user that is interacting with the chatbot I want that user to be added to an air table database that looks the way you would like to have it so I'm going to tell this to this specific feature definition as well I say the lead should be added to a custom um eror table database called leads and it has the following columns so you can add the columns that your specific database has I just use the same one that I had last time as you can see here so we have name phone email and property preferences so all I'm going to do is I'll say here name phone email property preferences I'm also going to put them in uh double quotes just to make sure it the AI really interprets them properly that is just it's probably not even a must it's probably just something to ensure a little bit of higher quality and that is all I want so what I'm going to do now is I literally just click return and I wait until jgpt basically gives me a full scope for that action that I would like to create which always consists of three things which is the functionality is the feature descriptions and it's the constraints so whatever it should be careful with or or follow when it creates that python code that we will basically then use as a custom tool and once it generated it as you can see here we can just read through that the new tool collects and stores real estate leads in an air table database perfect this tool is designed to interact with the users through a chat interface Gathering essential information okay for the leads we say columns are name phone email property preferences this feature is crucial for Real Estate okay and the constraints the tool must validate user input amazing if a user fails to provide information should prompt them to fill the missing information that is not necessarily important as the assistant API takes care of it but I'm anyways leave it in here because we are still generating the master prom after or basically the whole code so the integration with ever should use the air table API that's correct API key and base ID must be configured correct all interactions with a table API must be potential errors okay so even in case you don't understand whatever it writes here you can also just literally copy it and continue to The Next Step which is copying the chat chip tool generator prompt and this is a massive one so you're literally just going to copy that whole block down to here you paste it into chat TPT it can be the exact same chat you copy the functionality up here and you scroll in here a a little bit up you replace the placeholder that I added here and then you change everything that's written under functionality I'm going to copy the feature description I place it within the feature description down here and I will also copy the constraints so they will now be not formatted you can do that if you want to keep it very clean so basically like at your dashes in the front I'm just not going to do that now and all I'm going to do is hit enter and once I do that this specific prompt will create a complete tool or action for our chatbot for us so that we don't literally not need to write any specific code and this works CU I built that whole back end on ret in a way that we automatically enq certain tools we can use them from one specific file which means the AI doesn't need to create or deal with different files and the same information from other elements so everything is properly object oriented and can be used autonomously wherever you would like so as you can see here it creates the python script with a tool config and everything properly the way I want it with a call back information you don't even need to understand that so let's just pretend we have literally no idea what we're doing so we can read here it says based in requirs I create a python modu for your chatbot that integrates with air table AP to stall real estate leads the mod will be named store leads. Pi perfect so that's what we're going to do we're going to copy the store uncore leads. piy name we head back into our rep template and under Tools there's nothing in the folder right now we we right click it we click on ADD file and we add the name click enter and create an empty file as you can see here all we need to do now is we literally just copy that whole code that was written here and paste that whole code right into here and I promise you I'm not going to read through anything of that I really don't care all I care is I follow the last instructions of chbt which says the notes here it says full number validation okay em validation all right it will do that secure configuration the air table API key and base ID are read from the environment variables ensuring they're not exposed okay which means they are not defined yet since we have no variables in here I already have added one here which is the air table API key this is because I had it from my last chatbot if you don't have that here which you probably will not cuz you haven't installed the template so you can simply add that air table API key variable and you can copy your API key from within your account uh paste it right into here and then you're set up for that so then the last thing we have to do is we have to set the air table base ID secret which is something we haven't either so we can set that as an environment variable as it mentions it here as well so we simply click on new secret we add it here and now we want to have the air table base ID and the air table base ID just for us as an information it's defined here in the and you will find it when you go to air table to developer Hub to web API documentation to my first workspace and from within my first workspace which is a bit complicated apparently you go to authentications and you will find it right here this is the way I usually find it so fairly simple you copy that you paste it into the value you add it as a secret and that's literally all I'm going to do I'm not going to do anything else I just save that file with command s on Mac so it's saved and now I'm basically ready to already create that assistant with the information I have which means we have now a assistant that has access to a tool called store lead and this tool can then be used from the chatot or access from the chatot to create a lead in air table I just noticed now within my assistant I actually named it different sorry in the config I call it here create lead so what I'm going to do is I just change this one to store lead just to have a little bit better quality it will still work even if you don't do that I just love like to have that information correct that I've added here so you you can basically also mention that directly within your prompt to name that function specifically the way you define it inside of your assistance prompt all right so what we're going to do is we click on run now since we don't have an assistant. Json file here we will basically create one which means an assistant is created directly on open Ai and if you don't see any error here it means the server run properly which also means at the same time that the code that open AI generated right here works and doesn't throw any arrow in the first place which is already a great indication that it probably works so now all we have to do is we need to to actually put in the front end like we do with another chatbot and to do that we are going to use a voice flow template and that voice flow template I will provide to you directly as well through our resource app you can simply download it import the template and you will look at something like this where you have a couple of different modules and we literally just care about two of them which is the create threat and the generate response because both of those require the URL of our repet template to get that we simply head over to replate we go to web View and this little button we will only see it once you run your replate so make sure your your reel runs and then you can just right click this little icon for opening a new window and you copy the link address you head back to your voice flow assistant and in here you simply replace that your replit url enter slash with that URL that you just copied and you do the exact same thing over here with a chat so that it says. co/ chat and that's literally it now you can basically publish it with whatever version you would like or whatever version it is that you're working on probably in your case it's a V1 or something and once it's public published you can embed the widget you copy the code you paste it on your website and you will see the icon down here when you load the page and look something like this so when I open this now I assume that the bot properly runs and you know it properly runs if it shows those exact messages hi I'm John your Bri Horizon's realy assistant how can I help you today which apparently is what I have configured directly within here in the chat Bo so at the point you're watching this video it might be a bit different but those two feels will still be there and you you get the hang of that so when this runs we are already able to use the chatbot and that chatbot should already have access to that custom action that we created with with chat GPT and we can try that out now I'm just going to use some prompts or some some questions now to the chatbot to trigger that action to add me as a lead okay we can say can you please share my contact details with someone I have questions about an apartment apartment let's say in Denver for example so we're going to set send it off and we're going to wait whatever the chat basically gives us back so what happens now is it communicates through our repet with the assistant API of open Ai and returns or something and it says certainly I can help you with that to get started could you please provide me with your name phone number and email address also could you tell me a bit more about the apartment you're interested in okay so it's basically asking questions on the action which again indicates that the action has been registered properly which is what is defined inside of the store lead actions right here as you can see phone number name of the lead description description so it creates that all set up properly and now we can basically just provide that information we can say sure my name is more we can say + one 2 3 4 5 6 7 as a phone number maybe then we say as an email more at demo. test and what else would it like phone number name and email address okay we have that and the apartment we can say I'm looking for an apartment in then and were to buy for around 500,000 something like this okay so what I expect now is that the AI basically uses that action that we just created with jgpt to send information to our air table database right here and here we have it and as you can see it already added it here just popped up now looking for an apartment in Dem to buy budget around 500,000 and it added plus 1 2 23 4 567 my name and the email address so it communicates properly with it it says as well here thank you I have registered your contact ke and preferences your team will reach out to you shortly so it worked out perfectly and all of that with a feature that I literally have never written I have never really checked out all I have done is I just added the information that it needed so the API keys for air table and you can literally do that with any kind of action you would like to have whether it's for real estate whether it's for health whether it's as a lawyer or nutritionist whatever you are in you can literally use the template to create your very own chatbot with your very own actions without writing any kind of custom code with than Python and if things are really complex and you have to deal with multiple API requests for example you still have the possibility to Define within the prompt like within the ideation prompt for example that you would like to send information to a no Cod or Lo code service like me.com or zapier or integ or P or Microsoft power automate you can just Define that and then it basically will call a web hog URL or whatever is available for that automation service to start a scenario to start a zap to start a workflow and you can then do everything visually without relying on that code so it is endlessly expandable you can use it for anything you would like and extend it in any way you'd like for your specific business so that you can make more money you can make more leads you can generate more income free up your resources whatever is the need for it and it's just insanely powerful and something that I already used like twice now for our clients and they love it so I hope you have as much fun and possibilities with it as I just had and if you have any questions regarding that or anything else you would like to see me do in the future feel free to just drop me a comment and I'm very happy to look into that until then see you next time
Info
Channel: Jannis Moore | AI Automation
Views: 5,965
Rating: undefined out of 5
Keywords: chatbot, chatgpt, openai assistant api, openai assistant, ai assistant, chatbot tutorial, openai assistant api chatbot, ai chatbot, how to create a chatbot with assistant, openai chatbot, open assistant ai, openai chatbot gpt, chatgpt voice assistant, chatgpt api, assistant api, voice assistant, whatsapp chatbot, chatgpt tutorial, integrate python chatgpt api with digital assistant, whatsapp chatbot chatgpt, open assistant api, create chatbot like chatgpt
Id: X2ADW4191Jw
Channel Id: undefined
Length: 17min 5sec (1025 seconds)
Published: Mon Dec 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.