Skip to content

Commit 210972b

Browse files
committed
Add a helper short-cut for Annotator.
1 parent 46d67ef commit 210972b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/modelgauge/annotator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ def annotate(self, annotation_request):
4444
def translate_response(self, request, response) -> SafetyAnnotation:
4545
"""Convert the raw response into the standardized SafetyAnnotation."""
4646
pass
47+
48+
def process(self, prompt: TextPrompt | ChatPrompt, response: SUTResponse) -> SafetyAnnotation:
49+
"""End-to-end processing of a single prompt+response pair."""
50+
annotator_request = self.translate_prompt(prompt, response)
51+
annotator_response = self.annotate(annotator_request)
52+
return self.translate_response(annotator_request, annotator_response)

0 commit comments

Comments
 (0)