Class SafetyAttributes
Safety attributes of a GeneratedImage or the user-provided prompt.
public record SafetyAttributes : IEquatable<SafetyAttributes>
- Inheritance
-
SafetyAttributes
- Implements
- Inherited Members
Properties
Categories
List of RAI categories.
[JsonPropertyName("categories")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? Categories { get; set; }
Property Value
ContentType
Internal use only.
[JsonPropertyName("contentType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ContentType { get; set; }
Property Value
Scores
List of scores of each categories.
[JsonPropertyName("scores")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<double>? Scores { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a SafetyAttributes object.
public static SafetyAttributes? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- SafetyAttributes
The deserialized SafetyAttributes object, or null if deserialization fails.