Skip to content

Instantly share code, notes, and snippets.

Last active November 16, 2022 01:33
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
to_formal formula to call Hugging Inference Endpoints
function to_formal(input="That was funny LOL") {
const endpointUrl = "";
const options = {
"method" : "POST",
"contentType" : "application/json",
"payload" : JSON.stringify({"inputs": input}),
"headers" : {
"Authorization" : "Bearer api_org_TOKEN"
const response = UrlFetchApp.fetch(endpointUrl, options);
const data = JSON.parse(response.getContentText());
const result = data[0]['generated_text']
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment