AppsScriptPulse

Smart replacing images in Google Slides with Gemini Pro API and Vertex AI

Image credit: Ivan Kutil

Surely, you have also experienced having a presentation in which you needed to replace old content with new. Replacing text is very simple because you just need to use the Replace function, and you can either do it in the Google Slides user interface.

The problem arises when you need to replace one image with another, for example, if your corporate logo is updated to a new graphic design or if one of your favorite cloud services updates its icons (Gmail, blink blink ;-) It’s still somewhat bearable with one presentation, but what do you do when, like me, you have thousands of Google Slides files on your Google Drive?

This post explores a clever application of the Gemini API’s multimodal capabilities, created by Ivan Kutil. His code utilizes GenAI to automatically detect outdated logos within your Google Slides presentations. The original blog post (March 2024) used the Gemini Pro Vision API. As a sign of how rapidly this area evolves, Google now recommends switching to Gemini 1.5 Flash or Gemini 1.5 Pro.

Switching to the newer APIs is very straightforward as all you need to do is search the source code for models/gemini-pro-vision and replace with models/gemini-1.5-flash or models/gemini-1.5-pro.

For Apps Script projects I lean towards Gemini 1.5 Flash as it is designed for speed. I’m also always looking to opportunities to test the GeminiApp library for Apps Script and very quickly I was able to fork Ivan’s code and use Gemini 1.5 Flash using a service account.

While GeminiApp requires some initial setup, it offers significant advantages:

  • Easy Model Testing: Experiment with various models quickly.
  • Built-in Features: Includes functionalities like exponential backoff.

If you would like to explore here is a sample slide deck you can copy which has the container bound forked code (if you don’t want to use a service account here is more information on other setup options).

Source: Smart replacing images in Google Slides with Gemini Pro API and Vertex AI

Google Area 120 Tables Beta joins Google Cloud opening up access for all!

Image: Google Area 120

Last September, Tables launched in Area 120, Google’s internal incubator for experimental projects, with the goal of proving market demand for a solution to help teams organize and track work, and it was a success! Google Cloud has committed to investing in this product area long-term. Moving forward, the beta version of Tables will still be available until we release a fully-supported Google Cloud product – which we expect to complete in the next year.

If you are not familiar with the Tables Beta it is a collaborative data platform designed to make it easier for no/low coders to create workflows and automations. If you would like to see the Tables beta in action Co-founder & Product Lead, Carlin Yuen, joined us on Totally Unscripted in New workflow solutions with Tables and Google Apps Script.The Tables beta has so far been limited to users in the US. The source link provides more details about timelines and how non-US users can join the beta. [HT Ivan Kutil]

Source: Tables Beta Update & FAQ

16 secrets tips, tricks and features for new Google Apps Script Editor (v2020)

Google Apps Script has a new editor, which is better, nicer, and completed ready for future new features. Today, I would like to introduce you to several dirty and secret tricks, what you can do.

If you like a keyboard shortcut you’ll love this post from Ivan Kutil! For those less keen on keyboard commands there is still plenty of other productivity tips from Ivan shared in this post.

Source: 16 secrets tips, tricks and features for new Google Apps Script Editor (v2020)

Machine learning in Google Sheet with Tensorflow.js and Google Apps Script 

This article will show you how you can setup, train, and predict spreadsheet data with deep-learning framework Tensorflow.js. You don’t need to call REST APIs or use other 3rd parties storage and algorithm. All your data stays in your secure Google Sheet.

Source: kutil.org: Machine learning in Google Sheet with Tensorflow.js and Google Apps Script