Convert Google Document to Markdown and vice versa using Google Apps Script

Gists

Convert Google Document to Markdown and vice versa using Google Apps Script

Description

Great news for fans of both Google Docs and Markdown! Google Docs recently acquired the ability to export documents directly into the markdown format. Ref

This functionality extends beyond the user interface, with early indications suggesting the Google Drive API might also be capable of converting between Google Docs and Markdown. I confirmed that this could also be achieved by Drive API. This opens exciting possibilities for automated workflows.

Updated: GAS Application - UnlockSmartInvoiceManagementWithGeminiAPI

UnlockSmartInvoiceManagementWithGeminiAPI was updated to v1.0.2.

  • v1.0.2 (July 23, 2024)

    1. On July 23, 2024, I noticed that PDF data could be directly parsed by Gemini API. It is considered that this is due to the update by the Google side. So, I updated setBlobs([blob], true) to setBlobs([blob], false) of the method parseInvoiceByGemini_. By this modification, the PDF blob is directly used with Gemini API. Ref

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

Uploading Large Files to Gemini with Google Apps Script: Overcoming 50 MB Limit

Gists

Uploading Large Files to Gemini with Google Apps Script: Overcoming 50 MB Limit

Abstract

Uploads in Google Apps Script are limited to 50 MB, hindering work with large datasets. This report introduces a script with uploadType=resumable to overcome this limit, enabling uploads over 50 MB to Gemini and other services.

Introduction

This report explores the limitations of data upload size using Google Apps Script and introduces a script to overcome these limitations. In the current stage, Gemini API can generate content using the uploaded data to Gemini. You can find more information on this in a previous report. Ref As mentioned in the report, Google Apps Script uses uploadType=multipart for uploading files. However, the maximum file size is limited to 5 MB with this method for Drive API. Ref While I confirmed that the Gemini API allows for uploading over about 20 MB with uploadType=multipart, Google Apps Script enforces a stricter 50 MB limit for both uploads and downloads. Ref This can be inconvenient when working with larger datasets, such as movie or text data, which often exceed this limit.

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v1.0.7.

  • v1.0.7 (July 4, 2024)

    1. From this version, when doCountToken: true and exportTotalTokens: true are used in the object of the argument of geminiWithFiles, the total tokens are returned. In this case, the returned value is an object like {returnValue: "###", totalTokens: ###}. Ref

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

Analyzing Folder Structures with Google Apps Script

Gists

Abstract

This report provides a Google Apps Script to retrieve all files, including those within subfolders, for a designated folder. It addresses the challenges of retrieving files within deeply nested folder structures and obtaining complete file paths.

Introduction

Google Apps Script empowers developers to interact with Google Drive data programmatically, unlocking a wide range of functionalities. A core component of this interaction is the Drive service (DriveApp) and Drive API. These services provide programmatic control over files and folders within your Drive.

Updated: GAS Library - MoveFolder

MoveFolder was updated to v1.0.1.

  • v1.0.1 (June 18, 2024)

    1. In the recent update on the Google side, it was found that in the current stage, when the other libraries are loaded from a library, an error like We're sorry, a server error occurred while reading from storage. Error code NOT_FOUND occurs. So, from v1.0.1, the library of BatchRequest is included in this library.

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

Updated: GAS Application - UnlockSmartInvoiceManagementWithGeminiAPI

UnlockSmartInvoiceManagementWithGeminiAPI was updated to v1.0.1.

  • v1.0.1 (June 17, 2024)

    1. In order to easily customize the value of “jsonSchema” for generating content with Gemini API, I added it as a new sheet of “jsonSchema” sheet in the Spreadsheet. When you customize it, you can edit the cell “A1” of the “jsonSchema” sheet. By this, the script generates content with Gemini API using your customized JSON schema. The cell “A2” is the number of characters of “A1”.

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

Unlock Smart Invoice Management: Gemini, Gmail, and Google Apps Script Integration

Gists

Unlock Smart Invoice Management: Gemini, Gmail, and Google Apps Script Integration

You can see the presentation of this application at https://www.youtube.com/watch?v=Dc2WPQkovZE.

Abstract

This report describes an invoice processing application built with Google Apps Script. It leverages Gemini, a large language model, to automatically parse invoices received as email attachments and automates the process using time-driven triggers.

Introduction

The emergence of large language models (LLMs) like ChatGPT and Gemini has significantly impacted various aspects of our daily lives. One such example is their ability to automate tasks previously requiring manual effort. In my case, Gemini has streamlined the processing of invoices I receive as email attachments in PDF format.