Project 18: Registration Confirmation Bot
AI Engineer
Builds on these lessons
Current Task
Objective
Evaluating an LLM chain means comparing its output against an expected answer with a defined criterion, not just eyeballing responses.
Task: write a simple exact-match evaluator for a registration confirmation message and print whether it passed.
index.py
def evaluate(prediction: str, reference: str) -> bool:
return prediction.strip().lower() == reference.strip().lower()
prediction = "Your registration is confirmed."
reference = "Your registration is confirmed."
print(evaluate(prediction, reference))
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview