GotGemini

How to use this book

Reading paths through the four Parts, where the runnable code lives, and how to handle the inevitable model-name drift.

v2· gemini-3.5-flash / ai-studio v1beta· June 22, 2026

A working developer doesn't read a 400-page book cover-to-cover. You skim, you jump, you find the snippet that solves the thing you're hitting today, and you bookmark the chapter to come back to. This book is built for that read pattern.

Reading paths

If you've never shipped with an LLM: start with Understanding Models (Chapter 2 in this volume), then Getting Started with the Gen AI SDK (Chapter 4 — outline Ch 2), then Prompting & Context Engineering (outline Ch 4).

If you've shipped with Gemini 2.x: read the Platform essay (Chapter 1.1); the Thinking chapter (outline Ch 3), because the default thinking level dropped between 3.1 and 3.5 and it will surprise you; and the Migration chapter (outline Ch 23).

If you're building an agent: start in Part III. Function Calling first (Ch 12), then the agent harness chapter that matches your scale (Ch 16 for one process, Ch 17 for multiple agents). Come back to Part II only for modalities your agent needs.

If you're scaling toward production: Part IV is your home. Evals before performance (you can't tune what you can't measure), and migration patterns when the platform changes around you.

Conventions in the code

Every code block in this book:

  • Uses the unified google-genai Python SDK as the default. We show TypeScript / Go / REST when the chapter is about those surfaces specifically.
  • Names the model explicitly in every snippet. Floating model references like gemini-flash-latest are convenience in tutorials elsewhere; here we always pin so you can tell what version a snippet was tested against.
  • Reads secrets from environment variables,os.environ["GEMINI_API_KEY"], never inlines them. If your snippet ever wants to inline a key, that's a code smell to fix before commit.
  • Is self-contained where possible. If a snippet needs setup, the surrounding prose names what's required, and the chapter's Colab stitches them together end-to-end.
pythonCanonical setup — assume this before every snippet
# The canonical setup, used implicitly throughout the book.
import os
from google import genai

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
# (Skip the api_key arg to use ADC on Vertex AI — see Chapter 1.6.)

Where the Colabs live

Chapters marked with [C] in the table of contents ship a runnable Colab notebook. The notebooks live in the gotgemini/colabs GitHub repo, one notebook per chapter topic. Each published essay's "Open in Colab" button points at the exact commit the essay was published against, so the notebook you open matches the prose you're reading, even if the repo's main branch has moved on.

Notebooks are designed to run on the AI Studio free tier with a personal API key, unless the chapter is specifically about Vertex AI features. The first cell of every notebook configures the SDK and prompts for the key.

Reading moving facts

The Gemini platform moves fast. By the time an essay reaches you, some specifics may have changed: exact prices, exact context-window sizes for preview models, rate limits, and the GA status of features. When those details matter, the essay names the source you should check before making a production bet.

Most of the book is stable for years: architecture, workflow, debugging habits, and integration patterns. The moving parts are the operational facts. Each chapter ends with a References block that lists the doc URLs we used; when something changes, the canonical source is one hop away.

When the platform changes

Every essay in this book records the targets it was written against: model ID, API surface, version. When Google deprecates a model or changes an API, the workflow engine surfaces every essay whose targets matches the deprecated set, and the maintainers bulk-enqueue revisions. The chapter you're reading might be a v1, v2, or v5; published versions are immutable history, so the URL you've bookmarked keeps working even as the content evolves.

If a snippet in this book stops running, run pip install -U google-genai first; if that doesn't fix it, check Chapter 23 (Migration) or open the live changelog at ai.google.dev/changelog.

The fastest readers will get the most value by pairing every chapter with one artifact from their own stack: a real prompt, a real tool schema, a real eval row, or a real cost log. Generic examples teach the API shape; your own artifact reveals the sharp edge. That is usually where the expensive lesson lives.

References

  • Gen AI SDK install
  • Colab repo — (one notebook per chapter)
  • Chapter 23Migration (how to handle platform drift)

Discussion

Questions and comments from readers.