Skip to content

AgentPrismOnlineEvaluationBuilderExtensions

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Chain extensions that turn on the built-in model-based judge.

public static class AgentPrismOnlineEvaluationBuilderExtensions

objectAgentPrismOnlineEvaluationBuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This is an extension method, not a member of IAgentPrismBuilder: adding a member to the interface is a breaking change after release, adding an extension method is not.

AddModelRunJudge(IAgentPrismBuilder, Action<ModelRunJudgeOptions>)

Section titled “ AddModelRunJudge(IAgentPrismBuilder, Action<ModelRunJudgeOptions>)”

Registers AgentPrism’s built-in model-based IRunJudge implementation (ModelRunJudge).

public static IAgentPrismBuilder AddModelRunJudge(this IAgentPrismBuilder builder, Action<ModelRunJudgeOptions> configure)

builder IAgentPrismBuilder

Configuration chain.

configure Action<ModelRunJudgeOptions>

The judge’s model, criteria, and instructions.

IAgentPrismBuilder

The continuation of the chain.

This call ALONE scores nothing. The actual gate for online evaluation is AgentPrism:OnlineEvaluation:Enabled AND AgentPrism:OnlineEvaluation:SampleRate (the no-surprises rule: no run is sampled unless both are on). This extension only registers which model is USED as the judge.

Because ModelBinding is a nested type, it is set up in code rather than from a configuration section - the same pattern as other provider bindings (e.g. AgentDefinition.Model).

builder.AddAgentPrism()
.AddModelRunJudge(options =>
{
options.Model = new ModelBinding { Provider = "openai", Model = "gpt-5.4-mini" };
options.Criteria.Add("Does the response directly answer the question?");
});

ArgumentNullException

builder or configure is null.