TG

tanaikech/geminiwithfiles

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

76 stars 质量 55 趋势 18MIT

一个 Google Apps Script 库,可无缝集成 Gemini API,用于处理文件、非结构化数据并构建自主 AI 代理。

概览

Gemini API 正在不断发展和演进。随着 GeminiWithFiles v2.x.x(及最新 v2.0.30)的发布,库经历了重大更新,包括支持最新模型、详细的令牌使用跟踪,以及(渐进披露架构和子代理编排)。 如果你想使用遗留版 GeminiWithFiles v1.x.x,请参见这里。 是一个强大的 Google Apps Script(GAS)库,旨在简化与 Gemini API 的交互,尤其是在处理文件和非结构化数据时。 通过利用该库,开发者可以轻松上传文件(图片、PDF、视频等)、生成文本或结构化JSON内容、执行代码、进行谷歌搜索基础化,甚至利用 构建自主人工智能代理。这大大降低了编码开销,并扩展了将Gemini集成到Google Workspace的可能性。

概述(AI 翻译)

重要

Gemini API 正在不断发展和发展。随着 GeminiWithFiles v2.x.x(及最新 v2.0.30)的发布,该库经历了重大更新,包括支持最新的 Gemini 3.1 Flash Lite 模型、详细的令牌使用跟踪,以及 Agent Skills(渐进披露架构和子代理编排)。

如果你想使用遗留版 GeminiWithFiles v1.x.x,请参见这里。

概述

GeminiWithFiles 是一个强大的 Google Apps Script(GAS)库,旨在简化与 Gemini API 的交互,尤其是在处理文件和非结构化数据时。

通过利用该库,开发者可以轻松上传文件(图片、PDF、视频等)、生成文本或结构化JSON内容、执行代码、进行谷歌搜索基础化,甚至利用Agent Skills构建自主AI代理。这大大降低了编码开销,并扩展了将Gemini集成到Google Workspace的可能性。

描述

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

GeminiWithFiles

IMPORTANT

Gemini API is continually growing and evolving. With the release of GeminiWithFiles v2.x.x (and the latest v2.0.30), the library has undergone major updates, including support for the latest Gemini 3.1 Flash Lite model, detailed token usage tracking, and Agent Skills (Progressive Disclosure architecture and Subagent Orchestration).

If you want to use the legacy GeminiWithFiles v1.x.x, please see here.

Overview

GeminiWithFiles is a powerful Google Apps Script (GAS) library designed to streamline interactions with the Gemini API, particularly when working with files and unstructured data.

By utilizing this library, developers can effortlessly upload files (images, PDFs, videos, etc.), generate text or structured JSON content, execute code, perform Google Search grounding, and even build autonomous AI agents using Agent Skills. This significantly reduces coding overhead and expands the possibilities of integrating Gemini into Google Workspace.

Description

As large language models (LLMs) continue to advance, Google’s Gemini models have opened up unprecedented possibilities for converting unstructured data (like images, videos, and PDFs) into structured, actionable insights.

With the latest Gemini 3.1 capabilities, the context window and multimodal processing power have reached new heights. You can now analyze massive documents, batch-process images, and natively interpret PDF data directly without third-party conversions. Ref Ref

While Gemini does not natively parse Google Workspace proprietary formats (Docs, Sheets, Slides) directly, we can use workarounds like converting them to PDF and leveraging the Gemini API’s direct PDF input features.

GeminiWithFiles abstracts away the complexities of making direct REST API calls from Apps Script. It handles the nuances of multipart uploads, resumable uploads for large files (>50MB), token counting, and multi-turn chat context. More importantly, the latest version introduces Agent Skills, allowing developers to create dynamic, autonomous agent workflows where the model decides which tools to use, reads configurations from Google Drive, dynamically executes JavaScript in your GAS environment, and even delegates tasks to specialized subagents. Ref

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add tanaikech/geminiwithfiles
新手?先看 mcpskill.org 教程 →