Expanding Error Messages for Google Apps Script with Gemini 1.5 Flash

Gitst

Expanding Error Messages for Google Apps Script with Gemini 1.5 Flash

Abstract

This report builds on prior work using Gemini 1.0 Pro to expand Google Apps Script error messages. It highlights how the script’s execution time limit created a bottleneck, but the introduction of Gemini 1.5 Flash eliminates this issue.

Introduction

After the release of the Gemini API, I previously reported on “Expanding Error Messages of Google Apps Script using Gemini Pro API with Google Apps Script”. Ref In that report, I utilized the Gemini 1.0 Pro model. While expanding error messages proved valuable for understanding script errors in detail, Google Apps Script currently has a maximum execution time of 6 minutes. Ref This meant that processing time for content generation by the Gemini API significantly impacted the total process time when dealing with large scripts, creating a bottleneck.

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v1.0.4.

  • v1.0.4 (May 29, 2024)

    1. Recently, when model.countToken is used with the uploaded files, I confirmed that an error like You do not have permission to access the File ### or it may not exist. occurred. In order to handle this issue, I modified the library.
    2. In order to use the movie files for generateContent, I modified the library. Ref

You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Techniques for Creating Nested Lists on Google Documents using Google Docs API

Gists

Abstract

Current Google Docs API documentation offers methods for working with existing lists but lacks instructions for creating nested lists in new documents. This report fills this gap, empowering developers and streamlining nested list creation using Google Apps Script (concepts applicable to other languages).

Introduction

The official Google Docs API documentation provides instructions for working with existing lists, including converting paragraphs to lists and removing bullets. However, it lacks guidance on creating nested lists within an empty document body. Ref

Enhancing HTML and Javascript Development in Script Editor of Google Apps Script: Overcoming Formatting Challenges

Gists

Enhancing HTML and Javascript Development in Script Editor of Google Apps Script: Overcoming Formatting Challenges

Abstract

Despite the improved Google Apps Script IDE launched in April 2022, challenges arise for HTML and Javascript development. The Script Editor’s built-in formatting for these languages proves insufficient, particularly for large Javascript codebases, potentially causing errors. This report proposes a solution to address this formatting issue and streamline development within the Script Editor.

Updated: Javascript library - ResumableUploadForGoogleDrive_js

ResumableUploadForGoogleDrive_js was updated to v2.0.2.

  • v2.0.2 (May 23, 2024)

    1. From this version, the files could be also uploaded to the shared drive.

CDN

Class ResumableUploadToGoogleDrive

This Class can achieve the resumable upload of a file by reading the file to the memory.

<script src="https://cdn.jsdelivr.net/gh/tanaikech/ResumableUploadForGoogleDrive_js@2.0.2/resumableupload_js.min.js"></script>

Class ResumableUploadToGoogleDrive2

This Class can achieve the resumable upload of a file by directly reading partially the file from the local Disk. By this, the large file which is over the memory of the local PC can be uploaded.

Taming the Wild Output: Effective Control of Gemini API Response Formats with response_schema

Gists

Taming the Wild Output: Effective Control of Gemini API Response Formats with response_schema

Abstract

The Gemini API traditionally required specific prompts for desired output formats. This report explores two new GenerationConfig properties: “response_mime_type” and “response_schema”. These allow developers to directly specify formats like JSON, enhancing control and predictability. We analyze and compare the effectiveness of both properties for controlling Gemini API output formats.

Introduction

One of the key challenges when working with the Gemini API is ensuring the output data is delivered in the format your application requires. Traditionally, the response format heavily relied on the specific prompt you provided. For example, retrieving data as a structured JSON object necessitated including a “Return JSON” prompt within your input text. This approach could be cumbersome and error-prone if the desired format wasn’t explicitly requested.

Checking API Enabled with Advanced Google Services using Google Apps Script

Gists

Checking API Enabled with Advanced Google Services using Google Apps Script

Overview

This script checks if the desired API is enabled or disabled in the Advanced Google Services section of Google Apps Script.

Introduction

As of December 11, 2023, Drive API v3 became available for use in Advanced Google Services. Ref This means you can now choose between v2 and v3 in your scripts. However, when Drive API is enabled, version 3 is automatically selected. This caused compatibility issues with previously published libraries that relied on v2.

Updated: GAS Library - PDFApp

PDFApp was updated to v1.0.7.

  • v1.0.7 (May 15, 2024)

    1. The method of “addPageNumbers” was updated. Ref When a number is used to the property x instead of “left”, “center”, and “right”, the inputted number is directly used.

You can see the detail information here https://github.com/tanaikech/PDFApp