Anthropic Claude¶
Use Anthropic Claude models with the anthropic: prefix.
Setup¶
Available Models¶
| Model | Use Case |
|---|---|
claude-sonnet-4-0 | Latest, best quality |
claude-3-5-sonnet-latest | High quality, good speed |
claude-3-5-haiku-latest | Fast and affordable |
Usage¶
from eval_lib import AnswerRelevancyMetric, CustomEvalMetric
metric = AnswerRelevancyMetric(
model="anthropic:claude-3-5-sonnet-latest",
threshold=0.7
)
custom = CustomEvalMetric(
model="anthropic:claude-sonnet-4-0",
threshold=0.7,
name="ContentQuality",
criteria="Evaluate content quality and accuracy"
)