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
- Convert every prompt to a template with declared variables. Prove one fails at render time on a missing input.
- Render the messages and inspect the roles. Decide deliberately where retrieved context should live and say why.
- Swap the model object for a second provider without touching the chain, then re-run your eval set and report what changed.
- Move model, temperature and limits into the environment with a fake model as the default.
- Add
prompt_versionandpolicy_versionto your config and to every log line. - Write down what
temperature=0does and does not guarantee for your tests.
Evidence to hand in
- The templates with declared inputs and one render-time failure.
- The rendered messages with the role decision explained.
- Eval results before and after the provider swap, per case.
- The environment-driven config with versions.
- Your written position on temperature and test assertions.
Review checklist
- No prompt is built by concatenation.
- The role of retrieved context is a stated decision.
- The provider swap was followed by a full eval re-run, per case.
- The default model is a fake, so misconfiguration fails safely.
- No secret is in any object that gets logged.
