DSPy: The framework for programming—not prompting—language models
Python
Update module signatures
arnavsinghvi11b85667212c80
diff --git a/dspy/evaluate/auto_evaluation.py b/dspy/evaluate/auto_evaluation.pyindex f55832ab7..1ec659540 100644--- a/dspy/evaluate/auto_evaluation.py+++ b/dspy/evaluate/auto_evaluation.py@@ -1,7 +1,7 @@import dspyclass AnswerCorrectnessSignature(dspy.Signature):- """Determines if predicted answer matches the gold answer."""+ """Verify that the predicted answer matches the gold answer."""question = dspy.InputField()gold_answer = dspy.InputField(desc="correct answer for question")@@ -18,12 +18,12 @@ class AnswerCorrectness(dspy.Module):class AnswerFaithfulnessSignature(dspy.Signature):- """Checks if answer for question is based on rationale."""+ """Verify that the predicted answer is based on the provided context."""context = dspy.InputField(desc="relevant facts for producing answer")question = dspy.InputField()answer = dspy.InputField(desc="often between 1 and 5 words")- faithful = dspy.OutputField(desc='True or False')+ is_faithful = dspy.OutputField(desc='True or False')class AnswerFaithfulness(dspy.Module):def __init__(self):@@ -31,4 +31,4 @@ class AnswerFaithfulness(dspy.Module):self.evaluate_faithfulness = dspy.ChainOfThought(AnswerFaithfulnessSignature)def forward(self, context, question, answer):- return self.evaluate_faithfulness(context=context, question=question, answer=answer)\ No newline at end of file+ return self.evaluate_faithfulness(context=context, question=question, answer=answer)