Skip to content

Integration of ChatGPT within Excel and planned for other Office 365 apps. This product is an independent development and is not endorsed or affiliated with Microsoft or OpenAI.

License

Notifications You must be signed in to change notification settings

laked0601/365GPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

365GPT

📌 Description

Integration of ChatGPT within Excel and planned for other Office 365 apps. This product is an independent development and is not endorsed or affiliated with Microsoft or OpenAI.

365GPT integrates ChatGPT into Excel using the OpenAI REST API and ChatCompletion endpoint. It has many use cases, but may best be used for generating repeated queries from ChatGPT in a tabulated data format, hence being used in Excel.

📁 Installation

  • Installing the VBA Module
  1. Create a new Excel Workbook and save it as an Excel Macro Enabled (.xlsm) file.
  2. Download "OpenAI.bas".
  3. On the first sheet you have open in the workbook, right-click, and then select "View Code".
  4. In the new window that opens, click File, then Import File.
  5. Navigate to where you downloaded OpenAI.bas, select it, then click Open.
  6. Save your workbook - this completes the installation.
  • Getting Your OpenAI Key
  1. Navigate to https://platform.openai.com/.
  2. Create your account, or sign in to your existing one.
  3. In the top right, click on your profile, then select "View API keys".
  4. This page lists your existing API keys. If you have a key you want to use, select it from this dropdown. Otherwise, select "Create new secret key" and copy the value. It should look like "sk-.....".
  5. Go into the (.xlsm) file you created earlier, in any empty cell type "=SetOpenAIKey(*YOUR_API_KEY*)" with the secret key you just copied.
  6. To test if this was assigned correctly, in a new empty cell, type "=GetOpenAIKey()". The resulting value should be the key you saved.
  7. In the case this doesn't work, you will need to include the key in all of your queries as the second parameter. For example: "=ChatCompletion('What President is on the $1 bill?', *YOUR_API_KEY*)".

⚠️ Known Limitations

  • Each query made with the function =ChatCompletion() uses OpenAI tokens, which are chargeable at the rates set by OpenAI for GPT-3.5 Turbo - 4k context. For more information, please read https://openai.com/pricing. As such, it is recommended to take actions like disabling auto-function renewal, pasting function output as text once completed, and limiting excessive function calls.
  • Certain non-standard characters may not be parsed correctly as JSON when running a query. It is recommended that all new line and tab characters (CHAR(10) and CHAR(9)) are converted to their JSON safe equivalents ('\n', '\t') beforehand.

About

Integration of ChatGPT within Excel and planned for other Office 365 apps. This product is an independent development and is not endorsed or affiliated with Microsoft or OpenAI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages