Package-level declarations

Types

Link copied to clipboard
@Serializable
class Categories(val hate: Boolean, val hateThreatening: Boolean, val selfHarm: Boolean, val sexual: Boolean, val sexualMinors: Boolean, val violence: Boolean, val violenceGraphic: Boolean, val harassment: Boolean, val harassmentThreatening: Boolean, val selfHarmIntent: Boolean, val selfHarmInstructions: Boolean)
Link copied to clipboard
@Serializable
class CategoryScores(val hate: Double, val hateThreatening: Double, val selfHarm: Double, val sexual: Double, val sexualMinors: Double, val violence: Double, val violenceGraphic: Double, val harassment: Double, val harassmentThreatening: Double, val selfHarmIntent: Double, val selfHarmInstructions: Double)
Link copied to clipboard
@Serializable
value class ModerationModel(val model: String)

Moderation model.

Link copied to clipboard
@Serializable
class ModerationRequest(val input: List<String>, val model: ModerationModel? = null)

Request to classify if text violates OpenAI's Content Policy.

Link copied to clipboard

Data class representing a ModerationRequest

Link copied to clipboard
@Serializable
class ModerationResult(val categories: Categories, val categoryScores: CategoryScores, val flagged: Boolean)
Link copied to clipboard
@Serializable
class TextModeration(val id: String, val model: ModerationModel, val results: List<ModerationResult>)

Moderation response.

Functions

Link copied to clipboard

Request to classify if text violates OpenAI's Content Policy.