SafetyRating

public final class SafetyRating


An assessment of the potential harm of some generated content.

The rating will be restricted to a particular category.

Summary

Public fields

final Boolean

Indicates whether the content was blocked due to safety concerns.

final @NonNull HarmCategory

The category of harm being assessed (e.g., Hate speech).

final @NonNull HarmProbability

The likelihood of the content causing harm.

final float

A numerical score representing the probability of harm, between 0 and

final HarmSeverity

The severity of the potential harm.

final Float

A numerical score representing the severity of harm.

Public fields

blocked

public final Boolean blocked

Indicates whether the content was blocked due to safety concerns.

category

public final @NonNull HarmCategory category

The category of harm being assessed (e.g., Hate speech).

probability

public final @NonNull HarmProbability probability

The likelihood of the content causing harm.

probabilityScore

public final float probabilityScore

A numerical score representing the probability of harm, between 0 and

severity

public final HarmSeverity severity

The severity of the potential harm.

severityScore

public final Float severityScore

A numerical score representing the severity of harm.