Aller au contenu
Skillpedia
Agents22k · #10262

gemini-interactions-api

Ce qu’il fait

Cette skill guide les développeurs qui utilisent l'API Gemini Interactions de Google, une API à état où la plateforme conserve la conversation à leur place. Elle s'adresse aux équipes qui construisent des conversations en plusieurs étapes et des recherches en arrière-plan.

Quand l’utiliser

  • ✓Quand vous voulez une conversation à plusieurs tours où la plateforme conserve l'historique.
  • ✓Quand vous avez besoin de tâches de recherche en arrière-plan ou de réponses diffusées en flux depuis Gemini.
  • ✓Quand vous voulez une sortie structurée ou l'appel de fonctions via l'API Interactions.

Lien du skill

https://github.com/google/skills/blob/main/skills/cloud/gemini-interactions-api/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/google/skills/blob/main/skills/cloud/gemini-interactions-api/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Construis un chat avec Gemini sur Google Cloud qui se souvient des messages précédents et peut lancer une tâche de recherche en arrière-plan.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Elle explique comment s'authentifier, se connecter et utiliser l'API Interactions avec le SDK Google Gen AI. Elle recommande les derniers modèles Gemini et met en garde contre les anciens paquets non pris en charge.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Gemini Interactions API Skill

This skill provides instructions for authenticating, connecting to, and utilizing the stateful, server-managed Gemini Interactions API on Gemini Enterprise Agent Platform.

The Interactions API is the modern, recommended way to execute Generative AI agent conversations, background research tasks, multi-turn chats, and structured, multi-step workflows.

[!IMPORTANT] CRITICAL: Unified SDK, Latest Models & Model/Agent Targeting * Unified SDK: Use the Google Gen AI SDK (google-genai >= 2.3.0 for Python, @google/genai >= 2.3.0 for JS/TS). SDK versions >= 2.0.0 are the minimum floor at which the steps schema activates, but >= 2.3.0 is the supported/recommended floor. Legacy SDKs like google-cloud-aiplatform, @google-cloud/vertexai, google-generativeai, and @google/generative-ai are strictly unsupported for Interactions. * Mandatory Instruction: When explaining client initialization or writing import code, you must explicitly state/warn the user that legacy packages like google-cloud-aiplatform or google-generativeai are strictly unsupported for interactions. * Latest Models Only: Use gemini-3.8-flash (fast, balanced, multimodal — the recommended default), gemini-3.1-pro-preview (complex reasoning, coding, research), or gemini-3.5-flash-lite (cost-efficient, high-frequency lightweight tasks). Refer to the latest model versions to check for new updates. Legacy models (gemini-3-flash-preview, gemini-2.5-*, gemini-2.0-*, gemini-1.5-*) are deprecated and do not support interactions. * Mandatory Instruction: In any interaction response, you must warn the user that legacy models like gemini-2.5-*, gemini-2.0-*, or gemini-1.5-* are deprecated and unsupported for the Interactions API. If a user asks for a deprecated model, use gemini-3.8-flash instead and note the substitution. * Model & Agent Targeting: Target foundation models directly using model="gemini-3.8-flash", or target autonomous managed/custom agents (antigravity-preview-05-2026, deep-research-preview-04-2026, or custom agents provisioned via client.agents.create()) using agent="<AGENT_ID>". Managed agents (antigravity-preview-05-2026 and custom agents) require environment="remote" to provision a sandbox. * Turn-Scoped Parameters: Parameters like tools, system_instruction, and generation_config are turn-scoped. They MUST be passed with each interaction request.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gemini-interactions-api)" and append agent-skills/1.0 (skill:gemini-interactions-api) to User-Agent headers.

1. Authentication

Before running any code, ensure you are authenticated with Application Default Credentials (ADC) and have the necessary API enabled.

  1. Login:

    gcloud auth application-default login
    
  2. Enable API (if not already enabled):

    gcloud services enable aiplatform.googleapis.com
    

2. Client Initialization

You can initialize the client using environment variables (recommended) or by passing explicit configuration parameters.

Option A: Environment Variables (Recommended)

Configure environment variables to let the SDK automatically resolve settings:

export GOOGLE_GENAI_USE_ENTERPRISE=true
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_LOCATION="global"

Python

from google import genai

# The SDK automatically picks up the environment variables
client = genai.Client()

TypeScript/JavaScript

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

// The SDK automatically picks up the environment variables
const ai = new GoogleGenAI();

Option B: Explicit Inline Parameters

Alternatively, pass configuration values directly inside your code:

Python

from google import genai
import google.auth

_, project_id = google.auth.default()
client = genai.Client(enterprise=True, project=project_id, location="global")

Typ

Questions fréquentes

Quelle version du SDK est nécessaire ?

google-genai 2.3.0 ou plus récent pour Python, et @google/genai 2.3.0 ou plus récent pour JavaScript.

Prend-elle en charge les anciens paquets Vertex ?

Non. Des paquets comme google-cloud-aiplatform ne sont pas pris en charge pour Interactions.

Gère-t-elle le streaming ?

Oui. Elle couvre les réponses diffusées en flux.

Détails

Description originale de l’auteur

Guides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.

repo: google/skills

Popularité

Étoiles GitHub
22k
Position au classement
#10262
Licence
Apache-2.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires