Live Tutorial: Building (REAL ESTATE) Tools for OpenAI Assistant API

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in my previous video I shared with you a super super amazing chatbot that you can use for any kind of industry with any kind of actions that you can imagine and it's super super powerful as it uses and leverages this open AI assistant API so it's directly integrated and everything is available as a template from within the last video so if you haven't checked it out definitely do that right now cuz this video is going to be an extension of that you guys have requested it many many times to see more examples on how you can use that templating engine to create custom actions that are super powerful and that you can use in a more advanced way to even lift your chatbot further into the Realms of of custom code and even without writing that custom code and this video is specifically made for that so I'm going to show you two things I'm going to show you first of all how you can create a custom action that integrates with a web hook which allows you to already create or already connect that action or that chatbot to mostly any kind of other services that you can imagine and with that I'm talking about Loco tools or NOCO tools like zapier or make.com P connect power automate all of those you can also connect it to other services that integrate with web hooks or you can even connect it and hook it up to your very own API or database so all of that is possible and the setup itself will be very simple so it's more of a beginner's tutorial even though it involves code but you don't need to write any custom code CU everything will be generated by cat gbt with the prompts I created for you and you will find all of those inside of the resource up in the link in the description the second example I'm going to show you will be a more advanced example that leverages the assistant API in combination with other external apis to create a property search for the chatbot that we already created in my previous chatot template if you have seen it the chatot we created there is called Bright Horizon's realy which is a real estate agency that I made up that is literally just for the purpose of this chatbot and in there there was an action that could basically cury through a predefined list or adjacent list of properties but in that case we are going to elevate that and we are actually using a real estate database from some other kind of providers to actually show you how you can fetch that information and how you can display it directly within voice flow or inside of your chat all right that's enough of the talking let's dive right into it so if you have checked out the previous video you should already have set up your voice flow template and you should already have your repet template forked directly from within the resource app so these are the two main things you need and as you can see I have no tools available right now cuz we haven't created any and the config.py file which contains the assistant instructions is literally the same as before so we have Property Search Assistant schedule property viewings and lead capture so lead capture I'm not going to create today cuz I already did that a couple of times in my previous videos so now I'm focusing more on showing you a simple way of how we can hook up the schedule property viewings to a weburl and then I show you the advanced version of how to create a property search assistance with a custom API included all right to get started the first thing we are going to do is we are creating the action for the schedule property viewings as it's the easiest one and all you need to do is you need to head over to the resource Hub and copy the chat GPT tool ideation generator prompt which is a very simple one so you copy that one you head into your chat you paste it and now we Define whatever that action should do so in my case I just remove the placeholders and I want to define the actual to schedule of viewing online which I literally not completely building right now so I'm more of showing you how you can connect it to a web hook so that you can schedule the viewing in your very own way or do whatever so it's basically just an example so we say this action should be able to schedule a property viewing it has to collect the full name of the user email and we're also going to say the property ID and the date and time of course and the preferred date and time now we also want to make sure that it's actually sent to a web URL so we're going to Define that here so we say the information should be sent to a web hook URL where I will continue taking care of the data all right that's it so I press enter And The Prompt is posted jpd now starts to scope out that specific action and this prompt what it basically does is it helps you to use a very very simple snippet of a description that you of the action that you want to use and it creates a complete scope for that including the constraints and the feature functionality so that you don't need to take care of that and that is especially interesting if you deal with stuff like web po URLs and you have no idea what they mean or you want to connect it to air table or campaign monitor or any other kind of service or let's say say make.com you can just say I want to connect it with make.com and it basically uses its knowledge to write the constraints for you in a way so that they are optimized for make.com so that you basically don't need to do that just gives you higher quality prompt in the end all right now we have that prompt here so we head back into our resource up and you look for chbt Tool generator prompt and you're going to copy the whole massive block and I know it's a lot and you don't need to read it you simply need to copy it paste it right into here and now we need to replace a couple of things so when you're in the prompt you just scroll up a little bit until you see this line so you remove it and then you copy the functionality from the previous promt prompt and replace it within the one in the new one you do the exact same thing with a feature description that we have right here and I do the same thing with the constraints now you will notice that the constraints are dots or or a feature list I'm literally just pasting them here as text because it really doesn't matter since they're separate lines anyway and once you have done that all you need to do is you need to press return and now we just have to wait until CHT creates for us a fully flashed module that we can include as a custom action into the chat plot template that I provided for you and we can already get started since at the beginning it defines already the name of that specific tool including the pi ending all you need to do now is you need to copy that specific file name with a pie ending you head over to your replay template you go to tools right click it click at file add that name here and press enter so now you basically have that file available right here and it's empty for now so now we basically have to wait until uh chbt is ready with its prompt which it should now already yes it's basically ready so all we do is now we copy that code we paste it right into our rep template which looks something like this and I just go quickly through to see if everything is okay so environment variable this is basically where we set up the web URL so it requests us here to set it up as a secret which is also I think mentioned down here yeah remember to set the web in environment variables okay so you can basically create a variable for it here I'm not going to do that I directly create it in here but that is up to you whatever you want then we have the function call so this all looks good this is example usage should be removed commented out in production so let's assume we in production so we're just going to remove that and I'm going to save that file and now we basically still need to add our web hog URL so since that web hog URL depends on the service if you use me.com you can use the webook integration if you use zapier you can use webook by zapier and there is another NE tool that I want to show you which is called web hook. site which is basically a webook testing tool and this is what we're going to use to test our action so once you're on it you will see that you will get a unique URL which you can copy and you can basically receive data on that so what I'm going to do now is I will basically head back into our rep template and I replace that part I make I create two double quotes and I place that URL right in here here and this is literally all I'm going to do now I basically press command and save it and that file is saved so now we already have our very very first action ready that can basically schedule a viewing and send or or can schedule a viewing from the assistant perspective and can send it to a webook request so that we can take care of it in whatever other environment we want so I'm going to show you that as I haven't really run the chatbot or have actually deleted it so you probably haven't run it until that point so we simply click on run it should create cre an assistant. Json file right over here and when that happened now we can basically already go into our voice flow template and test the chatbot so I click onto here I click run test and if it shows the messages that you see right here you know you have set it up properly and now we are simply going to ask that we want to schedule a viewing so I say I want to schedule a viewing for property 1 2 3 4 5 so I just basically came up with a property ID 1 2 3 4 5 which is something that we can later on again fetch from that cury that we are going to create and now it says certainly happy to help you okay cool it asks us for full name email address and the preferred date and time so we say it's yanis more yanis at more. Def and we say I'd like to visit it on the 9th of February uh 2024 at let's say 1: p.m. something like this so now basically expect the the API or the assistant AI the assistant API to understand the request and send off an action that should receive here and as you can see it does it properly it says full name y as more it says email that we defined it says the property ID and it says the date and the time so this works perfectly and all of that works just through the prompting that we did inside of our rep template where we created this file so this all is basically just just responsible for sending that information to that weapo URL and we haven't written any of that which is amazing so it works out of the box and this is the simple version of setting that up now all you need to do in case you want to integrate that with an another kind of tool like make.com all you need to do is you literally just replace that web hook URL that you get from whatever provider you work with it might be that the structure needs to be adjusted if you have your very own web hook or URL or endpoint for on your own servers but if you have an own server you probably know that anyways already so nothing new to that okay that's it for the easy part now let's create a custom property search endpoint that we can use to literally search a custom database of whatever kind of properties you have available to do that we need a couple of things you first of course need to have a custom database where you can basically fetch properties from I don't have that so what I basically did is I went ahead and went to a rapid API which is basically a provider for certain kind of apis especially in any kind of industry so it's very versatile and it also offers real estate apis from which I just grabed one which looks like this once you created an account for Rapid API you will be able to sign up and you will be able to create uh or can send sign up for for Rapid API and you can also subscribe to that real estate database or that listing in case you want to use a predefined one from Rapid API where you work with which means silo or realtor or whatever it is uh I I use this us real estate listings here from API maker I just found that it's free so I can just use it for now for testing purposes and as you can see it has various end points available so what we are going to use is we are probably either using maybe get a property list for sale or for rent let's say people want to buy for in our real estate agency so we are probably going to get a property list for sale which is that one already so inside of the code snippet you will see of the all of the magic which is what we definitely need to create the prompt so you simply click on the kind of code you go to Python and to requests and it should look something like this well that is all we need for now uh to have that API on the database available so in your case you probably have your own if you wish and now it comes back to actually creating the scope for our action so we head back into our resource H we copy again the chipt tool ideation generator prompt we head back over GP to chat GPT I create a new chat I paste it into here and now we are defining a couple of constraints that we would like to have inside of our scope for that specific action and we are going to be very specific with that as we would like to integrate it with some kind of API so I say something like this action should be able to search through a set of properties and return them let's say we want to have the property title let's see what else we have available there so you can go basically over here you can go to example response and you can look into the actual responses so we basically get back all of that kind of information so it actually looks interesting so I might even just get back anything just in case so if you basically want to be very specific you can also get back anything and the user can Reas question based on whatever we return so let's just do that in our example so in case of specif specifying specific values I'm just going to say through a set of properties then I will also say uh let's say let's say based on the location maybe or let's say actually let's say let's say through through more cuz I I just saw that inside of the real estate property you can you can filter by many things by property type sort beds Min beds Max so there are tons of values available and we can basically actually even use that list to to generate a scope for us that we can include into our scope I'm going to show you that in a second so all we're going to do for that is we say uh based on various parameters meters as defined below so now we can basically already Define the parameters down here so we say something like uh parameters what I do here with the Stars is basically markdown so that would be a bold text so it's easy easier for the for jbt to interpret as B deex and that is something elevated so what I'm going to do now is actually I just I copy that part and I creating a new chat where we are going to come back to in a second all right what we're going to do now is we basically just cut out that prompt that we created and we save it somewhere and what we are going to do now is we basically create a scope based on whatever the real estate listings have in here so I'm just going to do that as you can see they have required parameters and optional parameters so all I'm going to do is I'm very plain with that so I just scroll down I copy that whole thing it will look horrible right now it will look like something like this so it's not really well readable but what I'm going to do is I'll just tell it now to um please create a properly formatted list of arguments based on the information below so what I want now is that jgpt basically just formats that information and validates it in a way that it looks better as you can see right here required parameters location string optional parameters so it's literally just going to write that and while it's doing that we can already create our other prompt right here which we already our other prompt right here which we just copied from before so I just paste that one back into here and now we just wait until this is ready so we can paste that parameters list down here where we basically just uh created that previous prompt that we copied from our resource app I'm just going to wait until it's ready so it's ready now so all I'm going to do is I literally just scroll up and I copy that whole that whole list of parameters and I paste it right into here into our parameter uh definition that I just set up so I scroll back up and we can see now that it's mentioned under the parameters as defined below perfect okay so now we also want to make sure that we mention that we want to use for example the rapid API so we say we are uh the action uses the rapid API based on the scope below so we are defining the rapid API scope so we say rapid API scope you can again write it inside of two asterisks just to make it a bit more clear for the AI and to get just better results or better quality and now you can also go to the code Snippets and you can literally just copy I would say this part in here it should be enough you can basically copy the whole thing as well I'm just a bit more precise with it so I say this is rapid API scope on the scope below and now we say please ensure uh maybe not please ensure let's see if we have anything else uh okay we also get the result um there is also a response include that below that shows an example of the res results from the properties okay so now I would like also to have one of those example properties mentioned there so all I'm going to do is I basically just go to the schema I'll just open it up let's just expand them all so it looks something like this oops and I'm going to copy that whole schema and I just go back to gbt and I paste the schema as well under so now I just noticed it's called schema so we can optimize that prompt as well there's also a response schema included below so we can say something like that okay there's the response there's the parameters so then we can say something like rapid API schema boom and icluded right here and all I'm going to do is I hit enter and see what happens to see how good the quality actually is of whatever the the scope however the scope it creates so it say functionality the tool searches for real estate listings based on various parameters this tool interfaces with a rapid API to search for real estate listings okay it will allow users to specify various parameters such as location property type price range Etc the tool cues the B okay this is the this is the API this does it well it also mentions here the API call that should be made the rapid API key is set ET and it also mentions all of the parameters that are optional so there are tons and I'm not even sure if I need all of them so I probably are just going to remove some of them when I create the master prompt which is what we're going to do now so you simply head back off over to the resource Hub and you search for the chpt tool tool generator prompt you copy again that whole block you head into chat GPT paste it right here and now we are going to start replacing all of those placeholders again with the information that we just got back from that from the scoping functionality feature description and the constraints and for the constraints like I mentioned there are a lot of optional things so of course everyone can basically optimize them depending on what they need I don't need a lot of them so I would just say until here maybe so we have something like price Max as last this would probably be really good and that's I guess it so now we basically have the scope in here so I press enter and see what happens and this is very very versatile cuz we are literally just asking it to create a whole integration for a specific API from a different API provider with different information that we have literally no clue about so if you're not a developer this might become a little bit tricky if it doesn't work if it works perfectly because jbt is already that smart that often the code just works out of the box if not you might have to read inside of the console if something is wrong but that's what I'm going to do with you here live and I literally haven't tested that so this is the first time I'm doing that so it's going to be very interesting let's just wait until this is done all right it just finished everything so now we can scroll up and we can simply copy that search Real Estate listings. piy we go back into our bot and we create a new tool right here called real estate uh search Real Estate listings. py press enter it creates the new file for us and all we need to do now is we copy that whole block and we paste it into that file and I saw down here as well they have again example usage we don't need that because we want to have it in a live system whatsoever so that should be basically it let's just go over what else we need to add as information it makes a get request okay SCP needs to be conr you specified the next thing that's missing is the rapid API key so like I mentioned before we can add that as a secret here if you don't see the secret tab again you go over the tab here so we click here create Secret add the rapid API key that you can get from within rapid API so I just copied it and I'm going to paste it here add it as a secret and that should be it so far so we can basically look over that if it looks the way we want it to look so there it asks for location string which is basically what it requests here put that in as an example for if if we want to into the description I'm just going to keep it for now uh just to see what actually was written in inside of repet because the location basically returns down here somewhere so let's just see if I can find it uh key arguments okay so it just says location or search city code or address okay so it basically accepts a couple of different things so I would just leave it for now I'm not ex exactly sure if it needs a specific kind of way of writing it but we can literally just try that out so all I would do now is I would basically stop our previous bot as was still running and I kind of recreate the assistant by deleting the assistant Chason and restarting the whole the whole chatbot and if everything works in the coded list is properly configured right in here from whatever chat jpd gave us which seems it is we can now go into the chatboard and actually try it out and see what happens so I'm just going to remove that part and I'm going to go back to run run the test and let's see what we can get from for properties so where would you like to find properties let's just say do you have any any properties available in Port Portland let's say in Portland so what I expect now is that it basically makes a search on that real estate API if it works and it doesn't so it it throws an arror that we can probably see as as well here which says got an unexpected argument method white list which apparently it doesn't have oh that probably is because that API doesn't have this this argument property Whit list oh I think that is because the API doesn't have the argument method whitel list I assume or let's just search for that one cuz I honestly don't know what that argument is so what I'm going to do is if you if you find something like that we can just go back into the chat and say please write the code without the re try so what I expected to do is a ndef I would just have the thing Rewritten and and and try it again cuz I have no idea what that retry is so we just head back into jet gbt and wait until it creates that function again without that retry and see then if it works cuz from my understanding the retra strategy honestly I don't know exactly what it implemented here it probably just wrot it here so we can go over that makes it to the r one okay the parameters performance with minimal API codes and efficient processing okay so what all we're going to do is we basically just wait now until that new module has been generated and then I'm going to be back in a sec okay it's just about to finish that whole part and it removed it properly so now we basically take that whole thing again and we repl we replaced whatever we had inside of the search real estate listings file and I also had in here I just see it formats it prop not properly so all I'm going to do is I remove this example usage down here again and I save the file and all I'm going to do now is I basically just stop it and I run it again to see if the code throws any error and apparently it doesn't so all we can do is we basically just try the exact same thing again so we go back we start the chat again run test and we say do you have any apartment available in Portland and let's hope it works this time because it always depends on what what chb degenerates right and it might be that there are some permissions or some imports missing so this time it seems it works at least so far but let's see what we get back as a response and surprisingly enough it actually returned something and it says we have a variety of properties available in Portland here are a couple of highlighted options three-bedroom single family home as you can see it has all of the information inside with the description the bad bath the size and a picture as well and as well a link to the actual listing so we can actually just open it up in a new tub and check it out which we see here so surprisingly enough it works right out of the box or most most likely right out of the box with all of the properties right here and then it also ask if you would like to schedule your viewing so if we are going to do the same thing now we still have that webbook chat open so we can simply try it so I say something like uh let's say I like the four bedroom multi family home a viewing would be great amazing so what I expect about now is to request that information again from me for the viewing as in this chat I havn't provided it to it so it should basically ask again for the first name email and all the other information when we want to have the viewing Etc and it does it right here perfectly so what we're going to do now is we just say our full name and there more we're going to say the email address let say it more Def and the preferred time the preferred time what about the 24th of February 2024 at 2 p.m. and now if everything should work we should see a new web hook request or response coming right into here with that information about the property including the property ID and one arrives here and you can see yanis more it says the email as well and the property ID and the date the date is also correct this date always of course depends on your time zone so you should definitely be careful when converting time zones in between different tools but that is something you should already be aware depending on wherever you live and wherever you have your properties so now if we look the property ID and we actually check whatever we got back inside of this real estate chatboard right here so let's go to the view listing or the property ID even says it here so it basically did it correctly it basically showed the properties unfortunately I left the chat now but as you can see the tool works it basic returned that information properly so for your uh to to make it simple for you I'm going to release everything you see here within this repet template as well as a template inside of our resource app so you can go over there and copy that as well in case you start the video uh it will probably be anyways present it to you in the description of the video if you have seen it before or so that you can check it out and I hope this whole tutorial gives you basically a better understanding of how you can create your very very own custom actions in a even more advanced way so that you can still kind of customize it to your business needs and do whatever you want with it and I know that's going to be it's going to be a very long tutorial but if you're still sticking around I really really appreciate it and I hope you subscribe to my channel I'm going to do a lot more like that and if you have anything else you would like to see inside of my videos or on my channel definitely Drop it Down Below in the comments I'm very very happy to help you out and and until next time have fun enjoy automating see you
Info
Channel: Jannis Moore | AI Automation
Views: 2,693
Rating: undefined out of 5
Keywords: ai automation agency, ai automation, openai update, gpts, how to create a custom gpt, create a openai gpt, openai, openai devday, ai tools, custom chatgpt, chatgpt, build custom gpts, openai gpts, chatgpt on custom data, openai function calling, how to make gpts, openai gpts tutorial, custom gpt tutorial, assistants api, assistant api, gpt assistant, real estate ai tools, real estate chatbot, real estate chatgpt, real estate chatbot ai
Id: oWUSkBM8gqA
Channel Id: undefined
Length: 28min 28sec (1708 seconds)
Published: Wed Dec 13 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.