ChatGPT API in Google Sheets Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

To avoid redundancy of similar questions in the comments section, we kindly ask /u/dulldata to respond to this comment with the prompt you used to generate the output in this post, so that others may also try it out.

While you're here, we have a public discord server. We have a free Chatgpt bot, Bing chat bot and AI image generator bot.

So why not join us?

Ignore this comment if your post doesn't have a prompt.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

👍︎︎ 1 👤︎︎ u/AutoModerator 📅︎︎ Mar 04 2023 🗫︎ replies
Captions
hey what's up coders welcome to one little coder based on popular request I decided to make a video about chat GPT inside Google sheet Yes we made it possible that now you can use charge apt within Google sheet and a lot of people have been telling me that for SEO uh search engine optimization are people who are working in that field at least Google sheet is the main thing where they do a lot of stuff so I thought okay can I take an SEO example and then try to make a video so in this video we're going to see in one particular cell in a Google sheet if you have a word can we use charge DPT to generate multiple keywords based on that award this is quite important like if you're going to run let's say Google AdWords campaign if you want to write a Content article if you want to reach out to content marketers so this is quite important thing in SEO world where you want to detect keywords from existing um paragraph or you want to generate new keywords based on which you can run campaigns so this example is going to tell you this video is going to tell you how you can integrate chargpt you have to bring your own key BYO okay bring your own key and I've got multiple videos before where I've shown you how to get the key so I'm not going to focus on that in this but we are going to go through the line by line of apps script that is going to enable us include charge GPT inside Google sheet it's it's pretty exciting I'm going to show you the demo first thing all you have to do is go click here uh first okay let me remove everything and I'm going to show you a keyword here so the keyword here could be let's say data science okay data science is my keyword and I'm going to select this here that's quite important because whatever you have selected that's going to be used I'm going to select this go to charge GPT click generate keywords once I do that it is going to run the script and it has given me 10 new keywords that are related to data science now maybe you know what this is quite uh like a common thing let me pick a a simple Niche I'm going to say I'm going to say options and options and commodities should I say Equity equity and securities Securities okay equity and securities go to charge gbt click generate keywords and then let's see what happens now so okay it has done stock stocks and bonds Investment Portfolio Financial assets Capital Market shareholder Equity security trading asset allocation and you can customize this completely based on whatever you want and that is the whole point of this video to teach you how to do this for your own need as the cliched statement goes I'm not here to give you the fish I'm here to teach you how to fish so let's get started with the code so first thing that you need to do is you need to go to the Google sheet and open a new sheet go to extensions and click apps script once you click click apps script you would reach this particular place where you can enter this entire script you do not have to take notes I'm going to link this entire script in my GitHub repository and Link that in the YouTube description just below the like button so you can directly use it you don't have to be worried about it I'm going to show you every single section of this particular Google apps script that will help you modify the script in the future if you want the first section is where we are going to Define our model key opening APA key and also the model name so this is the charge gbt model if you have if you want to use different model you can use it but I think at this point it doesn't make any sense to use a different model given how cheap it is like probably um I I don't think anybody would use text DaVinci there are certain advantages of using a GPT 3.5 where's the strategy PT model but at least I would suggest you to use chargpt model this is the place where you enter the APA key which you are going to get from open a account this is where you have specified the model name you don't have to change it now this is the section we are going to actually let me zoom in this is the section we are actually creating the UI in itself the UI that you see here this button and this one this is where we are creating so we are creating a new UI in the menu called create chargpt and then we are adding an item saying okay generate keywords so I'm going to show you how to add another particular function so first let's see the entire code then we'll update the code for our new menu item so it's easier for you to do it whenever you need it so this is the place where we have added the menu item the front and UI now we are going to go to the backend so any UI item that you add is going to be tied up with the function so in this case the function name is generate keywords as you know if you are familiar with programming you cannot have spaces in the function name so that's why you can see in the menu name which is customer facing we have a space in the generated keywords we don't have a space the next thing is we have the function created generate keywords here we are going to go to the particular sheet from that particular sheet you are going to pick the text from that particular cell where like the active range whatever you have selected and we are creating a prompt we are saying that generate 10 keywords similar to this keyword and this is where the selected text this text that we have selected goes in the temperature and token I still stuck with 2000 words or 2000 sorry tokens but charging PT model can do approximately around 4000 ish so you can you can play with that if you are going to give a bunch of text so now we have got a request body inside the request body we are going to create the request that we want to send it to the charge GPT API you can see that the model type is there the message is where we build the message like a conversational message and then temperature is going to help you with creativity from zero to one you can play with that maximum number of tokens that you want to see currently temperature is zero once the request body is ready we need to Now set the request header or request options um the request type is post request and the header contains it's a Json request application Json content type and then we have got the bearer API keys so the API key comes from here and then the entire thing goes as a payload that's what the entire body now this is the place where we want to request it from this is again open a endpoint for charge GPT completions the import name is completions it's for chargpt once once the request is sent it's going to send a response back now you need to collect the response and go to the particular place where you're going to get the content and add the content to the last section after the last row you're going to add this is the existing code now what I'm going to do is I'm going to create a new menu item so it is easier for you to add a new menu item so I'm going to go here and then say first add a new menu item now what should be this menu item this should be generate it's a create one line Learners or I should say add copy add copy okay so generate add copy and now create a new function here I want to paste this function just above this so it's easier to see I'm going to call the function generate ad copy and I'm going to after I call the function generated ad copy the next thing that I'm going to do is generate five add copies five Google AdWords copies for this keyword okay done and I'm going to save so every time you have to save and run and every time you open a new Google sheet you have to do this as well otherwise you have to deploy it I'm not getting into the complexity assuming that this is going to be used individually so then a code is done delete everything so let me give artificial intelligence intelligence go to the charge GPD menu click create add copy so I've clicked create add copy so I assume it's going to discover the power of artificial intelligence get started today I transform your business with EI unlock the potential of AI revolutionize your industry with artificial intelligence hardness the power of e a i so that's quite good it's quite good let's look at one more example before we wrap up the video I'm going to say subscribe to one little coder who makes AI videos this is not necessarily a keyword but I still assume that given the prompts that we have designed it is going to work fine let's see how it goes get latest AI insights from one little coder subscribe now stay ahead of the game with one little quotas AI video subscribe today unlock the power of AI with the only little coder subscribe for exclusive content join the AI Revolution don't miss out on one little quota's AI video subscribe now for free good I should probably use this to advertise my channel but for now I think this is good enough for anybody to get started with integrating chargpt inside their Google sheet for their professional workflow the script will be linked in the YouTube description completely for free you all you have to do is get your own open a key and customize the script in the way you want and let me know if you have any questions and um and yeah thank you thank you so much for all the support in the recent time and I really appreciate it see you in the next video peace
Info
Channel: 1littlecoder
Views: 9,866
Rating: undefined out of 5
Keywords:
Id: HOdFRKs_eqk
Channel Id: undefined
Length: 9min 10sec (550 seconds)
Published: Sat Mar 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.