SESSION 6

Session 6 — LangChain Multi-Provider

Same code, three providers: OpenAI, Anthropic, and Gemini.

60–90 minutes1 motivation + 10 hands-on exercises
What you'll be able to do by the end
  • ✓ Explain why LangChain exists and when NOT to use it
  • ✓ Swap between OpenAI, Anthropic, and Gemini by changing one string
  • ✓ Stream tokens live and batch many prompts concurrently
  • ✓ Define tools with @tool and run the full execution loop with LangChain message classes
  • ✓ Produce typed Pydantic objects or dict-shaped data with one line of code
Start with the motivation

Before any exercise: read Why LangChain? It answers the question "I just learned raw SDKs in Session 5 — why am I learning a wrapper now?" 15 minutes, zero code to run, sets up everything else.

Read Why LangChain

Prerequisites

The learning arc

Why
lesson 00
Basics
00–04
Tools
05–07
Structured
08–09

Exercises

When you get stuck or finish