Skip to content

Instantly share code, notes, and snippets.

@jeriko
Created July 6, 2022 14:52
Show Gist options
  • Save jeriko/d454571a87d93357389777a4afce3d81 to your computer and use it in GitHub Desktop.
Save jeriko/d454571a87d93357389777a4afce3d81 to your computer and use it in GitHub Desktop.
name: DansProxy
description: |+
host: EXCEL
api_set: {}
script:
content: |
/**
* Asks gpt stuff via a proxy in replit
* @customfunction
* @param prompt
* @return completion string
*/
async function askGPT(prompt) {
const url = `https://ExcelApp.dandavey.repl.co/askgpt`;
const options = {
method: "POST",
body: JSON.stringify({ prompt }),
headers: {
"Authorization": "Bearer potato",
"Content-Type": "application/json"
}
};
const fetchResult = await fetch(url, options);
const jsonResponse = await fetchResult.json();
return jsonResponse.gpt_output
}
language: typescript
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
[email protected]/client/core.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment