Skip to content

Instantly share code, notes, and snippets.

Last active Nov 16, 2022
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