| Example | Description |
|---|---|
| Agent with Thinking Budget | Cap Gemini 2.5 Pro’s reasoning with thinking_budget and surface thought summaries with include_thoughts. |
| Google Audio Input Bytes Content | Pass a downloaded WAV file to Gemini as raw audio bytes for analysis. |
| Google Audio Input File Upload | Upload an MP3 through the Gemini Files API and reuse the remote file across runs. |
| Google Audio Input Local File Upload | Send a local MP3 to Gemini with Audio(filepath) and stream the analysis. |
| Google Basic | Run a Gemini 3.5 Flash agent with sync, async, and streaming responses. |
| DB | Persist Gemini agent sessions in Postgres and carry history across turns. |
| External URL Input | Pass a public HTTPS PDF URL straight to Gemini 3.5 Flash with File(url=…), no download step. |
| Google File Search Advanced | Manage multiple Gemini File Search stores with custom chunking and metadata filters. |
| Google File Search Basic | Create a Gemini File Search store, upload a document, and query it with citations. |
| Google File Search RAG Pipeline | Build an async RAG pipeline over a directory of files with Gemini File Search. |
| File Upload with Cache | Upload a transcript with the Gemini Files API, cache it with a 5-minute TTL, and query the cached content to cut prompt tokens. |
| GCS File Input | Summarize a PDF straight from a Google Cloud Storage gs:// URI using Gemini on Vertex AI, with no download or re-upload. |
| Gemini 2 to 3 | Migrate a Gemini 2.5 session to Gemini 3.1 Pro Preview by sharing history through SqliteDb. |
| Gemini 3 Pro | Migrate the pinned Gemini 3 Pro example to Gemini 3.1 Pro Preview before using web search and SQLite chat history. |
| Gemini 3 Pro Thinking Level | Migrate the pinned thinking-level example to Gemini 3.1 Pro Preview and stream the async response. |
| Grounding with Gemini | Grounding enables Gemini to search the web and provide responses backed by real-time information with citations. |
| Google Image Editing | Send an image to Gemini and get back an edited version using image response modalities. |
| Google Image Generation | Generate an image with Gemini response modalities and open it with PIL. |
| Google Image Input | Pass an image URL to a Gemini agent and fetch related news with web search. |
| Google Image Input File Upload | Upload an image through the Gemini Files API and combine it with web search. |
| Imagen Tool | Generate an image with the GeminiTools Imagen toolkit driven by a GPT-4o agent and save the result as a PNG. |
| Imagen Tool Advanced | Generate an image with the Imagen 4 model through GeminiTools on Vertex AI and save the result as a PNG. |
| Knowledge | Query a PDF knowledge base stored in PgVector with Gemini embeddings. |
| PDF Input File Upload | Upload a PDF to the Gemini Files API, then ask an agent to summarize it and suggest a recipe from it. |
| Google PDF Input Local | Attach a local PDF to a Gemini agent and ask follow-up questions with history. |
| Google PDF Input URL | Summarize a PDF from a URL and ask follow-ups using InMemoryDb chat history. |
| Retry | Review retry settings and why invalid model IDs cannot reliably exercise the retry path. |
| S3 URL File Input | Generate an S3 pre-signed URL with boto3 and pass it straight to Gemini to summarize the PDF without downloading it. |
| Google Search with Gemini | The search tool enables Gemini to access current information from Google Search. |
| Storage and Memory | Combine PgVector knowledge, Postgres memory, session summaries, and web search on Gemini. |
| Google Structured Output | Return an event plan as a Pydantic schema with enums, formats, and nested objects. |
| Google Text To Speech | Generate speech with a Gemini TTS model and write the audio to a WAV file. |
| Google Thinking Agent | Solve a logic puzzle with a Gemini thinking budget and thought summaries enabled. |
| Tool Use | Add web search tools to a Gemini agent and run sync, streaming, and async. |
| URL Context | Compare two recipe pages by enabling Gemini’s url_context to fetch page content. |
| URL Context with Search | Combine URL context with Google Search for comprehensive web analysis. |
| Vertex AI Search with Gemini | Vertex AI Search allows Gemini to search through your data stores, providing grounded responses based on your private knowledge base. |
| Vertex AI | Authenticate Gemini against Vertex AI with environment variables or explicit project_id and location parameters on the Gemini model. |
| Google Vertex AI With Credentials | Authenticate Gemini on Vertex AI with explicit service account credentials. |
| Google Video Input Bytes Content | Download an MP4 and pass it to Gemini as raw video bytes for analysis. |
| Google Video Input File Upload | Upload a video through the Gemini Files API and poll until it is ready to query. |
| Google Video Input Local File Upload | Pass a local video file to Gemini and ask the agent to describe its contents. |
| Google Video Input YouTube | Send a YouTube URL as video input to Gemini and have the agent describe it. |
Gemini
Gemini examples for multimodal input, file search, grounding, knowledge, thinking, structured output, tools, and Vertex AI.