Moderation
ModerationsResult.swift:13- iOS
- 13.0+
struct Moderation
struct Moderation
import OpenAI
struct ModerationsResult
init(from decoder: any Decoder) throws
let id: String
let model: Model
let results: [Self.Moderation]
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
init(from decoder: any Decoder) throws
let categories: Categories
Collection of per-category binary usage policies violation flags. For each category, the value is true if the model flags the corresponding category as violated, false otherwise.
let categoryScores: CategoryScores
Collection of per-category raw scores output by the model, denoting the model’s confidence that the input violates the OpenAI’s policy for the category. The value is between 0 and 1, where higher values denote higher confidence. The scores should not be interpreted as probabilities.
let flagged: Bool
True if the model classifies the content as violating OpenAI’s usage policies, false otherwise.
struct Categories
struct CategoryScores
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.