Module 2 (Gemini) - Lesson 2: Gemini Prompts Overview

Prompting with Google Gemini: patterns, navigation, and key differences.

Published: 1/15/2026

Gemini Prompting: From Basic to Advanced

This lesson maps the Gemini lessons you will complete in this module and highlights the key API differences versus OpenAI and Anthropic.

Lesson Map

Gemini vs Other Providers

  • Method: gemini.models.generateContent instead of anthropic.messages.create or openai.responses.create
  • Request body: contents can be a string or { role, parts } object
  • System behavior: config.systemInstruction replaces Anthropic system
  • Streaming: generateContentStream returns an async iterator of chunks with text and usageMetadata
  • Structured output: config.responseMimeType: "application/json" plus responseJsonSchema for light validation
  • Tools: Declare tools with functionDeclarations; function calls arrive in candidates[0].content.parts

Quick Start Checklist

  • ✅ Add GEMINI_API_KEY to your .env
  • ✅ Install the SDK: pnpm add @google/genai
  • ✅ Run the first example: pnpm tsx src/gemini/basic-prompt.ts

Continue to Lesson 2a to send your first Gemini prompt.