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

Function test_eval_sample

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

Source from the content-addressed store, hash-verified

17 ],
18)
19def test_eval_sample(
20 completion: str,
21 ideal: list[str],
22 expected_match: bool,
23):
24 eval = Match(
25 completion_fns=[TestCompletionFn(completion)],
26 samples_jsonl="",
27 eval_registry_path=Path("."),
28 )
29
30 recorder = DummyRecorder(None)
31 with recorder.as_default_recorder("x"), patch.object(
32 recorder, "record_match", wraps=recorder.record_match
33 ) as record_match:
34 eval.eval_sample(dict(input="Hello", ideal=ideal), None)
35 record_match.assert_called_once_with(
36 expected_match, expected=[ideal], picked=completion, sampled=completion, options=[ideal]
37 )
38
39
40@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…