Gemini Interactions API Guide
Build stateful, multi-turn Gemini interactions on Google Agent Platform.
The skill documents ADC, project, location, and server-side storage, giving partial data-flow transparency and distinguishing store=True from store=False. It does not specify least-privilege IAM roles, sensitive prompt/data retention risks, tool permission boundaries, user confirmation, cost controls, or rollback, so substantial points are deducted for incomplete safety and recovery guidance: 11/25.
The documented paths cover Python, JS/TS, REST, multi-turn use, streaming, structured output, and function calling, and advise reading typed step kinds. However, there is no test or CI evidence, no pinned compatibility validation, and little handling for authentication failure, invalid agents, network interruption, stream errors, tool failures, or schema mismatches. This supports a plausible happy path only: 8/20.
The audience and scenarios are reasonably clear, including multi-turn conversations, background execution, streaming, structured output, and function calling; the GEAP requirement for a provisioned agent is also explicit. Boundaries, input/output contracts, permission prerequisites, Chinese-language support, and mainland-China network fit are not sufficiently described, and the core service depends on reachability of Google cloud services: 10/15.
The skill has clear sections, usage examples, a data-model reference, and storage guidance. Repository context supplies Apache-2.0 licensing, installation, maintenance status, issue reporting, and contribution paths. The skill itself lacks a changelog, named maintenance owner, compatibility matrix, FAQ, troubleshooting, and explicit dependency-installation guidance; its model and API version claims also lack stability context: 8/15.
The examples directly address common Interactions API tasks and are provided in Python, JS/TS, and REST, making them useful starting points. However, a provisioned agent, authentication, IAM, API enablement, and environment configuration remain external prerequisites, and no statically verifiable complete successful output or alternative comparison is provided. The static ceiling therefore supports 7/15.
The document includes links to Google documentation, concrete SDK versions, an endpoint, event types, and step fields, providing partial auditability. The response example and version/model assertions cannot be independently reproduced during this static review, and the supplied repository material shows no skill-specific test suite, CI coverage, or third-party execution evidence: 4/10.
- Interactions default to store=True, which may retain prompts, personal information, or tool-related data server-side; confirm retention, access scope, and disablement before using sensitive data.
- The skill instructs users to log in with gcloud, enable an API, and call a cloud agent, but does not define least-privilege IAM, cost controls, or a user-confirmation workflow.
- Model names, SDK versions, and API behavior are volatile; verify current official documentation and service availability before implementation.
- Streaming, function-calling, and abnormal paths lack error-handling examples; the snippets should not be treated as production-validated implementations.
- Core functionality depends on network reachability to Google Cloud/Gemini Enterprise Agent Platform and may be affected by mainland-China connectivity, account region, or enterprise policy.
What does this skill do, and when should you use it?
This skill guides developers through the server-managed Gemini Interactions API on Gemini Enterprise Agent Platform. It covers authentication, client setup, single- and multi-turn conversations, real-time streaming, structured output, and function calling. Examples are provided for Python, TypeScript/JavaScript, and REST with curl. The documented Agent Platform flow requires Google Cloud ADC, the Vertex AI API, and a provisioned agent rather than direct base-model calls.
Shows how to authenticate with gcloud and enable aiplatform.googleapis.com; initialize Python or TypeScript/JavaScript clients with the Google Gen AI SDK; create single-turn and stateful requests using previous_interaction_id; process streaming events; produce schema-constrained JSON with Pydantic or TypeScript schemas; inspect function_call steps, execute local functions, and submit function_result steps; send synchronous, stateful, and SSE streaming requests through the REST endpoint; and interpret steps, content, output_text, storage, and retention behavior.
- A Python or JavaScript developer who needs server-managed conversation state on Google Agent Platform.
- An interactive application developer who needs to render model output incrementally as it streams.
- An engineer who wants an agent to call a local function and receive its result in the interaction history.
- An application developer who needs JSON conforming to a Pydantic or TypeScript schema.
- A developer debugging Interactions API calls with curl or a non-Python/JavaScript environment.
What are this skill's strengths and limitations?
- Covers Python, TypeScript/JavaScript, and REST usage.
- Includes stateful turns, streaming events, structured output, and function calling.
- Explains the modern steps schema, output_text, and typed step categories.
- Provides authentication, environment-variable, and Agent Platform configuration examples.
- Requires a provisioned agent; the source says direct base-model calls with model are not yet supported on Agent Platform.
- Requires Google Gen AI SDK >= 2.3.0; legacy Google SDKs are unsupported.
- Examples depend on a Google Cloud project, ADC, API enablement, and network access.
- The source provides no test suite, compatibility matrix, or cost guidance.
How do you install this skill?
Run npx skills add google/skills, then select skills/cloud/gemini-interactions-api when prompted. The repository contains 90 skills; the source does not document a separate package or standalone installation command for this skill.
How do you use this skill?
After installation, ask a compatible Agent Skill client: Guide me through a Python example using the Google Gemini Interactions API on Agent Platform with multi-turn state, streaming, and function calling. Before running code, execute gcloud auth application-default login and gcloud services enable aiplatform.googleapis.com, set GOOGLE_GENAI_USE_ENTERPRISE=true, GOOGLE_CLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION=global, and provide the ID of a provisioned agent.
How does this skill compare with similar options?
The skill explicitly contrasts the Google Gen AI SDK with legacy packages such as google-cloud-aiplatform, @google-cloud/vertexai, and google-generativeai, which it states are unsupported for Interactions. It also distinguishes Agent Platform's required agent target from other Gemini API contexts that use model.