agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/ai-ml/gemini/SKILL.md

gemini

Skill15 starsChanged 43 days agoMITView on GitHub

Expert Google Gemini API assistance covering Gemini 1.5 Pro / Flash, multimodal reasoning (audio, video, PDF), and structured outputs. Use when building multi-modal AI applications with Google's foundation models.

  • Reads credentials

63 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use voice-call, BlueBubbles and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • seedprodSkill

    voice-call

    Start voice calls via the OpenClaw voice-call plugin.

    Also in 14 projects that use this

  • jiulingyunSkill

    BlueBubbles

    为Clawdbot构建或更新BlueBubbles外部通道插件(扩展包,REST发送/探测,webhook入站)。

    Also in 14 projects that use this

  • AlekseiULSkill

    TubeScribe

    YouTube video summarizer with speaker detection, formatted documents, and audio output. Works out of the box with macOS built-in TTS. Optional recommended tools (pandoc, ffmpeg, mlx-audio) enhance quality. Requires internet for YouTube access. No paid APIs or subscriptions. Use when user sends a YouTube URL or asks to summarize/transcribe a YouTube video.

    Also in 3 projects that use this

  • seedprodSkill

    imsg

    iMessage/SMS CLI for listing chats, history, watch, and sending.

    Also in 15 projects that use this

  • AtomicBot-aiSkill

    taskflow-inbox-triage

    Also in 4 projects that use this

  • jiulingyunSkill

    SAG

    具有mac风格say用户体验的ElevenLabs文本转语音。

    Also in 15 projects that use this

  • +6 more from seedprod

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 58 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use gemini-1.5-flash for high-volume, low-latency tasks and gemini-1.5-pro for deep reasoning.

    line 149
  2. Distinctive:

    Leave sensitive credentials exposed in client-side code.

    line 156
  3. Distinctive:

    Use high temperature settings (> 0.4) when strict schema compliance or factual retrieval is required.

    line 157

“Common” is measured: kept by at least 6 in 10 of the 58 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Gemini

Gemini is Google's native multimodal foundation model family, featuring native audio, image, and video comprehension alongside million-token context windows and fast tool-calling.

When to Use

  • Massive Multimodal Understanding: Gemini 1.5 Pro / Flash processing up to 2 million tokens of text, hours of video, audio, and large codebases.
  • Structured JSON Extraction: Enforcing rigid response schemas with Pydantic and native response_schema.
  • High-Speed Real-Time Inference: Gemini 1.5 Flash for sub-second, cost-effective conversational assistants and summarization.
  • Code & Repository Analysis: Analyzing entire GitHub repositories in a single context window.

Quick Start

from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents="Explain quantum computing in one short paragraph.",
)

print(response.text)

Core Concepts

Structured Output with Pydantic & Google GenAI SDK

Enforcing type-safe JSON schema responses:

from google import genai
from google.genai import types
from pydantic import BaseModel, Field
import os

client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY"))

class InvoiceExtraction(BaseModel):
    invoice_number: str
    vendor: str
    total_amount: float = Field(description="Total invoice amount in USD")
    items: list[str]
    is_paid: bool

response = client.models.generate_content(
    model='gemini-1.5-flash',
    contents='Invoice #INV-2026-908 from CloudCorp for $1,450.00. Included 2 Cloud Servers and 1 Storage bucket. Paid via Wire.',
    config=types.GenerateContentConfig(
        response_mime_type="application/json",
        response_schema=InvoiceExtraction,
        temperature=0.1
    ),
)

extracted: InvoiceExtraction = InvoiceExtraction.model_validate_json(response.text)
print(f"Extracted Invoice: {extracted.invoice_number}, Total: ${extracted.total_amount}")

Native Video & Audio Multimodal Analysis

Processing video files directly using the File API:

from google import genai

client = genai.Client()

# Upload video file to File API
video_file = client.files.upload(file="presentation.mp4")

# Query video content directly
response = client.models.generate_content(
    model="gemini-1.5-pro",
    contents=[
        video_file,
        "Summarize the key decisions made between timestamp 04:15 and 08:30 in this meeting."
    ]
)

print(response.text)

Context Caching for Massive Contexts

Reducing cost on recurring queries against massive datasets:

from google import genai
from google.genai import types
import datetime

client = genai.Client()

# Create cached content for a massive documentation corpus
cache = client.caches.create(
    model='gemini-1.5-pro',
    config=types.CreateCachedContentConfig(
        contents=[large_documentation_file],
        ttl=datetime.timedelta(hours=2),
        display_name='api_documentation_v2'
    )
)

# Query against cache at significantly reduced per-token cost
response = client.models.generate_content(
    model='gemini-1.5-pro',
    contents='What are the rate limits for the batch endpoint?',
    config=types.GenerateContentConfig(cached_content=cache.name)
)

Common Patterns

Multimodal Document Analysis (PDF / Audio / Video)

Problem: Processing multi-page PDF documents or audio files without complex local extraction libraries.

Solution: Upload file using the Google GenAI File API:

# Upload document directly to Gemini File API
doc_file = client.files.upload(file="contract.pdf")

response = client.models.generate_content(
    model="gemini-2.0-flash",
    contents=[
        doc_file,
        "Extract the governing law, termination notice period, and liability cap."
    ]
)

print(response.text)

Best Practices

Do:

  • Target the modern Google GenAI SDK (google-genai) instead of legacy deprecated libraries.
  • Use gemini-1.5-flash for high-volume, low-latency tasks and gemini-1.5-pro for deep reasoning.
  • Enforce structured outputs with response_schema and Pydantic models for reliable API integrations.
  • Leverage Context Caching for prompts exceeding 32k tokens that are reused across multiple calls.

Don't:

  • Upload raw video/audio base64 payloads inline; use the client.files.upload() API.
  • Leave sensitive credentials exposed in client-side code; proxy requests through a secure backend.
  • Use high temperature settings (> 0.4) when strict schema compliance or factual retrieval is required.

Troubleshooting

ErrorCauseSolution
google.genai.errors.APIError: 400 Invalid argumentUnsupported file format or invalid model name.Verify model identifier (e.g. gemini-2.0-flash or gemini-1.5-pro).
ResourceExhausted: 429 Quota exceededRate limit hit on free tier requests per minute.Implement client-side rate limiting or upgrade to paid tier API key.
Missing GEMINI_API_KEY environment variableEnvironment variable not exported in shell.Export export GEMINI_API_KEY="AIzaSy...".

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.