Judgment Client
The JudgmentClient
is the main interface for interacting with the Judgment API.
Initializing the Judgment Client
A client can be initialized using an API key. To receive an API key, please send us an email at contact@judgmentlabs.ai.
Setting the JUDGMENT_API_KEY
environment variable to your API key allows you to initialize the client without passing an API key to the constructor.
Running an Evaluation
The client.run_evaluation
method is the primary method for executing evaluations.
The run_evaluation
method has the following keyword arguments:
examples
: A list of Example objects to evaluate.model
: The model to use for the evaluation, such as GPT-4o or QWEN.scorers
: A list of Scorer objects to use for the evaluation.use_judgment
: Whether to use Judgment’s infrastructure to execute the evaluation. Defaults toTrue
.log_results
: Whether to log the results of the evaluation to the Judgment platform. Defaults toTrue
.override
: Whether to override an existing evaluation with the same name. Defaults toFalse
.project_name
: The name of the project to use for the evaluation. Defaults to"default_project"
.eval_run_name
: The name of the evaluation run. Defaults to"default_eval_run"
.
In Judgment, projects are used to organize workflows, while evaluation runs are used to group versions of a workflow for comparative analysis of evaluations. As a result, you can think of projects as folders, and evaluation runs as sub-folders that contain evaluation results.