A google docs editor extension that uses GPT3 completions and edit APIs to allow the user to use Natural language editing in situ.
This quickstart creates a Google Docs Editor Add-on that allows the user to use Natural language editing in situ.
- Set up the script.
- Run the script.
- Use the script for your preferred use case.
To use this example, you need the following prerequisites:
- A Google Account (Google Workspace accounts might require administrator approval).
- A web browser with access to the internet.
- An OpenAI API Key >> Sign up here if neededSign Up.
- Create a Google Docs document at docs.new.
- Click Extensions > Apps Script.
- Click Untitled project.
- Rename the Apps Script project Tag1n and click Rename.
- Next to the
Code.gsfile, click More more_vert > Rename. Name the fileTAGmain. - Click Add a file add > HTML. Name the file
sidebar. - Replace the contents of each file with the corresponding code found in this repo, then click Save
.
- In your Docs document, reload the page.
- Click Extensions > Add-ons > Tag In > Start.
- When prompted, authorize the add-on.
- Again, click Extensions > Add-ons > Tag In > Start. This should only occur on first run.
- Copy your OpenAI API key into the field: Your OpenAI API Key
- Type some text into your document and select it.
- In the Sidebar, Type your editing instructions in the field: What would you like to create?:
- Click Edit. To replace the text in the document, click Insert.
- In the Sidebar, Type your request in the field: What would you like to create?:
- Click Generate. To place the text in the document, click Insert. Text will be inserted at the location of the cursor.