SexualEvaluator class
Evaluates AI responses for sexual content.
Returns a NumericMetric named "Sexual" with a severity score 0–7
(fail above 0).
- Inheritance
-
- Object
- ContentSafetyEvaluator
- SexualEvaluator
- Annotations
-
- @Source(name: 'SexualEvaluator.cs', namespace: 'Microsoft.Extensions.AI.Evaluation.Safety', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Evaluation.Safety/')
Constructors
- SexualEvaluator({required ContentSafetyServiceConfiguration configuration})
- Creates a SexualEvaluator.
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
modelResponseand 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
- sexualMetricName → const String
- The name of the NumericMetric returned by this evaluator.