ChatGPT directly integrated into Google Docs 📑
Feel free to make any pull requests to update this project. I will review and then approve them.Thank you to the wonderful devs who are building ChatGPT APIs!
Feel free to rebuild this project with these APIs!
Notes
Usage
Run your own ChatGPT API (Devs only)
Credits
- 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