MCPcopy
hub / github.com/openai/evals / test_eval_sample_2

Function test_eval_sample_2

evals/elsuite/basic/match_test.py:46–64  ·  view source on GitHub ↗
(
    completion: str,
    ideal: list[str],
    expected_match: bool,
)

Source from the content-addressed store, hash-verified

44 ],
45)
46def test_eval_sample_2(
47 completion: str,
48 ideal: list[str],
49 expected_match: bool,
50):
51 eval = Match(
52 completion_fns=[TestCompletionFn(completion)],
53 samples_jsonl="",
54 eval_registry_path=Path("."),
55 )
56
57 recorder = DummyRecorder(None)
58 with recorder.as_default_recorder("x"), patch.object(
59 recorder, "record_match", wraps=recorder.record_match
60 ) as record_match:
61 eval.eval_sample(dict(input="Hello", ideal=ideal), None)
62 record_match.assert_called_once_with(
63 expected_match, expected=ideal, picked=completion, sampled=completion, options=ideal
64 )
65
66
67@mark.parametrize(

Callers

nothing calls this directly

Calls 5

eval_sampleMethod · 0.95
MatchClass · 0.90
TestCompletionFnClass · 0.90
DummyRecorderClass · 0.90
as_default_recorderMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…