Welcome. In this video we are going to create a hundred chats, and once we're gonna create a hundred prompts but we're gonna do it out of one prompt. What happens is I find myself very often creating a prompt in che e p t copying and pasting, getting versions, getting the response. And then when I get like a prompt that's very good, that has all of the sort of structure of a prompt that I want.
Maybe it includes some examples, maybe it includes all of the pieces that I want AI to actually produce in the way that I want it to produce. I then need to take this same. Prompt. This one example is very simple. It is a couple sentences, but out of all of this, what I want to do is I want to take this.
Topic, this save money here and I have all, the whole prompt is great, and I can just copy paste this into a Google Doc or any text editor. Take these two words, save money, and then replicate the edit that to some other topic. And I love this prompt, right? In this case, I don't necessarily love this prompt.
We have some work to do to it to make it really a great one shot prompt. But the issue is once we get it to a one shot prompt, and I want to change this topic. How do I do that? And I think Google Sheets allows us to do this very well and not even care about copy and pasting and not care about editing this at all.
We just have to come up with the topics and I'm gonna show you how to prepare that sheet. If you have not become a member yet make sure you are a member and you can get the ai api app script that I'm using in this sheet. You can get it for. Not free. You have to pay to be a member. If you're watching this video, you already have ac.
If you're watching this video on better sheets, you already have access to it. Upgrade Google Sheets. Open a I Prompt to g PT four. That's the app script that I literally took from my own video, from my own app script I took and put in here. I'm just gonna go over the. Options that I have, I am not using a role in this particular version.
I am using G P T 3.5. I find that it is a little bit faster right now. It's May 31st, 2023. I'm using a temperature of one. I want it to go a little different each time. Not a little. I want it a lot different. Max tokens. I'm only using 500 tokens here. Absolutely you could use 1,015 hundred if you have larger promise, but here's the issue with using AI and specifically open ai.
And this API call specifically in Google Sheets is that you have the way that I'm doing it with a custom function, we have only 30 seconds, eight wheel time out after 30 seconds. So what I do is I try to keep the max tokens low and I do try to chain prompts. There's other videos here about chaining prompts, so taking the output of a prompt and then edit and then doing another thing with it.
So that's not the, in this video, I am just gonna go over this one thing. I have top P one frequency zero and presence Penalty zero. Just so you know what I'm working with in ai. GT 3.5 and all this stuff. So all I have to do, I have created this function, AI custom function inside here. I just copy and paste it from that other video, that other sheet that better sheets members have access to a hundred percent access.
You have access to the script and the sheet and the video. You can see how I upgraded it, but also see why I might have chosen not to put in a role here. Let's get back to this. We want to, what we're doing right now is we have this prompt in a one, and we have an answer. We have a response. And look, I can copy and paste this and I can go, instead of save money, I want to generate a Twitter thread outline for a thread about the best ways to earn income from Google Sheets.
Let's say that and now all I have to do is go to equals AI and then a two in here and just reference that cell. And I'm gonna get a response. I'm gonna get a response within 30 seconds here. And if I don't get a response within 30 seconds, it's going to time out. Give me an error and I can work with it again.
But this still is a little bit of a, you saw those steps that if I wanna do this a hundred times, I'm gonna be sitting here for the rest of the afternoon and just. Typing. Typing. Copy paste. Cool. And I'm not reading this for the sheer fact of this particular video.
I don't read through these. We're just gonna get this response and say it's okay. Especially with this kind of prompt, we might have a prompt that's way longer and we might use a thousand tokens so that we get a really big prompt and a lot of examples, and then get a very good re response.
But this is not part of the video. What we do need to do is clear up this. This text here, we don't want this text to be all the way down for a hundred cells. What we want is we just want that topic. We wanna be able to write that topic and come out with a response. So I'm gonna delete the responses here, and I'm also going to delete.
Everything accepts one prompt. I'm gonna have one prompt, and I'm gonna be able to edit this prompt as I wish, and then get new responses. So what do we do? How do we do this? First off, we want to be able to put this save money part. Let's cut this and put it here and just have this. Be a basic little text box here.
And then in this C column, in the third column, what we're gonna do is we're gonna write if B one, no if is blank B one. Meaning if this is blank right now, don't do anything. We, the value is true. We're gonna add another comma here. And now if it's false, when meaning there is something in that box, be.
One. Now do something. What do we want to do? We wanna do AI and we wanna do a one. And now this gets us exactly what we had before, except we don't have the this is not going to be a correct API call cuz it doesn't have the word save money in it. It's just going to a one. How do we fix this? What we might want to do is, instead of putting an A one here, Actually, in addition to putting a one there, we're going to write in here instead of the actual topic, we'll put a little code.
We're just gonna make this up. We're gonna have two square brackets and two square brackets, and we're gonna write topic and we're gonna write topic in all caps. So this text, we will never type this text ourselves again, like we. In a, in writing a prompt. We won't ever insert that. So this will be unique for all of this prompt is what I mean.
It's like this is a weird sort of syntax, right? We're never gonna accidentally write this. We, if we wrote topic in all caps, we might accidentally write that a topic, this topic that, that, those topics that'll be considered, you'll see it, but we won't ever, this is gonna be unique. We won't ever see this again.
Or we'll never type this again, right? On our own, we will actively have to put it in here. And then inside the AI here, we're gonna call substitute. We're gonna use the substitute function. And what the substitute function does is it searches a one. We're gonna say text to search is a one. What are we gonna search for?
We're gonna search for that code that we put in there, the two square brackets topic, not tropic topic. And then end to square brackets. And we're gonna end that. We're gonna put that in a quotes, oh, I have an extra quote there. So we're gonna put that in quotes and we're gonna say, take wherever you find an A one this topic, we're going to replace it and we're gonna add another comment that says right here, replace with, we're gonna replace with whatever is in B one.
So now this API call, and now if we take this out, actually let's look at. Exactly what substitute is doing. We are getting actually let's put it in a space where we can actually read it. There, so now this is combining the topic. The, it's A one and B one. It's combining them because we're taking the topic in brackets and replacing it with whatever is in B one.
What I like about this too is that this text in a two that we see here, we don't have to see that once we know that this works. We don't have to look at this again. We don't need another extra column to see that these two things are combined, so it's all within this C column. And we can do things like take this a one and put dollar signs in front of the A and in front of the one.
Put, and that's all we need to do. Now, what that does is it says if we move this, if we copy and paste this C one two, C two. The A one is going to stay the same. The A and the one are gonna stay the same. It's always gonna reference A one. But the other things, if you notice here, B two is blank, and B two is gonna be replaced.
Means that we now can copy and paste this all the way down to a hundred. We're gonna actually make a hun. We're gonna actually really do this. We're gonna make a hundred prompts today. And we're going to copy and paste this all the way down. So now every single one of these CE column cells has a formula in it, and it's gonna take whatever is an A one take out top topic with the two square brackets, and then put in whatever is in the B column.
So we can say, instead of writing out this, instead of taking a one copy, paste it, take out the topic, replace the topic. We're gonna do that by literally just writing the topic in B two. So generate a Twitter thread outline for a thread about the best ways to generate money from Google Sheets. And we can just start typing.
We can just start. Typing. Different tactics, different ideas, different not tactics, topics. We can create many different topics. Writing on Twitter as a solo, I don't Wonder Pro. And it's just gonna generate this each and every time we hit enter the new topic, it's gonna generate this. What we can do to make this a little easier to read is I'm gonna center.
This text I'm going to also make it little bit l wider. We are, we're seeing that these texts when it comes out is pretty big. This is a lot for, maybe I should decrease the tokens, make this a lot shorter. But, th these are pretty, a good amount of stuff to think about. So maybe it is good to have a lot of text here.
But I am going to center this. Horizontally as well, so we can see that topic very well. And we're gonna write another topic here. And so I wrote hundred topics here. I did it obviously with chat, G P t. I tried to come up with a hundred topics. They the wording's a little weird. So we can look through this and edit it.
And the cool thing about this right, is you can generate a list of a hundred things, little inputs or parts of this prompt that you wanna do. Maybe you want to. Ch test with different examples. So you write a different example and then say, take this prompt and here's an example and use two brackets and example, and now you have a different example, and then you're gonna see what the output of that prompt is.
One thing you might run into as you do this is you might get some errors. And those errors are gonna be vastly really the same, probably error most of the time. And I'm gonna try to find some errors here. I have vegan baking, video game restoration. Here's some error. Here's an error right here.
What is it? Say, exceeded maximum. Execution time. So just like I said earlier this function will have a 32nd limit. Now you might think that's very limiting. You might have sat there at chat G p t and watched something right for more than 30 seconds and that occurs. So that's why I do try to limit this to less tokens to get a response back quicker.
But all we have to do Is edit this. So what we could do is 100%, we can just cut it, hit enter, and it's gonna have a blank. Great. And now we can just paste it again and see if we get a response within 30 seconds. But we can also rewrite this. Maybe there's something about this. Input that is causing it to go over the 32nd limit.
If you are writing a very in-depth prompt and then you have a very tiny input here, part of it, and you're editing just a little bit, tiny, probably not gonna change much. But if you have a large input here, which might, you might happen, you might have a very small prompt and you're like, I want to try big, different, big differences, totally fine.
What I would say is try making it simpler. Just to get it under that 32nd response and see, all we had to do with this one is copy and paste it over again. It's fine. But with this paintball tactics and load out customization, maybe there's like play paintball as maybe a simpler thing to do instead of these particular words.
Maybe it's having a problem. Not, and it does, it's not actually probably having a problem of completing what you're asking it to do. It's just having a problem to get it within that 32nd limit. That's the only problem here. So we're not necessarily saying that your prompt is problematic in any way.
It's just gonna take over 30 seconds. And this will probably come back, I'll actually pause the video and we'll come back in a second and see if this comes up again. Here we go. 10 seconds later it popped up. And again, it might not be. Great. You have to edit or simplify down this particular part of the, this input of the prompt, but it might be a way to get a hundred things done and we can look down here and most of them are done.
They have only some errors. It might also be because if you. Okay, so what I did is I went and got a bunch of topics and I copy pasted in here like 10 or 20 at a time, and it's probably honestly like the 20th one in this list that's going and getting an error. That's a couple reasons. One, Google does have sort of a rate limiting of API access, this sort of API U URL fetch, but each one of these is distinctly different.
I do have a feeling though, that even if you. Have different API calls. Each one of these is a different API call. If you do 20 at a time, that final one or the last few are gonna ha be problematic. So we can just run them again. Honestly, the probably just gonna be run again. All we have to do is edit this Aqua escapee best ways to aqua escapee a freshwater according design.
Yeah, we just have to edit it and this'll probably load fine. We can see a few errors here, but I'm not gonna continue working on these. You know how to fix 'em. Just edit the text or edit a prompt in some way. Now, here's a really interesting thing that I might not end up covering in this video, but I just want to point it out.
Now you have a hundred inputs. For one prompt, you have a hundred responses from this prompt. If I go back up to this prompt and start editing it, if I edit a one, it will redo every single one of these prompts. So I could have essentially a hundred AI API calls or catchy PT instances here now in my app script here.
I do not have a role message, so that's something you might wanna add. You can probably add it on another another column. Or you can just say, I, you want the same role for all of them, but check this out as well, is I'm only using one prompt or one message in the chat sheet. Pt GT four and 3.5.
There is a little, this is a little different than. The other G P T three call, the G PT three call was just, here's a prompt, give me the answer. We can add in messages here so we can add to this app script and say, Hey, include a message here. Include a message here. And then here's the last thing I want to give you.
You can include the chats. You can say, I want Column A, to be the first message, column B, to be the response column C, to be the first, the second message, and column D to be the response. And then I'm gonna a ask another question. So what you could essentially do is along these column, along these rows, Have a different chat, g p t running and a answer question and answer and the responses and feed it back into chat, g p d each and every time as you go across a hundred times now, and what I've been discovering and also trying to figure out how to do eight.
Which I have not done well yet, is take each of these outputs of this hundred and now do something else with it. Now call again. And if you wanna do that, I'll start you off On the path of where I am now, there's a hundred things here. I'm gonna add a column to the right. I'm actually gonna do two columns because I'm gonna add column B here.
And what column D is going to be is just check boxes. Let's just do insert checkbox. We're gonna vertically align those and horizontally align them too. And in e I wanna say, instead of taking this prompt a one, actually I'm gonna add another column here. I'm gonna delete all of these check boxes. I can write another prompt here and say take the first write a.
Hook a persuasive hook for this Twitter thread. I'm just gonna write that. That's all I'm gonna write. Now here. I'm gonna say ai. Take D one and C one. That was the response of the last one, right? C one is here and we're going to, oh, see, there it is. And it's loading. And here we go. We have some answer, right?
This might not be a great answer. Write a persuasive hook in less than 50 characters. I don't, this might be terrible, but it shows you that we can edit this and now we can take Oh, we have some. Yeah. Don, we want to write for this Twitter thread. We're gonna do this at the end, write at the hook for this sort of fit.
And then before this write a piece of hook in lesson 50 characters. Do not include any hashtags. See we can start editing this prompt to see this response and we're gonna get it here, there. Secure your financial future today. Learn how to save money. Cool. That is okay. It's probably not great, but why did I put this check box?
It's because anytime I copy and paste this down, I'm gonna have the answer right away. But if I do not have the answer in C1 yet, if I have not created the input for it, then it's going to run the AI call. With the words loading or with a blank, it's just gonna try to do an API call. So what, in the case of c1, in the C column, we said if B one is blank, but if we do, if C1 is blank, it's gonna be blank.
It's never gonna be blank. Cuz there's gonna be, there is going to be a formula there, there's gonna be something there. So I added a checkbox here. Now this might not be the greatest flow on earth. This is just where I am at this moment in time with how to do these sort of workflows and gate keep sort create gates for these so we can write around ai if.
E one and we just have to do E one. E one is either gonna be true or false. Check boxes in Google sheets are amazing. They're just true or false statements. It's just a visual representation of true or false. So if the value is true, if it is checked off, we will get ai, DC one, D one and C one. If we want a false, let's just let's write a little message, check off the box to get a response.
That's what we wanna say. And do we want to auto fill? Sure. So now all of these say check off the box to get a response. We can center this up as well. Yeah. And now I think you might have noticed one thing is I did not make D one the same, so I can add a dollar sign in front of the D and the dollar sign in front of the one.
And now, The copy paste is down the way down, and now E five, E one and C1 will change to E two, c2 blah, blah, all the way down. And we have the same prompt. Now what's cool too, is we can take these prompts and move them to another tab altogether. We don't need to reference these cells on this same sheet.
So to organize this in a little bit better way, we could probably put a little prompt sheet together and say, here's the first prompt. Here's the second prompt. Here's the third prompt. Take the response of this one prompt. Put it in here. Take this response, put it in here. And we can now start, right to create these.
Processes and these flows across this a hundred different ways with just executing a couple words, a few words of a different topic. We can write an epic one shot prompt, change it for to. With these inputs, we can get an output here. Then we can take this output and make another AI call here with a little bit of a checkbox, right?
And checkbox being a real check. We can look at this and we can say, is this what I want to do? Is this the correct response? Yes. If it is, check it off. I'm gonna get that hook n go to the next one. Here's an introduction. Main points conclusion. Do I like it? Yes. Check it off. I want the hook, right? We can go down and if not, let's go and edit this input.
Let's go edit the input to get the response. We want to then get the hook we want to get, then get whatever. Maybe we then write the introduction based on this. We write the hook, then the introduction, then we take the main point and create a tweet from it. Then take the second point, create a tweet out of it.
We can harness. Chat, G P T and open AI's API, all within the sheet in a very. In your kit workflow with these really cool really simple Google sheet additives, right? With a checkbox with a, if with is blank, we can use this API call to do so many things, the world is infinite here, right?
And we can write so many cool things here and we can go down. To like less characters. We can go up, we can start writing, based on this tweet, write a blog post with this title, write a title, create the slug for it. We can do all of these different things within here in this sheet at a hundred times, right?
This is crazy, right? And I hope you enjoyed this video. If you are a better Sheets member in watching this, you get this sheet. Down below if you're watching this somewhere else become a Better Sheets member today and get this sheet with the sheet. You get, the API access, you get not the API access, you get the API call, the a app script I've written.
All you have to do is overhear on the API key tab, put in your API key. That's probably the hardest part of all of this. And I hope you enjoyed seeing. You can run a hundred different chat GPTs all at once inside one sheet on Google Sheets. Again, if you're looking just for the api in app script, it's in the video.
Upgrade Google Sheets, open ai, prompt two, GPT four. So I did write one for GPT three first, and on this one, upgrades it to G P T four. So go ahead, grab it if you're a member. And if you're not a member, become a member today. Bye.