# Few-shot examples for the judge
prompt = "Explain the difference between correlation and causation."
# Example 1: Score 1 (Irrelevant)
score_1_completion = "Correlation is when two things happen together. Causation is when something causes something else."
score_1_thread = StringThread([
("user", prompt),
("assistant", score_1_completion)
])
# Example 2: Score 3 (Adequate)
score_3_completion = (
"Correlation means two variables move together (both go up or both go down). "
"Causation means one variable actually causes the change in the other. "
"A classic example is ice cream sales and drowning deaths—both increase in summer, but ice cream doesn't cause drowning."
)
score_3_thread = StringThread([
("user", prompt),
("assistant", score_3_completion)
])
# Example 3: Score 5 (Excellent)
score_5_completion = (
"Correlation describes a statistical relationship between two variables where they tend to move together. "
"When one increases, the other tends to increase (positive correlation) or decrease (negative correlation). "
"However, correlation does not imply causation. Two variables can be correlated for several reasons:\n"
"1. One causes the other (genuine causal link)\n"
"2. A third variable causes both (confounding variable)\n"
"3. The relationship is coincidental\n\n"
"Example: Ice cream sales and drowning deaths are positively correlated, both peak in summer. "
"But ice cream doesn't cause drowning—warm weather is the confounding variable that causes both. "
"To establish causation, you need controlled experiments or causal inference methods that rule out confounds."
)
score_5_thread = StringThread([
("user", prompt),
("assistant", score_5_completion)
])
# Create RangeJudgeShot objects
shots = [
RangeJudgeShot(
thread=score_1_thread,
reasoning="This explanation is too brief and lacks the key insight that correlation does not imply causation. It provides only basic definitions without examples or nuance.",
score=1
),
RangeJudgeShot(
thread=score_3_thread,
reasoning="This explanation covers the main distinction and provides a useful example. However, it could go deeper by explaining confounding variables more clearly.",
score=3
),
RangeJudgeShot(
thread=score_5_thread,
reasoning="This is a comprehensive explanation that defines both concepts clearly, provides multiple reasons for correlation without causation, includes a concrete example, and explains the role of confounding variables. The structure is logical and easy to follow.",
score=5
),
]
print(f"🎓 Created {len(shots)} few-shot examples:")
for shot in shots:
print(f" 📌 Score {shot.score}: {len(shot.thread.last_content())} characters")