Applying Gemini Pro API to Flexible Templates using Google Apps Script

Gists

Applying Gemini Pro API to Flexible Templates using Google Apps Script

Abstract

New “semantic search” features in Gemini API help find desired information within its corpora. While using these features with Google Apps Script was complex, a new library simplifies the process. This report proposes using this library with Gemini-generated content to automate template processes in Google Docs and Slides, creating a more flexible workflow.

Introduction

The semantic search opens up a new wind for finding the expected values. Recently, the APIs for managing corpora have been added to Gemini API. Ref When the corpora of Gemini API is used, the semantic search can be effectively achieved. Ref However, when the corpora are tried to be used with Google Apps Script, the script is complicated cumbersome. To address this challenge, I have created a library for managing the corpora using Google Apps Script. Ref With this library, managing corpora becomes effortless, requiring only straightforward scripts.

Convert Contact URL to Resource Name for People API using Google Apps Script

Gists

Convert Contact URL to Resource Name for People API using Google Apps Script

This is a sample script for converting a contact URL of “person/c###” to a resource name “people/c###” for People API using Google Apps Script.

When you open each contact at Contacts with your browser, you can see the URL like https://contacts.google.com/person/c###################.

Here, you might have a situation where you are required to retrieve the resource name for People API from this URL. But, in the current stage, person/c################### cannot be directly used as the resource name people/c###################. In this report, I would like to introduce a sample script for converting from person/c################### to people/c###################.

Semantic Search using Corpus of Gemini API with Google Apps Script

Gists

Semantic Search using Corpus of Gemini API with Google Apps Script

Description

In the current stage, v1beta of Gemini API can use the corpora. Ref When the corpora are used, the values can be searched with the semantic search. In the current stage, 5 corpora can be created in a single project. And, each corpus can have 10,000 documents and 1,000,000 chunks. In this report, I would like to introduce a method for achieving the semantic search using the corpora with Google Apps Script.

Flexible Labeling for Gmail using Gemini Pro API with Google Apps Script Part 2

Gists

Flexible Labeling for Gmail using Gemini Pro API with Google Apps Script Part 2

Description

I have published “Flexible Labeling for Gmail using Gemini Pro API with Google Apps Script” on December 19, 2023. Today, I published “Categorization using Gemini Pro API with Google Apps Script”.

In this report, as part 2, I would like to introduce 2 sample scripts for flexible labeling for Gmail using the semantic search and the function calling of Gemini Pro API with Google Apps Script.

Categorization using Gemini Pro API with Google Apps Script

Gists

Categorization using Gemini Pro API with Google Apps Script

Abstract

This report explores using the Gemini Pro API with Google Apps Script to achieve flexible data categorization.

Introduction

The recent release of the LLM model Gemini as an API on Vertex AI and Google AI Studio opens a world of possibilities. Ref and Ref I believe Gemini API significantly expands the potential of Google Apps Script and paves the way for diverse applications. In this report, I present the flexible categorization of data using Gemini Pro API with Google Apps Script.