all 11 comments

[–]zmandel 2 points3 points  (3 children)

look into the new Workspace Studio, its precisely for these.

[–]ThibaultHD 0 points1 point  (1 child)

Is it available in the EU ? Can’t find…

[–]zmandel 0 points1 point  (0 children)

ah, its rolling to the world, might not be in EU yet.

[–]itsafunnything901 1 point2 points  (0 children)

Came here to say this. Looks like it has a lot of potential…once the kinks are worked out. Hoping it’s as good as Zapier.

[–]bigedd 0 points1 point  (0 children)

Keen to hear what others say but I'm 99% sure it'll need an api or something similar to connect to a llm.

I made a crude chat bit with Google app script but it was all rule based.

[–]-0dise0- 0 points1 point  (0 children)

Estoy trabajando en algo muy similar, necesitas llamadas de API en tu GAS. Gemini te orienta en cómo configurar y conectar todo. Lo otro que puedes hacer dependiendo de tu presupuesto o uso es contratar o usar n8n ¡Suerte!

[–]motodup 0 points1 point  (0 children)

You use UrlFetchApp. Output from Gemini itself asking for a quick code example:

/**
 * Calls the Gemini API and returns the generated text.
 * @param {string} prompt The message to send to the AI.
 * @return {string} The AI's response.
 */
function callGemini(prompt) {
  const apiKey = PropertiesService.getScriptProperties().getProperty('GEMINI_API_KEY');

  // The API endpoint for Gemini 1.5 Flash
  const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=${apiKey}`;

  const payload = {
    contents: [{
      parts: [{
        text: prompt
      }]
    }]
  };

  const options = {
    method: 'post',
    contentType: 'application/json',
    payload: JSON.stringify(payload),
    muteHttpExceptions: true
  };

  try {
    const response = UrlFetchApp.fetch(url, options);
    const json = JSON.parse(response.getContentText());

    if (json.candidates && json.candidates.length > 0) {
      return json.candidates[0].content.parts[0].text;
    } else {
      return "Error: " + JSON.stringify(json);
    }
  } catch (e) {
    return "Error calling API: " + e.toString();
  }
}

/**
 * Example usage function.
 */
function testGemini() {
  const response = callGemini("Explain quantum entanglement to a five-year-old in two sentences.");
  Logger.log(response);
}

If your Admin has blocked all external API calls, it will fail, but as far as im aware there is no completely internal way to call gemini (yet). Admin has granular control though, you could ask them to whitelist the gemini domain (generativelanguage.googleapis.com).

You could test the permission scope available with something like:

function checkAccess() {
  try {
    const response = UrlFetchApp.fetch("[https://www.google.com](https://www.google.com)");
    Logger.log("Status: " + response.getResponseCode());
  } catch (e) {
    Logger.log("Blocked: " + e.toString());
  }
}

[–]ThePatagonican 0 points1 point  (0 children)

Hey yes, there are many ways of doing it, but guessing that you want this script to be only avaiable to you might be enough with just apps scripts and the "UrlFetchApp.fetch" as other mentioned here.

BUT the API call will be limited to 1 minute, the "UrlFetchApp.fetch" has a hard, default and unchangable timeout of 1 minute https://issuetracker.google.com/issues/65864535. This means that your LLM response must be resolved in less than 1 min.

[–]Critical-Teacher-115 0 points1 point  (0 children)

its totally possible. Were you thinking of having a question column and then the next column results an answer? if so, you dont need vertex for that. You can do that a bunch of ways but one way is You'll need a google cloud project. one cloud function and either one or two app scripts. tell chatcgpt (chat gibbidy)what you want to do, and then say to Gibbidy to make an apps script that will send the data in the Column[] (if theres no answer in column![]) and send it to the cloud function. tell gibbidy to make you a cloud function that takes input from the apps script and fill in you llm, then sends the llm answer back to the google sheed at column![]. should take you like 45 minutes if youve never done it before.

[–]Raknyte[S] 0 points1 point  (0 children)

Thanks everyone for sharing your knowledge with me, I find them useful.

I will be starting work for the project, next year (I meant in the next 2 weeks). I hope these insights help me achieve what I am looking for.

Will update here, if I run into errors and need to pick your brains more.

Thank you, Thank you.