AI Blog: OpenAI API (ChatGPT and DALL-E 2) with Google Doc (Google Apps Script)
📢 The updated video with GPT-4/GPT 3.5 Turbo 👉🏼 • OpenAI GPT-4/GPT 3.5 T...
In this video, we'll show you how to integrate the OpenAI Chat GPT language model and DALL-E2 with Google Docs using Google Apps Script to generate a blog post with AI assistance. Using the GPT model, you'll be able to input a topic and some initial text, and the model will generate additional content based on that input. With this integration, you'll be able to produce high-quality blog content quickly and easily, all with the help of artificial intelligence. Whether you're a blogger, content creator, or just looking to experiment with AI writing, this tutorial is for you. So watch the video and start generating blog content with the help of OpenAI Chat GPT and Google Docs today!
Generate OpenAI API key from here:
beta.openai.com/account/api-keys
Link to code used:
github.com/MAN1986/LearningOr...
#openai #chatgpt #aiblog #ai
Thanks for sharing. How cool is this. I'm using it right away.
Glad you like it!
hello do you know if i could do the same with an artificial intelligence like mini GPT?
Thanks for linking to your script. I just tried it and it works as intended. I commented out the image generator part as the images I was getting were generally irrelevant or poor and a quick Google image search was easier. As for the text, the script works better for me than the open ai playground web interface (fewer errors) but I seem to be the only person in the world to be unimpressed with the output generated by open ai (worse than the repetitive nonsense churned out by disinterested typers on fiver). I genuinely hope Google filters auto-blogs out of its search results until the technology can proceed beyond forming well written sentences of garbage content, there's more than enough dross on the web already.
Let's hope the next versions are more powerful :)
Well I'm short of words for your this effort. Thanks so much for bringing this quality stuff. Keep bringing such awesome content.
Thanks, will do!
great vid, very helpful and well explained! thx
Glad it was helpful!
Thanks for the video, this gave me an idea. Create a form for potential clients or customers to answer some questions. Use those questions to generate a unique and custom response, email that response to the potential client or customer and invite them to schedule a call.
Yes of course this can be done.
it worked! Thank you.
You're welcome!
Great work! I was able to tweak the code to now do general commands, text, articles, bullet points and images. I'd like to also do proofread so I can send text for clarity spelling etc. But I can't get passed the max tokens (4097). Is there a way around this, or we have to just use ChatGPT?
Actually I forgot to mention that OpenAI API gives you free tokens initially and these tokens are used in API calls. I guess then tokens have been consumed. Please check the status of tokens at: beta.openai.com/account/usage
Wow! This is just awesome 🙌
Thank you 🙌
Amazing work ❤️
Thanks 😄
Muito obrigado meu amigo! Seu código me ajudou muito!
fico feliz em saber disso... 🙂
Thank you very much my friend
Thank you too 🙂
hello is it possible to do the same thing with another artificial intelligence? anyway thank you very much for your videos
Hello, What you mean by other AI? Anything having an API can be integrated.
@LearningOrbis I would like to do images to text, not ocr, but I'm talking about minigpt, I ask him to describe me what's on the image in SEO then he sends all that in a Google sheet as I can do it with chatgpt the API key is a Google sheet module
English Plz
Great video - Sorry I am super new to this. How do I deploy this, so it's available in google docs?
Thank you. Please follow the steps provided in video.
Hi how we can made openAI API with Google sheets?
Great! Is there a script to just rewrite the headlines or titles of blog too? Can this be added to the current script?
Thank you. Yes of course we can update the script to include headlines and titles. If you see line number 13 of the code: var prompt = "Generate a detailed full length article about " + selectedText; You can replace the text "Generate a detailed full length article about " to anything like "Generate a detailed full length article with headlines and titles about " or ""Generate a list of ideas about" etc etc.
@@LearningOrbis That worked great. Think can really expand on this like a get a list of keywords and use those keywords in the blog, etc. So if the script could pull the keywords, from the title or vice versa and create the blog using keywords or some of the keywords or multiple variations
@@MedicalequipmentSpecialists Apakah bisa digabungkan antara + selectedText dengan Generate a list of ideas about
Hi any idea how to stop the image generation? I've tried commenting out the section but I don't seem to understand it fully cause its still bringing it up. Thank you very much in advance.
NVM it worked after some minutes. Now I'm only getting text generations. Might have been a caching issue or something. Thank you so much.
Happy to know that you got that. By the way, I have another video where I integrated Google Sheet with OpenAI API. There, you have option for text and image separately and you can fill the cells for different prompts and the script will generate the detailed text for all cells individually. Here is link : kzhead.info/sun/bK9ymKhoqYqFgYE/bejne.html
can you tell what tools you have used for voice?
Forget about this tool. In few minutes, I am uploading a full tutorial on Text to Speech converter by Microsoft. That is much better than this tool.
Here it is: kzhead.info/sun/a7yscqenhoKaaHk/bejne.html
Hi, thank you very, I have that problem: Exception: Hizmet bir gün içinde çok fazla defa çağırıldı: urlfetch. And second question is about Google Sheets. I want to put on a cell it, is it possible? And I need images url, can I take not image only image urls?
This is possible to get it implemented on Google Sheet
can you customize language when it return information?
Hi Thien, I guess this feature is not available yet. But I will check and let you know.
For some reason if I select even just 2 words from a paragraph of a document, it tries to send the whole document as a prompt. However, if I select a heading, it works just fine. It seems like the script is attaching some "parent text?" to the prompt.
**The Solution** function myFunction() { var doc = DocumentApp.getActiveDocument(); var selectedElements = doc.getSelection().getRangeElements(); var selectedText = ""; for (var i = 0; i < selectedElements.length; i++) { var element = selectedElements[i].getElement(); if (element.getType() === DocumentApp.ElementType.TEXT) { selectedText += element.asText().getText(); break; } } ... }
good jop👍
Is it possible to do this using the iPad google doc app? Or if I set this up on a pc can I use it on an iPad? Will it always consume tokens?
Do you see the menu bar on iPad?
@@LearningOrbis no there’s just a 3 dots thing to press and it doesn’t have the same options
What are options you see?
Also does anyone know an easy way to convert the table output from openai into a table in google docs?
Ask gpt for that specifically. To produce a table compatible with google docs
🤯👏
I'm grateful for your help, but the code does not run directly, it requires authorization, it says "This project requires your permission to access your data." Can this be avoided?
You need to allow that.
I keep getting error TypeError: Cannot read properties of null (reading 'getRangeElements')Details
found answer thanks
Forgot to highlight text
Glad to know that issue is resolved :)
getting an error "Sk not defined" ???
Seems strange. Does it indicate the line number? Can you send the complete error message?
Why does my google interface says the code that I've put into hasn't been authorized?
This is how Google Apps Script works. It issues security warning. Nothing to worry, simply need to authorize.
@@LearningOrbis Thanks, Now that I’ve saved and run the code, yet my toolbar still hasn’t generated a new menu, do you know what’s that about?
Refresh the browser and let me know.
@@LearningOrbis I’ve refreshed it many times, could it be that there’s something wrong with the code? But it does function. Nothing makes sense here.
Can you share the Google Doc link with my id : mahsan.naeem@gmail.com
I want to change the language
Hi, did you get some solution? I got one idea about this.
I'm missing a step or two, since the blog does not generate content.
Did you get some error?
@@LearningOrbis No just it does not load, but then again I am new.
Generate OpenAI API key from here: beta.openai.com/account/api-keys Go to Doc--> Extension-->Apps Script Copy the code there and replace "YOUR_API_KEY" with the key generated in step-1.
@@LearningOrbis No my friend it did no work. Maybe I am missing some setting that I don't know.