gemini-interactions-api

Implements Gemini Interactions API calls for text generation, agents, streaming, and migrations.

1|Updated May 26, 2026
One-click install
npx skills add https://github.com/nimdvir/dima-publishing --skill gemini-interactions-api-nimdvir
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gemini-interactions-api
Source: https://github.com/nimdvir/dima-publishing/tree/main/.agents/skills/gemini-interactions-api
Command: npx skills add https://github.com/nimdvir/dima-publishing --skill gemini-interactions-api-nimdvir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires google-genai, @google/genai, and includes references (resource) components.

What problem does it solve? Developers writing code against the Gemini API often rely on outdated training data, deprecated models like gemini-1.5 or gemini-2.0, legacy SDKs, and the old generateContent API, producing broken or obsolete code. This Skill supplies current model names, SDK versions, the new steps-based response schema, and migration checklists so generated code works against the live API. ## Core Features & Use Cases - Current API Patterns: Provides working Python and TypeScript examples for text generation, stateful multi-turn chat via previous_interaction_id, streaming with step.delta events, and structured output. - Managed and Research Agents: Covers the Antigravity managed agent, Deep Research background agents, and custom agent creation through client.agents.create(). - Migration Support: Includes a references/migration.md guide with scoping rules, generateContent-to-Interactions mapping tables, deprecated model replacements, and verification checklists. - Use Case: A developer asks to upgrade a codebase from gemini-2.0-flash and generateContent; the Skill directs scope confirmation, model string replacement with gemini-3.5-flash, and step-based response handling. ## Quick Start Ask the AI to write a Python script using the Gemini Interactions API that sends a prompt to gemini-3.5-flash and prints the response text.

Frequently Asked Questions about gemini-interactions-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call the Gemini Interactions API in Python?▼

Install google-genai version 2.3.0 or higher, create a client with genai.Client(), then call client.interactions.create() with a model like gemini-3.5-flash and your input. Read the result from interaction.output_text.

How do I migrate from generateContent to the Interactions API?▼

Replace client.models.generate_content() with client.interactions.create(), read responses from interaction.steps instead of response.text, and use previous_interaction_id for multi-turn context. The migration reference includes a full checklist and before/after mapping table.

Which Gemini models should I use instead of gemini-2.0 or gemini-1.5?▼

Models like gemini-2.0-flash and gemini-1.5-pro are deprecated; use gemini-3.5-flash as the drop-in replacement. For complex reasoning, gemini-3.1-pro-preview is the current Pro-tier option.

Does the Interactions API support multi-turn conversations?▼

Yes, pass previous_interaction_id with the prior interaction's ID and the server retains context across turns. Interactions are stored by default, though setting store=false disables this feature.

How do I run a Deep Research agent with the Gemini API?▼

Call client.interactions.create() with agent set to deep-research-preview-04-2026, background set to true, then poll client.interactions.get() until the status is completed. Use deep-research-max-preview-04-2026 for maximum exhaustiveness.

Why does my old Gemini SDK code break with the new schema?▼

SDK versions 2.0.0 and higher use the steps array instead of outputs and a polymorphic response_format instead of response_mime_type. Legacy packages google-generativeai and @google/generative-ai are deprecated and must be replaced.