Skip to content

Instantly share code, notes, and snippets.

View eshelman's full-sized avatar

Eliot Eshelman eshelman

View GitHub Profile
@eshelman
eshelman / queryChatGPT.js
Last active April 1, 2023 15:18
Function for Google's AppScripts inside of Sheets - call OpenAI ChatGPT API
//
// Connect Google Sheets with OpenAI's GPT services
//
// WARNING: Sheets periodically re-evaluates cell contents. Some effort to minimize the effect is included in the code,
// but you will continue to rack up charges even if you are not making changes to the cells.
//
//
// The OpenAI API documentation is here:
// https://beta.openai.com/docs/api-reference/making-requests
//