diff --git a/evals/record.py b/evals/record.py index 5afe5a859a..4f428d810f 100644 --- a/evals/record.py +++ b/evals/record.py @@ -215,6 +215,15 @@ def record_sampling(self, prompt, sampled, sample_id=None, **extra): } self.record_event("sampling", data, sample_id=sample_id) + def record_function_call(self, name, arguments, return_value, sample_id=None, **extra): + data = { + "name": name, + "arguments": arguments, + "return_value": return_value, + **extra, + } + self.record_event("function_call", data, sample_id=sample_id) + def record_cond_logp(self, prompt, completion, logp, sample_id=None, **extra): data = { "prompt": prompt, @@ -591,6 +600,10 @@ def record_sampling(prompt, sampled, **extra): return default_recorder().record_sampling(prompt, sampled, **extra) +def record_function_call(name, arguments, return_value, **extra): + return default_recorder().record_function_call(name, arguments, return_value, **extra) + + def record_cond_logp(prompt, completion, logp, **extra): return default_recorder().record_cond_logp(prompt, completion, logp, **extra)