Skip to course content
Free LangChain course

LangChain for LLM Applications and RAG

Module 02 Activity

Scenario

Your prompts are f-strings and your configuration is in the code. Both need to change before this is testable.

What you build

Templates with declared inputs, a provider swap proven on an eval set, and configuration read from the environment with versions recorded.

Steps

  1. Convert every prompt to a template with declared variables. Prove one fails at render time on a missing input.
  2. Render the messages and inspect the roles. Decide deliberately where retrieved context should live and say why.
  3. Swap the model object for a second provider without touching the chain, then re-run your eval set and report what changed.
  4. Move model, temperature and limits into the environment with a fake model as the default.
  5. Add prompt_version and policy_version to your config and to every log line.
  6. Write down what temperature=0 does and does not guarantee for your tests.

Evidence to hand in

Review checklist