Ads by adsterra

How To Integrate ChatGPT with Google Sheet

Code For Appscript

Paste Below Code In AppScript and Run the run function and in google sheet column type the custom =Chat("Your Questions Here") formula and press Enter.

const apiKey = "YOUR_OPEN_AI_API_KEY_HERE";
function run(){
function Chat(question){
  let payload = {
  "model": "text-davinci-003",
  "prompt": `${question}`,
  "temperature": 0.7,
  "max_tokens": 256,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0
let options = {
    "Authorization":"Bearer "+apiKey,
let req = UrlFetchApp.fetch("",options)
let res = JSON.parse(req).choices[0].text;
return res;

appsscript chat gpt google sheet
Newer Post Older Post Home

Popular Posts