Przejdź do treści
Biblioteka skilli
AI i agenci · Integracja z narzędziem

gemini-api-integration

/gemini-api-integration

Pomaga zintegrować Google Gemini API w projektach: dobór modelu, wejścia multimodalne, streaming, function calling i dobre praktyki produkcyjne.

Licencja
MIT
Ostatnia zmiana repozytorium
24.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 24.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pomaga zintegrować Google Gemini API w projektach: dobór modelu, wejścia multimodalne, streaming, function calling i dobre praktyki produkcyjne.

Oryginalny opis (EN)

Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices.

Jak działa

  1. Overview
  2. When to Use This Skill
  3. Step-by-Step Guide
  4. Examples
  5. Sources
  6. Limitations
Sekcje z nagłówków SKILL.md, w oryginale · 70 linii, 548 słów
Podgląd SKILL.md
---
name: gemini-api-integration
description: "Use when integrating Google Gemini API into projects. Covers model selection, multimodal inputs, streaming, function calling, and production best practices."
risk: safe
source: community
date_added: "2026-03-04"
---

# Gemini API Integration

## Overview

This skill guides AI agents through integrating Google Gemini API into applications — from basic text generation to advanced multimodal, function calling, and streaming use cases. It covers the full Gemini SDK lifecycle with production-grade patterns.

## When to Use This Skill

- Use when setting up Gemini API for the first time in a Node.js, Python, or browser project
- Use when implementing multimodal inputs (text + image/audio/video)
- Use when adding streaming responses to improve perceived latency
- Use when implementing function calling / tool use with Gemini
- Use when optimizing model selection (Flash vs Pro vs Ultra) for cost and performance
- Use when debugging Gemini API errors, rate limits, or quota issues

## Step-by-Step Guide

### 1. Select the supported SDK and model

Use the Google GenAI SDK (`@google/genai` for JavaScript, `google-genai` for Python), pin a tested package version, and select an available model for the account. The older `@google/generative-ai` / `google-generativeai` APIs and historical 1.5/2.0 model table are not current setup guidance. Check model availability, deprecations, pricing and feature support in official documentation before choosing; do not assume a universal cheapest or most capable model.

### 2. Server-side generation

Set `GEMINI_API_KEY` through a secret manager or protected environment and `GEMINI_MODEL` to the verified model ID. Never ship a long-lived key in browser code.

```javascript
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
const response = await ai.models.generateContent({
  model: process.env.GEMINI_MODEL,
  contents: "Explain async/await in JavaScript"
});
console.log(response.text);
```

```python
import os
from google import genai
with genai.Client(api_key=os.environ["GEMINI_API_KEY"]) as client:
    response = client.models.generate_content(
        model=os.environ["GEMINI_MODEL"], contents="Explain async/await")
    print(response.text)
```

### 3. Streaming and multimodal inputs

Use the pinned SDK's `models.generateContentStream` / `models.generate_content_stream` interfaces and handle partial output, cancellation and empty/blocked responses. Verify MIME types, model limits and file retention before transmitting images/audio/video. Obtain permission for sensitive content; do not put private inputs or access URLs in logs. File uploads and generation may incur charges.

### 4. Function calling and chat

A model's function call is an untrusted proposal. Validate the name against a fixed allowlist and arguments against a schema, enforce user authorization, and limit calls/time/cost before dispatch. Return actual tool results through the pinned SDK's documented function-response format; never fabricate results. Preserve the required conversation turns and function-call identifiers. A chat history entry is not a privileged system instruction; use the supported configuration field for system instructions.

### 5. Failure handling

Inspect structured errors, block reasons and finish reasons without assuming every response has text. Retry only transient errors with bounded exponential backoff, jitter and any retry-after guidance; enforce deadlines and a retry budget. A failed network request may already have incurred usage. Do not retry invalid credentials or malformed requests indefinitely, and do not weaken safety settings merely to bypass a blocked response.

## Examples

For a production integration, first run a small non-sensitive prompt against a test project, record the SDK/model version and response status, then test streaming cancellation, blocked output, quota exhaustion and rejected tool arguments. Report what was actually exercised.

## Sources

- [Google GenAI migration guide](https://ai.google.dev/gemini-api/docs/migrate)
- [Content generation API](https://ai.google.dev/api/generate-content)

## Limitations

SDK syntax, model availability, quotas and pricing change. These examples are unexecuted integration templates and do not establish account access, model quality or production readiness.

Wersje

RepozytoriumWynikLicencja
Ta strona · sickn33/agentic-awesome-skills100MIT
FrancoStino/opencode-skills-collection100MIT
hybridlabor-api/aos100Apache-2.0
LiHongwei-cn/lihongwei-cn100MIT
tranhieutt/software_development_department100MIT

Identyczna treść występuje jeszcze w 2 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki 2cf528e01567 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100gemini-api-dev
    Wspiera budowę aplikacji z modelami Gemini i Gemma 4 przez Gemini API: treści multimodalne, function calling, ustrukturyzowane wyjścia, SDK google-genai w kilku językach i dobór modelu.
  • 100gemini-api-dev
    Wspiera budowę aplikacji z modelami Gemini i Gemma 4 przez Gemini API: treści multimodalne, function calling, ustrukturyzowane wyjścia, SDK google-genai w kilku językach i dobór modelu.
  • 100gemini-api-dev
    Wspiera budowę aplikacji z modelami Gemini i Gemma 4 przez Gemini API: treści multimodalne, function calling i ustrukturyzowane wyjścia.
  • 100gemini-api-dev
    Wspiera budowę aplikacji z modelami Gemini i Gemma 4 przez Gemini API: treści multimodalne, function calling i ustrukturyzowane wyjścia.
  • 100gemini-api-dev
    Pomaga pisać kod wywołujący Gemini API w Pythonie i TypeScript: generowanie tekstu, czat, multimodalność, function calling, dane strukturalne i streaming.
  • 100gemini-api-dev
    Wspiera budowę aplikacji z modelami Gemini i Gemini API, w tym treści multimodalne (tekst, obraz, audio, wideo), wywoływanie funkcji i ustrukturyzowane wyjścia.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.