◉GEMINI LABJP
●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…●ARGON — gemini-4-argon is generally available as of 10/13, aimed at complex coding, agents, math and science●DEEP RES — deep-research-pro-preview-12-2025 shuts down 10/23, 6 days left. Move to deep-research-preview-04-2026●NANO — gemini-nano-banana-2.1 is GA (10/06). gemini-3.1-flash-image is deprecated with no shutdown date yet●MCP — One write-up cut an 85,000-token tool result to 310 tokens by wrapping it in an ADK FunctionTool●FLASH — gemini-3.7-flash and 3.5-flash now route automatically to newer Flash models (10/08)●NEW — Stop Re-Reading Every Crash Report: Gre…
TAG

Python

159 articles
← Back to all tags
Related:
gemini-api94Gemini API41production40gemini23troubleshooting22automation18cost-optimization13multimodal11indie-dev9structured-output6error6function-calling6
◈ Gemini API/2026-08-23Intermediate

Streaming Gemini TTS: concatenate the PCM, write the WAV header once

Streamed Gemini TTS does not arrive as an audio file. It arrives as raw PCM fragments. Here is what happens when you wrap each fragment in its own WAV header, measured on my machine, plus the receiving code that avoids it.

⟐ Gemini Dev/2026-08-20Beginner

A minimal pre-send guard for Gemini-drafted app review replies

Store replies are risky after you hit send, not before. Here is a short Python guard that blocks unkeepable promises, leaked contact details, and register slips, plus the two false positives it produced on the first run.

◈ Gemini API/2026-08-17Intermediate

After generated_images Disappeared: Three Branches Between the Response and a Saved File

Once you switch to generate_content, the line that breaks is usually the save. Here are the three branches on the response side - zero image parts, a shifting image count, and picking the extension - plus a receiver function you can drop in.

◈ Gemini API/2026-08-15Beginner

generate_images Survives Until 2027. Your Image Generation Still Stops on August 17

google-genai 2.18.1 still ships generate_images, and the SDK deprecation notice points at 2027. The imagen-4.0 models, meanwhile, shut down on August 17. Here is what those two deadlines actually mean, measured on my own machine.

◈ Gemini API/2026-08-14Intermediate

Rewriting generate_images as generate_content, where the arguments actually go

Ahead of the August 17 Imagen shutdown, I checked the SDK directly: of the 17 arguments in GenerateImagesConfig, only 5 move across unchanged. Here is the mapping, a compatibility layer that keeps callers working, and a way to verify the request shape without an API key.

⬡ Gemini Advanced/2026-07-16Advanced

What language should your system instruction be in? Measuring three approaches when most prompts arrive in the user's language

Keep the system instruction in English, or translate it into the user's language? I measured input tokens per language with countTokens, then lined up output-language match and schema compliance to find where nine tokens is enough.

◈ Gemini API/2026-07-15Advanced

Sample what you already accepted — an audit budget that catches silent quality drift

A confidence gate only ever looks at output the model hesitated on. Silent drift sinks into the batch that sailed through. Working from a fixed 30-minutes-a-day review budget, this walks through deriving detection time from the binomial, reallocating the same budget across risk strata, and catching slow decay with a cumulative monitor.

◈ Gemini API/2026-07-04Advanced

When Gemini API Leaks Japanese Into Your English Output Once in a While — Field Notes on Measuring the Contamination Rate and Tightening It in Stages

You told Gemini to answer in English, and 3 out of 100 runs slip a Japanese sentence into the tail. Here is why you cannot stop that 'once in a while', and a production pattern that measures the contamination rate as an SLO and tightens it with graded recovery, with working code.

◈ Gemini API/2026-05-18Intermediate

Building Automatic Wallpaper Category Classification with Gemini Vision

An indie developer shares how they implemented automatic wallpaper image classification with the Gemini Vision API — including accuracy results, real pitfalls, structured-output tips, and a cost comparison with GPT-4o Vision.

◈ Gemini API/2026-05-18Advanced

Gemini API asyncio Patterns for Production: How I Cut Processing Time by 80% in My Indie App Backend

A hands-on report on integrating Gemini API asyncio into a production backend. Covers Semaphore-based rate limiting, exponential backoff, partial failure handling, and what breaks when you move the same pipeline to the current google-genai SDK.

◈ Gemini API/2026-05-17Beginner

Auto-generating Japanese and English Release Notes from git log with Gemini API — A Real Implementation from Beautiful HD Wallpapers v2.1.0

I realized I was spending 1–2 hours per release writing notes in multiple languages. Here's how I automated that with Gemini API and git log — tested on Beautiful HD Wallpapers v2.1.0, with code you can run today.

◈ Gemini API/2026-05-17Intermediate

Diagnosing INVALID_ARGUMENT Errors in Gemini API Batch Image Analysis

When using the Gemini API to analyze multiple images at once, INVALID_ARGUMENT errors can be surprisingly hard to diagnose. This guide covers the three root causes—MIME type mismatches, inline data size limits, and contents structure errors—with code to fix each one.