ChatGPT directly integrated into Google Docs ๐
OpenAI just added a new security challenge. the extension will not work for a while
Notes
Usage
Run your own ChatGPT API (Devs only)
Credits
This is still in development. There may be times when it doesn't work, because of OpenAI's overloads. I made this at 4 am, so I might not have the best error handlings, but I'll be fixing all that within the next few days.
You can choose to either do everything locally, or just use a premade template document I have, and make a copy of that.
Skip to the USAGE section if you are using the PREMADE TEMPLATE.
Template document with ChatGPT integrated: https://docs.google.com/document/d/1N7qvw5mZdVe2u2IQ5pnVDmUjHsLEfq9_Z0Tf8PHloZA/edit?usp=sharing
This project is unofficial, and an unofficial ChatGPT api (revChatGPT) is being used for this. Will be updated when OpenAI releases ChatGPT as a full API.
- Google Docs
- MS Word
-
Get the template: https://docs.google.com/document/d/1N7qvw5mZdVe2u2IQ5pnVDmUjHsLEfq9_Z0Tf8PHloZA/edit?usp=sharing
-
Make a copy of the document
- Type something in your Google Doc
- Select your question, or whatever text you want to send to ChatGPT
- Use the extension!
- Accept the Authorization request & sign into google
- Click Advanced, go to ChatGPT & allow the scopes required
- Get your result!
-
Open a new word document
-
Enable the Developer Tab on Word
-
Copy the code in
wordGPT/ask.bas
of this repo, and paste it into the Word VBA Editor -
Click OK and Save the file containing the code you pasted.
-
Right click selected text in Word and click
Ask ChatGPT
- Wait for your result! (Word may become temporarily unresponsive while waiting for the result)
Follow this guide if you don't want to use my premade template, and want to start a ChatGPT REST API server of your own!
- Clone this repo with
git clone https://github.com/cesarhuret/docGPT.git
- Visit https://chat.openai.com/chat and log in or sign up
- Rename
.env.example
to.env
- Get your OpenAI email and password, and insert them into the
.env
file.
- Set up and host the web server:
cd server
## Install Requirements
pip install -r requirements.txt
## Run the server
python server.py
-
Make sure you have docker installed and running
-
Build your docker image
cd server
#Build the image
docker build -t chatgpt-api
- Run your docker image
docker run -p 8080:8080 -e email=YOUR_EMAIL_GOES_HERE -e password=YOUR_PASSWORD_GOES_HERE chatgpt-api
- Send a POST request to
https://docgpt.kesarx.repl.co/chat
with an application/json body:
{
'message': 'Your questions go here'
}
- returns a string:
"here's the response to your question"
-
Get the URL of the server. Ex: http://localhost:8080/chat
-
Enter your server URL into the Google Docs add-on script.
-
Google Docs
- Go to Google Docs and create a new document.
- Click on Extension > Apps Script
- Copy the contents of
add-on/ask.js
into the script editor - Replace the
SERVER_URL
variable with your server URL - Save the script
- Go back to the Google Doc and refresh the page
- Click on Extension -
ChatGPT
should be visible under Apps Script