Alternative title:
Accessing OpenAI from Google Sheets (using Google Apps Script and a custom formula)
I have found some examples around but didn’t quite fit my requirements.
In particular, I needed:
- Prevent multiple calls, which will consume your credit very fast.
- Flexibility in what is provided as prompt (a single string, selection of cells, etc)
- Granularity: Be able to go down to specific parameters if needed (temperature, max tokens, etc.)
This post and video with script got the ball rolling, but I had to do much more after that.