Created
July 6, 2022 14:52
-
-
Save jeriko/d454571a87d93357389777a4afce3d81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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