gemini-api

Write Gemini 3.x API code using current google-genai SDK conventions.

Updated Nov 8, 2025
One-click install
npx skills add https://github.com/berad217/human-training --skill gemini-api-berad217
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemini-api
Source: https://github.com/berad217/human-training/tree/main/skills-source/gemini-api
Command: npx skills add https://github.com/berad217/human-training --skill gemini-api-berad217

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

This Skill solves the problem of writing broken Gemini API code based on outdated training data, which uses deprecated SDKs, removed sampling parameters, and incorrect configuration patterns that fail silently on current 3.x models and Gemma 4 hosted API instances.

Core Features & Use Cases

  • Current 3.x Convention Reference: Authoritative guidance for the latest google-genai (Python) and @google/genai (JavaScript) SDKs, including correct model IDs, thinking_level enum usage, and the recommendation to avoid setting temperature/top_p/top_k on Gemini 3.x models.
  • Runnable Use Case Cookbook: Pre-written, copy-safe snippets for common tasks including text generation with system instructions, image/PDF input, automatic and manual function calling, and structured JSON output with Pydantic or raw schemas.
  • Silent Failure Footgun Documentation: Explicit guidance for avoiding non-obvious breakages like missing function call id fields, incorrect multimodal content placement in function responses, and lost thought signatures in multi-turn chat history.
  • Use Case Example: A developer migrating legacy code from gemini-pro to gemini-3.5-flash can use this Skill to update their SDK import, fix deprecated thinking_budget config, and adjust function calling patterns to avoid silent empty responses.

Quick Start

Use the gemini-api skill to write a Python script that uses the Gemini 3.5 Flash model to translate English text to German, with a system instruction that ensures only the translated text is returned with no extra commentary or formatting.

Frequently Asked Questions about gemini-api

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

FAQPage Schema
How do I fix Gemini API code that returns empty responses after migrating to 3.x models?

Empty responses often stem from outdated pre-3.x conventions like incorrect SDK imports or missing function call id fields. Updating to the current google-genai SDK and fixing deprecated configuration patterns resolves these silent failure modes.

What is the correct way to configure temperature and top_p for Gemini 3 Flash models?

For Gemini 3 Flash models, the recommendation is to completely avoid setting temperature, top_p, and top_k parameters. Configuring these deprecated sampling parameters on current 3.x models can cause unexpected silent failures.

How do I get structured JSON output from the Gemini API using Python?

You can generate structured JSON output by providing Pydantic schemas or raw schemas to the current Gemini API. This ensures the 3.x model returns data formatted exactly to your specified structure without extra commentary.

Why does my Gemini API multimodal input fail silently with image processing?

Multimodal input fails silently when content is placed incorrectly in function responses or when thought signatures are lost in multi-turn chat history. Following current 3.x convention placement rules for images and PDFs prevents this.

Can I use the Gemini API for automatic function calling with Gemma 4 models?

Yes, the hosted Gemini API supports both automatic and manual function calling for the Gemma 4 model family. Using the correct current SDK imports and configuration ensures the function calls execute properly without silent failures.

What is the best way to migrate legacy gemini-pro code to gemini-3.5-flash?

Migrating to gemini-3.5-flash requires updating your SDK import, replacing deprecated thinking_budget config with the thinking_level enum, and adjusting function calling patterns to align with Google's current 2026 API contract.