Skip to content
Back to skills

Gemini Interactions Api

ASecurity

Use when running multi-turn conversations with the Gemini Interactions API on Agent Platform.

  • 2 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 10, 2026
ai-agentspythongobashdebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill gemini-interactions-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gemini Interactions Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gemini Interactions Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-gemini-interactions-api/badge)](https://www.skillsdirectory.com/skills/loopyluci-gemini-interactions-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gemini-interactions-api
description: Use when running multi-turn conversations with the Gemini Interactions API on Agent Platform.
tags: [gemini, interactions, api, conversations, streaming, function-calling]
related_skills: [gemini-api, gemini-agents-api, google-cloud-recipe-auth]
---

# Gemini Interactions API

The modern way to execute Generative AI agent conversations, background research tasks, multi-turn chats, and structured workflows on Gemini Enterprise Agent Platform.

## Client Initialization

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

```python
from google import genai
client = genai.Client()
```

## Code Example: Single-Turn

```python
interaction = client.interactions.create(
    agent="your-agent-id",
    input="Explain serverless computing in one sentence."
)
print(interaction.output_text)
```

## Code Example: Multi-Turn Stateful Conversation

```python
# Turn 1
turn1 = client.interactions.create(
    agent="your-agent-id",
    input="Hi! My name is John.",
    store=True
)
print(f"Turn 1: {turn1.output_text}")

# Turn 2 (references previous interaction)
turn2 = client.interactions.create(
    agent="your-agent-id",
    input="What is my name?",
    previous_interaction_id=turn1.id
)
print(f"Turn 2: {turn2.output_text}")
```

## Code Example: Streaming

```python
for event in client.interactions.create(
    agent="your-agent-id",
    input="Write a poem about debugging.",
    stream=True
):
    if event.event_type == "step.delta" and event.delta.type == "text":
        print(event.delta.text, end="", flush=True)
```

## Code Example: Structured Output

```python
from pydantic import BaseModel

class Book(BaseModel):
    title: str
    author: str
    year_published: int

interaction = client.interactions.create(
    agent="your-agent-id",
    input="Recommend a sci-fi book.",
    response_format=Book
)
print(interaction.output_text)
```

## Common Pitfalls

- **GEAP requires provisioned agent**: Use `agent="..."` not `model="..."` on Agent Platform
- **Legacy SDKs unsupported**: `google-cloud-aiplatform` and `google-generativeai` are not compatible
- **Turn-scoped parameters**: Tools, system_instruction, and generation_config must be passed with each request
- **SDK version**: Use `google-genai >= 2.3.0` for Interactions API support

## Verification Checklist

- [ ] Client initializes without errors
- [ ] Single-turn interaction returns response
- [ ] Multi-turn conversation maintains state
- [ ] Streaming yields typed events
- [ ] Structured output returns valid JSON

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.