How to integrate ChatGPT API with Google Slides - AI Presentation

1littlecoder · Intermediate ·🛠️ AI Tools & Apps ·3y ago

Key Takeaways

This video teaches integrating ChatGPT API with Google Slides to build an AI Presentation Creator

Full Transcript

hey what's up coders welcome to one little coder in this chat GPT API tutorial we are going to learn how to integrate charging PT API with Google Slides so if you want to make a slide and if you want AI written content you don't have to leave your Google slide rather you can stay within the Google slide and then create AI generated content within your Google slide if you're making presentation in this series we have already covered Google Docs and Google Excel like Google spreadsheet I'm sorry you can definitely check that out and today we are going to learn how to do the same for Google Slides so that we complete this triology so first I would like to show you a quick demo then we are going to go through the Code walkthrough at the end of this video we will also do a new menu item where we'll completely um for example right now you can see that I've got one item here but we will completely do a new item so that you learn how to add it yourself if you want to change something the first thing is it's ever slide and I'm going to I'm going to Simply write something um what do I have to write data science so this is data engineering and after this I'm going to go maybe I'll keep it slightly on the top because it's going to insert the bottom click charge gbt and then click generate prompt and then once I click generate prompt it is going to take some time because it's going to collect this text send it to open AI get it back and then here it is so all I have to do is little bit of formatting here and there and then move it down and then we delete the existing one that's it we have a i generated content right within our Google slide and let's learn how to do this as usual if you have been seeing the other series Google Docs and Google spreadsheet you know that the first thing that you need to do is you need to have open AI APA token I've already extensively covered it in the previous video so kindly check it out so assuming that you have open a APA token first go click extensions and click apps script once you click apps script you will get to this particular screen this entire JavaScript code will be linked in the YouTube description from my GitHub repository so you can directly copy paste from that so you don't have to be worried about it so now let me explain what this code contains so the first thing is we are going to define the API key and also we're going to define the charge GPT model next we are going to create a new menu item called chat GPT that is exactly this menu item that you see here and menu first menu and then you are going to create an item within that menu that is generate prompt so you click this menu you get to see generate prompt and then you're going to do that's that's basically what you have within the slide after that is where the actual thing starts where you're going to First Look for the active presentation within that you are going to find what we have selected so how does chat GPT know on which topic you want to write something so whatever you have selected using the mouse that is going to be that that is the text that is going to be used to create or to give it to charge GPT and generate AI written content so that's something that to keep in mind so presentation get the presentation get the selected text and then get the slide the slide in itself then use the selected text I don't think the slide is used here anywhere app I use the slide to insert final cool so then get the slide okay so presentation selected text get the slide once you have the slide then you need to create a prompt so how do you create a prompt in this case The Prompt here goes like this generate three points on whatever the selected text is so if my selected text says Elon Musk then it generate three points on Elon Musk if my selected text goes like this open AI charge GPT then my prompt goes like this generate three points on open a charge GPT so that's how this thing works then set the temperature play with the maximum tokens like I've said previously charge apt is scope the context is more than 4000 tokens but I'm still sticking with 2000 tokens then you have to create the request body so anytime you have an API you have to send the request and I get a response back so here we are composing the request that has to be gone so while we are composing the request there are two things one is the request body in itself second one is the request option so request body will contain all the essential information request options will say what type of request it is what is the authentication what those kind of information so now what is in the request body we have got the model we have got the messages we have got the temperature and we've got Max tokens so the prompt that we created is now part of the messages which which looks like this and then send to chatgpt and then we have got the request options where we are saying that this is a post method and then we are we have the authentication here and the entire thing which we created as request body is put inside here now this is the end point where open a API is present we're going to collect the response get the response after you get the response now take that response and then pass it as Json go to the exact place where you have got the content like the response content which is inside choices the first element message and content and get that and if you if you want you know for logging you can keep it logging otherwise you can comment it finally take that entire text insert into a new text box so whenever you go here like for example and then go to insert and insert a new text box Whatever Gets inserted that is exactly what we are doing there so this entire thing what we just did go here click this click this click this is what we are automatically doing there using the text that chargpt returned us so we have a text that is here that text is now sent to chat GPT to create more text that text is now inserted as a text box and that's why you saw like a small text box group created now let me show you the workflow once again so that you can understand the code so I'm going to insert new text new slide Auto make it slightly above and then I'm going to say let's say data engineering is the best and I'm going to say generate prompt now it's going to create a new text box inside this slide with the three points that charge APD written so I'm going to delete the existing one move this and slide it down that's it the old one you don't need and oops old one you don't need and you have got the three points right now as you can see I'm not formatting I'm not I'm not splitting into multiple slits I'm not doing anything I'm doing the bare minimum basic because I wanted to get the video out to you so that you can customize it as much as you want if you know a little bit of apps script even using Google documents there's documents that you have got you can play with the documents and then you can play with a lot of options but for now this does the best now I'm going to show you how we can add a new menu item and then add a different prompt so that you know what to change way to change if you get the code for the first time like my code the first thing that you need to change is you need to change the API key please never share your API key with anybody I'm going to revoke this API key after this is done so you'll not be able to use this API key even if you do screen capture but never share your API key that's the first thing next I want to create a new menu item so go to this line number eight create a new menu item I'm going to call this menu item generate tweets and I'm going to call this generate tweets every menu item has to be linked with the function otherwise the menu item is not going to work so that's why you can see this menu item is linked with this function this menu item has this linked with this function at this point we can save and run but nothing will happen when we click the menu item because it will say this function does not exist now so now let's create this function to make it easier we're going to literally copy this function paste it just above this and then we are going to go say generate tweets so this one is basically this okay so this one is this so we have added a new menu item and then we are calling we are asking you to call the function generate tweets and that function is this now inside this is the only change I'm going to make is I'm going to change the prompt so instead of generate three points I'm going to say generate three tweets on this so charge apt knows when you ask you to generate tweets it knows that it has to generate three tweets now everything else is going to stay the same if you want like instead of text box if you want like a let's say shape also you can insert you can do all those inserting things here based on whatever you want like for example in a shape you want like a text you can do that here for now I'm going to stick to the same insert a text box with the text and then save the project once I save the project you have to run it after you run it go back to your presentation just make sure that this executes for fine after that go back to your presentation and click a new slide if you if you want new slide and then just what do I want to do I want to say let's say data engineering is the best the same thing that we just gave and I'm going to probably even delete it I don't need this click this chart GPT generate tweets so now at the end of this this is going to insert a text box here in this particular slide with whatever we just ask for which is three tweets three tweets so you've got three tweets data engineering is the backbone of any successful data driven organization we've got hashtags you've got tweets this is exactly what we set out to do at the start of this video where we have successfully integrated charge GPT with Google slide also we have learned how to customize this code if you want to add a new menu item so I hope this video was helpful to you in learning how to integrate chat GPT within Google slide to create AI generated content within your Google slide if you have any questions let me know in the comment section otherwise I'll link this code in the YouTube description I mean in GitHub and then YouTube description you can directly copy paste and then start working on it any questions let me know in the comments otherwise see you in the next video peace

Original Description

In this Tutorial, We will learn how to build your own AI Presentation Creator with ChatGPT API on Google Slides. This video covers the following tutorials: 1. Apps Script of Google Docs 2. Code Walkthrough of ChatGPT Apps Script 3. Final Demo of ChatGPT inside Google Slides Create ChatGPT API Key here - https://platform.openai.com/account/api-keys Full Code https://github.com/amrrs/chatgpt-google-slides/blob/main/appscript.js ❤️ If you want to support the channel ❤️ Support here: Patreon - https://www.patreon.com/1littlecoder/ Ko-Fi - https://ko-fi.com/1littlecoder
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from 1littlecoder · 1littlecoder · 0 of 60

← Previous Next →
1 How to create your Free Data Science Blog on Github with Fastpages from Fastai
How to create your Free Data Science Blog on Github with Fastpages from Fastai
1littlecoder
2 Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
Making Interactive Matplotlib Plots for Data Science Visualizations on Jupyter (Python)
1littlecoder
3 Create your first Data Science Web App using R Shiny
Create your first Data Science Web App using R Shiny
1littlecoder
4 How to create a Reproducible Example in R using reprex
How to create a Reproducible Example in R using reprex
1littlecoder
5 No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
No Code Visualization using esquisse with Tableau-like Drag and Drop GUI in R
1littlecoder
6 Scrape HTML Table using rvest and Process them for insights using tidyverse in R
Scrape HTML Table using rvest and Process them for insights using tidyverse in R
1littlecoder
7 Google Teachable Machine Learning Build No Code AI solution
Google Teachable Machine Learning Build No Code AI solution
1littlecoder
8 Create meaningful fake tidy datasets in R using fakir [#rstats Package]
Create meaningful fake tidy datasets in R using fakir [#rstats Package]
1littlecoder
9 How to enable using R Programming with Visual Studio VS Code
How to enable using R Programming with Visual Studio VS Code
1littlecoder
10 Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
Python, Community, Books - with Abhiram R - Bangpypers Co-organizers | 1littlecoder podcast
1littlecoder
11 Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
Growing a Tech Community across India - Anubha Maneshwar, Founder Girlscript | 1littlecoder Podcast
1littlecoder
12 Intro to Google Colab - How to use Colab
Intro to Google Colab - How to use Colab
1littlecoder
13 Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
Intro to Plotly Express - Complex Interactive Charts with One-Line of Python Code
1littlecoder
14 Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
Indic NLP Python Toolkit Open Source Development - iNLTK Creator Gaurav Arora | 1littlecoder Podcast
1littlecoder
15 Do you want a career in Data Science - Tamil Webinar
Do you want a career in Data Science - Tamil Webinar
1littlecoder
16 Android Smartphone Analysis in R [Live Coding Screencast]
Android Smartphone Analysis in R [Live Coding Screencast]
1littlecoder
17 Programmatically create Images, Memes, Watermarks using Python with imgmaker
Programmatically create Images, Memes, Watermarks using Python with imgmaker
1littlecoder
18 Kaggle Walkthrough to get you started with Data Science - Webinar
Kaggle Walkthrough to get you started with Data Science - Webinar
1littlecoder
19 Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
Community, Corporate Job, Coding - Gnana Lakshmi T C aka Gyan, WomenWhoCode Leadership Fellow
1littlecoder
20 Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
Easy ggplot2 Theme Customization with {ggeasy} | Data Visualization in R
1littlecoder
21 Excel to R - Pivot + Bar Chart in Excel  & R using tidyverse [Live Coding]
Excel to R - Pivot + Bar Chart in Excel & R using tidyverse [Live Coding]
1littlecoder
22 Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
Excel to R #2 - VLOOKUP in Excel to LEFT_JOIN, MERGE in R
1littlecoder
23 5 websites to get Free Real-World Datasets for Data Science/ML Projects
5 websites to get Free Real-World Datasets for Data Science/ML Projects
1littlecoder
24 Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
Excel to R #3 - APPROXIMATE VLOOKUP in Excel to FUZZY LEFT_JOIN in R
1littlecoder
25 Correlation-alternative PPS (Predictive Power Score) Python Package Demo
Correlation-alternative PPS (Predictive Power Score) Python Package Demo
1littlecoder
26 Automated Website Screenshots in R using {webshot}
Automated Website Screenshots in R using {webshot}
1littlecoder
27 Installing Custom RStudio Theme (Synthwave85)
Installing Custom RStudio Theme (Synthwave85)
1littlecoder
28 Analyse Google Trends Search Data in R using {gtrendsR}
Analyse Google Trends Search Data in R using {gtrendsR}
1littlecoder
29 3 Tips to ask question on Stack Overflow the right way to get answers
3 Tips to ask question on Stack Overflow the right way to get answers
1littlecoder
30 Learn Data Science with R - Mini Projects - Web Scraping Zomato
Learn Data Science with R - Mini Projects - Web Scraping Zomato
1littlecoder
31 Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
Easily make Dumbbell Chart using {ggcharts} | Data Visualization in R
1littlecoder
32 GET Hackernews Front Page Results using REST API in R
GET Hackernews Front Page Results using REST API in R
1littlecoder
33 Quickly deploy ML WebApps from Google Colab using ngrok
Quickly deploy ML WebApps from Google Colab using ngrok
1littlecoder
34 Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
Use Jupyter Notebooks within VSCode (Visual Studio Code) in 2020
1littlecoder
35 Plotly Interactive Plots as Pandas Plotting Backend df.plot()
Plotly Interactive Plots as Pandas Plotting Backend df.plot()
1littlecoder
36 Stack Overflow Developer Survey 2020 Highlights for New Programmers
Stack Overflow Developer Survey 2020 Highlights for New Programmers
1littlecoder
37 Matplotlib Animation Charts in Python using Celluloid
Matplotlib Animation Charts in Python using Celluloid
1littlecoder
38 Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
Coding, Postwoman, Passion Project Book - Liyas Thomas Open Source Developer - 1littlecoder podcast
1littlecoder
39 Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
Aspiring Data Scientist, Tips on How to learn Business Domain Knowledge
1littlecoder
40 Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
Bokeh Interactive Charts as Pandas Plotting Backend df.plot_bokeh()
1littlecoder
41 Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
Easy Fast Python Pandas Summary with Sidetable | Pandas Tips & Tricks
1littlecoder
42 Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
Inception, Content Ideas, Consistency - Srivatsan Srinivasan AIEngineering YouTube Content Creator
1littlecoder
43 ggplot2 Text Customization with ggtext | Data Visualization in R
ggplot2 Text Customization with ggtext | Data Visualization in R
1littlecoder
44 Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
Penguins Dataset Overview - iris alternative | EDA Data Visualization in R
1littlecoder
45 YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
YouTube Growth Tips, Content Creation - Bhavesh Bhatt, YouTuber (Data Science & Machine Learning) #7
1littlecoder
46 Matplotlib Animated Bar Chart Race in Python | Data Visualization
Matplotlib Animated Bar Chart Race in Python | Data Visualization
1littlecoder
47 Simple Python GUI Development using {guietta}
Simple Python GUI Development using {guietta}
1littlecoder
48 #8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
#8 Niche, Growth, Monetization - David Langer - YouTuber Dave on Data
1littlecoder
49 Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
Simple Fast 3-step Python OCR using Deep Learning 40+ Languages
1littlecoder
50 Github New Feature Profile Summary/Mini-Resume - Profile Views
Github New Feature Profile Summary/Mini-Resume - Profile Views
1littlecoder
51 Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
Otto ML Assistant, GPT-3 on Philosophers, Nvidia-ARM - 3 ML Tech News
1littlecoder
52 What is OpenAI GPT-3 - Hype, Examples, Worries
What is OpenAI GPT-3 - Hype, Examples, Worries
1littlecoder
53 Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
Julia 1.5, Datamuse API, Live HDR+ Pixel 4a - Machine Learning Tech News
1littlecoder
54 Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
Self-driving Car Engineer sentenced, arXiv Dataset, AI/ML Startup Idea - Machine Learning Tech News
1littlecoder
55 GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
GPT-3 Explorer, Ciphey (Automated Decryption), Py-Sudoku - ML Tech News
1littlecoder
56 How to use Advanced Google Search to extract Email Ids from Linkedin
How to use Advanced Google Search to extract Email Ids from Linkedin
1littlecoder
57 Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
Cartoonizer Toon-IT (AI Web App), GPT-3 Advice, Android Earthquake Detection - ML Tech News
1littlecoder
58 Flow - R Package to visualize code logic, functions as a Flow Diagram
Flow - R Package to visualize code logic, functions as a Flow Diagram
1littlecoder
59 Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
Build GPT-3-like Language Model on Google Colab with minGPT [PyTorch]
1littlecoder
60 Create a Pencil Sketch Portrait with Python OpenCV
Create a Pencil Sketch Portrait with Python OpenCV
1littlecoder

Related Reads

Up next
What is OAuth 2 0 Explained with Examples
VLR Software Training
Watch →