The following tutorial describes how to use your own evaluators in logging with client.evalute(...). See the Patronus Evaluators and evaluation API section for how to use Patronus evaluators in logging.
To use any evaluator in Logging, simply wrap the evaluator definition with the register_local_evaluator decorator. Below is an example that invokes a "reverse" evaluator that returns pass/fail scores using a random number generator.
Running this script, we see the eval result in the Logs dashboard.
Here we provide inputs and outputs inMetadata, but it can also contain fine grained scores produced by the evaluation. The external: prefix indicates that the evaluator was registered locally.
Metadata contains evaluation result information, whereas tags are used for tracking application configurations. See Logs and Monitoring to learn more about tags, filtering and visualizing evals.