Gists
Overview These are sample scripts in Python and Node.js for controlling the output format of the Gemini API using JSON schemas.
Description In a previous report, “Taming the Wild Output: Effective Control of Gemini API Response Formats with response_mime_type,” I presented sample scripts created with Google Apps Script. Ref Following its publication, I received requests for sample scripts using Python and Node.js. This report addresses those requests by providing sample scripts in both languages.
GeminiWithFiles was updated to v1.0.2. v1.0.2 (May 7, 2024)
For generating content, parts was added. From this version, you can select one of q, jsonSchema, and parts. From this version, systemInstruction can be used. In order to call the function call, toolConfig was added to the request body. You can see the detail information here https://github.com/tanaikech/GeminiWithFiles
UtlApp was updated to v1.0.6. v1.0.6 (May 4, 2024)
Methods of blobToDataUrl was added. When this method is used, the Blob data can be converted to the data URL. You can see the detail information here https://github.com/tanaikech/UtlApp
Gists
Overview This script demonstrates how to insert an animated GIF over cells in a Google Sheet using Google Apps Script.
Description I recently received a request to create a Google Apps Script for inserting animated GIFs into cells on a Google Sheet. I previously published a sample script on my blog on June 6, 2017. Ref In that script, the animation GIF was inserted using a public link. This new script leverages data URLs, which simplifies the process for using GIFs stored in Google Drive.
GeminiWithFiles was updated to v1.0.1. v1.0.1 (May 2, 2024)
response_mime_type got to be able to be used for controlling the output format. Ref You can see the detail information here https://github.com/tanaikech/GeminiWithFiles