50+ Files with Ease: OpenAI's Assistant API and Zapier Automations - Complete Guide β
Let's build with Zapier and AI (100+ videos)π
2023-12-09
Transcript β
[00:00] let's learn how we can start leveraging assistance API when it comes to having a lot of data on our company EG we got a ton of files we got to filter through let's find the most effective way for us to actually filter through these files so we get the most effective answers when leveraging assistance API for our company we're going to be using the software of zapier of course we're going to be using open AI as well combining these two we're going to be able to leverage it with a no code Solution that's going to allow us to access certain files that we care about to answer certain questions all automatically let's jump in welcome back to corbon AI y'all this is going to be a technical video here we're going to be diving into using zapier and open AI to
[00:30] start leveraging assistance API in the context of if we have a lot of files on a company how we're going to be able to cypher through those files because if you load an assistance API with a ton of files and then ask it a question it's too much data it needs to be able to look at file by file we're going to learn how to do that today as you see if this crazy cat over here I went ahead and announced this on my Twitter so make sure you're following me here if you want to get a little early updates about what's H about to happen on this channel if I can speak let's go and jump into today's video so the example we're going to do today is we're going to take the place of a real estate company so if you're a real real estate company you
[01:00] just hit the jackpot the way we're going to approach today's video though is I'm going to provide two separate properties I'm provide the relevant data on those properties let going straight down y'all we provide the relevant data on those properties how did he get this data so this is our real estate gbt you can check it out on our Marketplace if you want to get it yourself but essentially I just asked it to give me two different properties in Miami we got the North Pine Crest home and then we got the Paragon Miami Beach 801 so the way we're going to approach this is we're going to have specific data files associated with each one of these homes why because we wouldn't want to load an
[01:31] entire assistance API with one PDF that has like a 100 homes maybe each PDF would have a selection of homes EG in the Miami Beach 801 maybe we had 801 through 805 on a select PDF this will make more sense knowing this though we went ahead and just created two separate files here so you can kind of understand the use case here then you can apply it to your own business we got the first uh data oriented file which is going to be the Paragon Miami Beach # 801 all the relevant information about this house and then we got the second file here so I went ahead and exported these as a PDF
[02:02] and this is the data we're going to be using today you're going to learn how to filter this data and basically select the correct one for our assistant API let's find out okay so to start off here we're going to go ahead and just create your assistant let me go zoom in y'all and let's go and begin here so the the first assistant I want you to create is going to be called like company data you can obviously call whatever you want this is where you're going to throw every single file that is associated with your company into this assistant on top of that your next question might be okay how much data do I want to do per file I would say you want to do a Max of
[02:34] five pages on a Google doc at 12 Roman fa or 12 font why if you load too much data into one file it's going to be too much it's going to lead to more in effective answers just the name of the game here is you'd rather have more files with less data than one really big file if you're watching this video you definitely agree with me so knowing that though we're going to call this you R database base for our real estate company so you're going to go ahead and add whatever you want in the context of
[03:05] this assistance API this one's more of a Eternal use API as you'll see here this isn't going to be front facing consumers aren't going to be able to see the instructions here so we're just going to do that and you know I'll go and go to gbt for preview since they slash the prices by 66% here I'm going to do retrieval here then I'm going add the two files so file number one and file number two for context this is what the file looks like as I said before you can get up to five even 10 pages if you want to play around with it but this is what the file looks like I'm jump back over here we have loaded our company data assistance API I'm going to hit save here make sure retrieval is on as well due to the fact that we need to actually
[03:36] access our underlying PDFs so the reason I went ahead and created an assistant API dedicated to our company data is because we can go ahead and test in the playground before I show you that you alternatively could upload your data files straight on the file section here and hit upload over here but I like creating it as an assistance API and the reason why is now I can test it in the playground and I can almost use this as an internal use case case EG I load it with all my company data company data here and I'm like hey you know the
[04:07] property and then let me go ahead and get the properties name real quick the Miami Beach 801 not that give me some information on this so if you load this with a ton of information now you're kind of going to put yourself in a position where you can actually Cipher through your data internally in your company so this is its own use case but we're going to also leverage it in today's tutorial this is nice to know that being said I will say that the generation does take a little bit more time than I found like you know using in like a fine tune gbt you know for use it
[04:37] on Chad gbt's front end but as you see here we got the relevant information here so use that as you want I mean I put the very simple instructions of urr database for a real estate company and kind of left it there use it how you will use that how you must now let's jump into the automation here coming over to zap here we're going to go ahead and create a new zap here and in this zap we're going to do an event so basically the use case I'm going to show in this tutorial is I'm going to say incoming email from a potential lead asking about a specific property once that lead asks about that specific property we're going to Cipher through
[05:08] the data that we have in our database we're going to find our specific file that is about that specific property and we're going to mock up an entire draft email to respond to that individual and then gives us the discretion to essentially send press send right so what we're going to do here is we're going to Simply put Gmail use whatever software you are currently using so you might be using Outlook we going to say new email matching search going to continue here and then I'm going to gohe and choose our courses down here as you see with that little course down there um and I'm going to go ahead and hit continue here I'm going to send myself a fake email here so we can kind of play around with it okay so however you
[05:38] typically receive leads this is going to be person to you so I'm going to show you two ways to kind of internalize this the first way is that when you say email matching search we can either find the specific property name in the subject line or in the body knowing this though we're going to go ahead and just proceed with sending our our email like this but in theory let's say that your subject line isn't typically fixed and the property name might not show up in there but it might show up in the body there's going to be ways we can approach this we're going to approach that together here so but we got our test data here as you probably can expect you probably want to send yourself test test data here or typically how a lead comes in I'm going to go and rechange this to
[06:08] real estate uh draft and okay so we're going to go ahead and match searching string we're going to go ahead and say question put question for that so it might be something entirely different for you I'm going to continue here I'm going to go ahead and test this trigger so alternatively if you don't want to take this route right so this route's a little bit more I have fixed text found within all of my lead emails but your route might be I don't really get fixed text in all my emails I actually get like someone just randomly contacted my email about a property or whatever it
[06:39] may be in your context in that context we're going to go ahead and switch this up we're going to say new email and continue here continue here and we're just going to choose our inbox so let's go and do that continue and test trigger so it's going to bring in every single email here but in order to ensure that we're not burning or Cas here when it comes to zaper because we don't want random like hey your mail trim subscriptions up or something like that we're going to add a first block here which is going to be a kind of a block that basically identifies whether this is a lead email or not so to do so we're going to do conversation we're going continue continue we're going to say
[07:11] based on this we'll do this context we are a real estate company based on this email so we're going to say uh subject body now a lot of times people use software where you kind of identifi there's going to be fixed text found within that email that you can kind of like don't have to do this step but this is for everyone that maybe doesn't do that kind of software and uses software or just gets like random emails that are
[07:42] actually Le generating emails we're going say uh generate yes let me go zoom in y'all and let me go zoom in over here uh generate yes if this is a potential Le need for a property and no if this is not uh okay so let's see if this is sufficient or not it may not be sufficient I'm going to go ahead and up
[08:13] my model to gbt 4 for where you at there we are and from here we're going to add a memory key of just uh lead so lead okay so remember key is the random 32 character string random 32 character string that ensures consist outputs EG if this comes out as just yes or this comes out as just no that's exactly what we want we don't want extr extraneous characters as you'll see why on top of that notice how I put quotation marks here due to the fact that I want to be very specific on its output just give me yes just give me no on top of that notice how when I
[08:45] identify underlying data within the actual automation itself it says subject here but I put subject again that's because when this Chad gbt block reads it it's not actually going to see the word subject therefore I need to add it myself also added parenthesis to basically condense the data and make sure there's no over overlapping information occurring from here I'm going to continue I'm going to test this step and we should either get a yes or no in this context we should get a yes and we got a yes let's go okay so knowing that we're going to add a filter block we're adding a filter block so that basically if the email says if
[09:18] that output is no because the email receipt is not a lead we are not going to continue this flow because it's just MailChimp telling me to renew my subscription no MailChimp I'm not going to renew my subscription so we're going to say exactly matches yes we're going to continue we're going to get a green light here but just for the sake of showing you if I put no here it will only continue if no incurs we wouldn't want that to happen so we want to say yes we'll put yes here to continue and here we go so we have set up our filter now we are going to only handle and deal
[09:50] with emails that are specific to lead information so let's get into the fun stuff here we're going add a Chad gbt block and the purpose of this Chad gbt block is is going to be for the discretion of finding the specific file for assistant API that kind of sounded crazy it's not too bad y'all so I'm going to goad and say conversation continue continue and this is where it's going to get a little crazy but that's kind of the purpose so I'm going to go and up my model here to gbt 3.56 actually no we
[10:21] don't need to do that anymore we do gbt 3.5 uh turbo let me see if I can find it y'all where is it at so we're going to choose this one y'all so this is the one that's the most updated version of it that's why it's like November 6 that's what 1106 means and what opening I did on their end is they basically made it from the the original value if you've been playing with Chad gbt a lot it was originally capped at when it was this 3.5 turbo at 4K context what does that mean basically how much data it can handle but now with the new 3.5 turbo it can handle 16k uh I think I think it's uh every 750
[10:54] tokens is about a page of writing don't quote me on that okay so why why we uping it to 16k or 3.5 turbo is because we're going to be dealing with a lot of data here EG if you have a lot of files this is how we're going to structure it so we're going to go ahead and say this based on this email uh we're going to go ahead and put in the email title the email body and honestly just to give just to
[11:25] dot her eyes and cross her te's we'll add this context block as well might as well give it a little bit of context here now that being said you don't need to add context to assistant apis as you'll find here really soon so context we really stay company based on this email we're going to add the not title subject and we're going to do email subject here and we're to do email body here so we're going to provide basically all the relevant information found on the email we're going to say find what [Music]
[11:57] property is being referenced so then this is where it gets a little bit crazy at yall so as we know in that original email if I come back over here we are referencing the North Pine Crest home but we may have a ton of homes in our selection so what I'm about to show y'all is kind of complex would have required a lot of coding back in the day but now that we have Chad gbt it's pretty easy so what I'm going to do is this I'm going to go ahead and grab the names of the underling f that
[12:29] we have so for this specific context since we're dealing with responding and setting up a draft we just have two for your context you would add as many files as possible or as many files as you have right so here's the big thing though we have the underlying file and we've named the file correctly right so we go over to files here we've named the file as you see here you know the paragan Miami home. pdf.pdf here's what important what here is what is important y'all you have to have that PDF in order for assistant
[13:00] API to understand it so what we're going to do here is this we going to say generate the home that is being referenced in the output have it so there is a PDF at the end let's see if this is enough this might not be enough I'm going do 32 character string continue Test action if
[13:32] it's not if it's not enough we're going to restructure our prompts and that's why the member key is important here right so we should see the northpine Chris home.pdf if we don't we got to rephrase this as you see completely off base we're dealing with uh a a less smart model comparative to gbt 4 so let's go ahead and R structure this what property name is found in the email okay generate we're going to use the
[14:02] same terminology here as well this is actually pretty important so instead of saying home over here I'm going to use the same variable of property generate the property that is being referenced in the output okay now we're going to roll the dice again in order to roll the dice again we're going to add a one there it's going to refresh the memory key think of a memory key as like a new chat and chat gbt we want to start the chat fresh all right so we're getting closer as you see we got the property being referenced is the north north north the rest is North Pine Crest home you can generate this information about this property by creating a PDF document see
[14:33] like it kind of understands what I'm doing here but it doesn't fully so let's go ahead and try this let going zoom out in let's go and try this again and basically the the name of the game is we're trying to get it out so it's just this right so we're going to say this the output should just be the property name no text before or after I don't typically like adding EGS in prompts but let's just try
[15:06] it so we're kind of giving it as an example so that it can reference other properties let's see what we got going on here so we're going to do that I'm going to go and refresh the memory key again hit continue and retest this step so if you like this kind of content make sure to subscribe as I show you me I show troubleshooting and prompt engineering live like this I don't want to give you just like here's the prompt because this is going to give you perspective of how I troubleshooting when dealing with this kind of stuff as well also make sure to leave a like if you felt like you've learned something up to this point
[15:37] so did he just do that I just did that okay here we go so we got our we got our output perfect right that's exactly how we want it and we've locked it in with our memory key EG you run through this flow again and we had the puran Miami Beach Diet and when it would come out the same way let's go and move forward y'all so moving forward is going to be going to be another chat gbt block here so with this Chad gbt block we're going to do an event of find a file so this is where the discretion of creating that
[16:09] original assistance API the company data one let me reload here oh I haven't created the other one yet so this is where that discretion comes into play because what is the file name we're searching for all right perfect so we got in our output here boom and just to send home the reason we use 3.5 turbo here is so you can do a ton of files y'all so if you have a ton of files for your company you could put 40 here you could put 50 here don't worry that's the whole point of this tutorial is to show you how to Cipher through a bunch of data and find your specific things that being said though
[16:41] that being said though if you have a lot of data what I would tell you to do in that context is I would tell you to set up a paths block why am I telling you to set up a pass block set up a pass block and if you have I would say over 40 files 50 files you're handling you want to set up a pass file where basically you go down a certain path depending on what specific file is being booked for let me know in the comments if you want to see that kind of tutorial that's a little bit more complex but just for the the use case of this tutorial which is more of just make sure we can find the
[17:11] right data we're going to continue with this so knowing that we have the file name search for the file purpose is for assistance perfect continue toest step and we're going to find our file that we've uploaded to our database okay we are almost done y'all so now that we have our file we need to set up a different assistance API so coming back over here we're goingon to say create and this one's going to be we're just going to call it real estate agent say you are a real
[17:42] estate agent for Miami Flamingo properties so you guys want to buy a house in Miami let me know in the comments no I'm joking uh we'll leave at that we actually don't need to provide any more you can provide more context if you choose to do so that should be enough for me I like using gb4 preview in the context of actually dealing with very complex stuff one thing you'll notice is I'm not going to add any files here so add more instructions as you deem necessary
[18:12] EG uh tone funny well let's see what the if it can do humor we're going to hit save here make sure retrieval is on no files why are we doing no files Corbin because that's the whole point of company data that's the data we're grabbing for the specific context that we're uh handling knowing that we're going to go ahead and open up our last little block here so we're going to do action here J gbt and this is where we're going to do conversation with assistant here we go hit continue continue and let's go ahead and fill in some information here so the first piece
[18:42] of information here we can fill in is going to be choosing our agent real estate agent the second piece of information we want to choose here is going to be the file we're specifically talking to file find file we're going to choose ID this is how apis communicate with each other we're going to find the relevant information inform and we're going to gut check this don't worry we're going to find the relevant information found within that file so basically the whole point of this process right is instead of me going to this real estate agent and loading 50 different files and then asking for to choose from it we've kind of added a um
[19:15] an insurance measure where we do this entire process right here in order to just give it the one file that is pertinent and relevant for that specific use case because guess what if I'm just inquiring about the Pine Crest home I don't really care about the apartments I don't really care about the other properties you have I only care about that one so that's the whole point of this right is going to lead to better outputs here we're going to choose our tools here we're going to make sure we have retrieval got the ID retrieval existing files perfect perfect perfect and we got a message here we're going to say we
[19:46] received an email interested in this property how do we know what property it is Corman because that is where we set up that 3.5 block so we can only give context right here boom generate a draft email that responds to this person's inquiry asking about the property so this being said you might be like oh
[20:17] what but if there's more information in the email itself that's fine what I would tell you to do is add another 3.5 block really cheap really fast get a summarization of the underlying context of the questions asked and then add that here as well point of this tutorial though is just to show you how to play around with data and find the exact files for the specific use case knowing that though we're going to spell this correct we're going go ahead and come down here we're going to hit continue we're going to test this step and let's see if we get a draft email y'all so looks like it works over here as you see we got our relevant information about the North Pine Crest home here $4.7 million coming over here let's go check it $4.7 million let's see what else we
[20:50] got here we got 5,100 ft coming over here 5,100 ft so we know that it actually is internalizing reading the data and it's good to go I did did tweak a little bit of the structure y'all so I want to add a formatter block here so we're not getting too much context this is just important so let's say you know you want to use less information in the email itself typically draft emails you don't want to have too much so max of five sentences on top of that I added this little line here it says give details on the under property and finally one last thing here is I went ahead and actually because we already uploaded the file to our assistance API
[21:20] we can actually just have it as an existing file so put the ID in existing file rather than new file and you'll be good to go here so let's go ahead and just show this all working here so I'm going to add one last block here which is going to be a GMA block this is going to be the block we use to set it up where once we receive an inquiry like this we can go ahead and set up a draft therefore all I have to do on my end is kind of read over the draft if I'm satisfied receive from there so I'm going to go ahead and name the title here so this going to be a fixed title or a subject title here so I'll just put in the the name of the property so North
[21:50] Pine Crest home coming over your body I'm going to go ahead and go to the conversation of assistant let's get the reply here if I come over to the reply real quick also one of the thing that I changed from the original inquiry or the assistance API of a real estate agent is I took away the tone of funny because it was lowkey it was very annoying the the way the answers were coming out like some humor is just not funny all at all y'all so I just kind of took that one out as well but from here I'm going to go ahead and hit continue test this step and we should be sending an email to no
[22:21] one let me actually send this to myself real quick so we have to do two to someone so because I sent this to myself already I'm going to go ahead and just put our email again here this would be the email that's coming from so for example your from email would be a completely different lead email I'm going to go ahead and do this again I'm going retest this step again and one other thing I want to point out y'all is that because we actually know the underlying property we're speaking of and because we know the specific file and data we're receiving for that property you could actually add another step here where we find a Google Drive block we use a Google Drive block we find a file in Google Drive and then we
[22:52] can on top of that attach a lead PDF for that specific inquiry that being said I did a tutorial on this check it out I I'll try to link it here if I can find it I did a whole tutorial on this on how to do that whole process but for now we should come over to our inbox here and find our new email all right so since we set it up as a draft here I'm going and click this and there we go y'all so obviously we can restructure the way the emails are sent we could probably went to the assistance API add more instructions on how we typically talk example emails stuff of this nature but as you see here we got our property Miami Flamingo
[23:23] Properties LLC we got a relevant email with relevant information and we have successfully fix figured out y'all how to take assistance apis and if we have a ton of data for our company now we know how to basically sort it find it and use it correct on so we're not running into issues as we scale with these kind of solutions so that all being said make sure to leave a like if you feel you learn something up to this point or near the end of this video If you enjoyed this style of video and you want to see more of it make sure to subscribe but also check out the playlist at the end here as I'm diving into automation Solutions artificial intelligence and how to apply this in other parts of your business so you can check that out also
[23:55] I did a whole playlist on AI tools for your business where I'm just going to comparing tools based off my experience which ones you should even use if you're starting out here and that being said I know this is this is pretty complex so I doubt you got this far but if you haven't even used artificial intelligence in zappy before check out this 40-minute video where I basically show you how to integrate the two and give more context on everything associated with that but without further Ado y'all I'll see you in the next video thanks for tuning in and yes surprise I'm an AI Avatar make sure to explore more here at Corbin AI where we
[24:27] demystify AI for your personal and business life until next time