ProtectedMaterialEvaluator class

Evaluates AI responses for copyrighted or otherwise protected material.

Returns a NumericMetric named "ProtectedMaterial" scored 0–7 (fail above 0).

Inheritance
Annotations
  • @Source(name: 'ProtectedMaterialEvaluator.cs', namespace: 'Microsoft.Extensions.AI.Evaluation.Safety', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Evaluation.Safety/')

Properties

annotationTask String
The annotation task name sent to the service.
finalinherited
configuration ContentSafetyServiceConfiguration
Azure AI Foundry service configuration.
finalinherited
evaluationMetricNames List<String>
The names of the EvaluationMetrics produced by this evaluator.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

evaluate(Iterable<ChatMessage> messages, ChatResponse modelResponse, {ChatConfiguration? chatConfiguration, Iterable<EvaluationContext>? additionalContext, CancellationToken? cancellationToken}) Future<EvaluationResult>
Evaluates modelResponse and returns an EvaluationResult.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

protectedMaterialMetricName → const String
The name of the NumericMetric returned by this evaluator.