Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

google-gemini-api

БесплатноЗапускает вложенные скриптыНе проверен

Integrate Gemini API with correct current SDK (@google/genai v1.27+, NOT deprecated @google/generative-ai). Supports text generation, multimodal…

ovachieverот ovachiever★ 56 звёзд на GitHub16 установок в других каталогах

Об этом скилле

Google Gemini API - Complete Guide

Version: Phase 2 Complete + Gemini 3 ✅ Package: @google/[email protected] (⚠️ NOT @google/generative-ai) Last Updated: 2025-11-19 (Gemini 3 preview release)


⚠️ CRITICAL SDK MIGRATION WARNING

DEPRECATED SDK: @google/generative-ai (sunset November 30, 2025) CURRENT SDK: @google/genai v1.27+

If you see code using @google/generative-ai, it's outdated!

This skill uses the correct current SDK and provides a complete migration guide.


Status

✅ Phase 1 Complete:

  • ✅ Text Generation (basic + streaming)
  • ✅ Multimodal Inputs (images, video, audio, PDFs)
  • ✅ Function Calling (basic + parallel execution)
  • ✅ System Instructions & Multi-turn Chat
  • ✅ Thinking Mode Configuration
  • ✅ Generation Parameters (temperature, top-p, top-k, stop sequences)
  • ✅ Both Node.js SDK (@google/genai) and fetch approaches

✅ Phase 2 Complete:

  • ✅ Context Caching (cost optimization with TTL-based caching)
  • ✅ Code Execution (built-in Python interpreter and sandbox)
  • ✅ Grounding with Google Search (real-time web information + citations)

📦 Separate Skills:

  • Embeddings: See google-gemini-embeddings skill for text-embedding-004

Table of Contents

Phase 1 - Core Features:

  1. Quick Start
  2. Current Models (2025)
  3. SDK vs Fetch Approaches
  4. Text Generation
  5. Streaming
  6. Multimodal Inputs
  7. Function Calling
  8. System Instructions
  9. Multi-turn Chat
  10. Thinking Mode
  11. Generation Configuration

Phase 2 - Advanced Features: 12. Context Caching 13. Code Execution 14. Grounding with Google Search

Common Reference: 15. Error Handling 16. Rate Limits 17. SDK Migration Guide 18. Production Best Practices


Quick Start

Installation

CORRECT SDK:

npm install @google/[email protected]

❌ WRONG (DEPRECATED):

npm install @google/generative-ai  # DO NOT USE!

Environment Setup

export GEMINI_API_KEY="..."

Or create .env file:

GEMINI_API_KEY=...

First Text Generation (Node.js SDK)

import { GoogleGenAI } from '@google/genai';

const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const response = await ai.models.generateContent({
  model: 'gemini-2.5-flash',
  contents: 'Explain quantum computing in simple terms'
});

console.log(response.text);

First Text Generation (Fetch - Cloudflare Workers)

const response = await fetch(
  `https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-goog-api-key': env.GEMINI_API_KEY,
    },
    body: JSON.stringify({
      contents: [{ parts: [{ text: 'Explain quantum computing in simple terms' }] }]
    }),
  }
);

const data = await response.json();
console.log(data.candidates[0].content.parts[0].text);

Current Models (2025)

Gemini 3 Series (Preview - November 2025)

gemini-3-pro-preview

  • Context: TBD (documentation pending)
  • Status: 🆕 Preview release (November 18, 2025)
  • Description: Google's newest and most intelligent AI model with state-of-the-art reasoning
  • Best for: Most complex reasoning tasks, advanced multimodal understanding, benchmark-critical applications
  • Features: Enhanced multimodal (text, image, video, audio, PDF), function calling, streaming
  • Benchmark Performance: Outperforms Gemini 2.5 Pro on every major AI benchmark
  • ⚠️ Preview: Use for evaluation. Consider gemini-2.5-pro for production until stable release

Gemini 2.5 Series (General Availability - Stable)

gemini-2.5-pro

  • Context: 1,048,576 input tokens / 65,536 output tokens
  • Description: State-of-the-art thinking model for complex reasoning
  • Best for: Code, math, STEM, complex problem-solving
  • Features: Thinking mode (default on), function calling, multimodal, streaming
  • Knowledge cutoff: January 2025

gemini-2.5-flash

  • Context: 1,048,576 input tokens / 65,536 output tokens
  • Description: Best price-performance workhorse model
  • Best for: Large-scale processing, low-latency, high-volume, agentic use cases
  • Features: Thinking mode (default on), function calling, multimodal, streaming
  • Knowledge cutoff: January 2025

gemini-2.5-flash-lite

  • Context: 1,048,576 input tokens / 65,536 output tokens
  • Description: Cost-optimized, fastest 2.5 model
  • Best for: High throughput, cost-sensitive applications
  • Features: Thinking mode (default on), functio
Полный SKILL.md на GitHub

Установить google-gemini-api в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.claude-plugin/plugin.jsonREADME.mdreferences/code-execution-patterns.mdreferences/context-caching-guide.mdreferences/function-calling-patterns.mdreferences/generation-config.mdreferences/grounding-guide.mdreferences/models-guide.mdreferences/multimodal-guide.mdreferences/sdk-migration-guide.mdreferences/streaming-patterns.mdreferences/thinking-mode-guide.mdreferences/top-errors.mdscripts/check-versions.shtemplates/cloudflare-worker.tstemplates/code-execution.tstemplates/combined-advanced.tstemplates/context-caching.tstemplates/function-calling-basic.tstemplates/function-calling-parallel.tstemplates/grounding-search.tstemplates/multimodal-image.tstemplates/multimodal-video-audio.tstemplates/package.jsontemplates/streaming-chat.tstemplates/streaming-fetch.tstemplates/text-generation-basic.tstemplates/text-generation-fetch.tstemplates/thinking-mode.ts

FAQ

Что делает скилл google-gemini-api?

Integrate Gemini API with correct current SDK (@google/genai v1.27+, NOT deprecated @google/generative-ai). Supports text generation, multimodal (images/video/audio/PDFs), function calling, and thinking mode. 1M input tokens. Use when: integrating Gemini API, implementing multimodal AI, using thinking mode for reasoning, function calling with parallel execution, streaming responses, deploying to Cloudflare Workers, building chat, or troubleshooting SDK deprecation, context window, model not found, function calling, or multimodal format errors. Keywords: gemini api, @google/genai, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-3-pro-preview, multimodal gemini, thinking mode, google ai, genai sdk, function calling gemini, streaming gemini, gemini vision, gemini video, gemini audio, gemini pdf, system instructions, multi-turn chat, DEPRECATED @google/generative-ai, gemini context window, gemini models 2025, gemini 1m tokens, gemini tool use, parallel function calling, compositional function calling, gemini 3

Как установить скилл google-gemini-api?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл google-gemini-api запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить google-gemini-api с