Skip to course content
Free LangChain course

LangChain for LLM Applications and RAG

Module 11 Activity

Scenario

The suite should run offline, cover the paths a real model will not produce on demand, and fail only for reasons worth acting on.

What you build

An offline test suite with injected fakes, structural assertions, and separate scoring for retrieval, citation and refusal.

Steps

  1. Refactor chain construction into functions that take the model as a parameter.
  2. Use scripted fake responses to drive the retry path and the refusal path deliberately.
  3. Replace every exact-match assertion with structural ones, including a hedging check.
  4. Build an eval set scoring retrieval, citation and refusal separately, with unanswerable cases included.
  5. Audit the suite for brittle and flaky tests. Delete or move them, and say where the timing assertions went.
  6. Confirm the whole suite runs with no key, no network and no cost.

Evidence to hand in

Review checklist