Skip to content

Commit 4c08949

Browse files
authored
feat(moderations): add harassment and self-hard categories and scores (#230)
1 parent 65bea18 commit 4c08949

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

openai-core/src/commonMain/kotlin/com.aallam.openai.api/moderation/TextModeration.kt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ public class Categories(
8383
* Violent content that depicts death, violence, or serious physical injury in extreme graphic detail.
8484
*/
8585
@SerialName("violence/graphic") public val violenceGraphic: Boolean,
86+
87+
/**
88+
* Content that expresses, incites, or promotes harassing language towards any target.
89+
*/
90+
@SerialName("harassment") public val harassment: Boolean,
91+
92+
/**
93+
* Harassment content that also includes violence or serious harm towards any target.
94+
*/
95+
@SerialName("harassment/threatening") public val harassmentThreatening: Boolean,
96+
97+
/**
98+
* Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as
99+
* suicide, cutting, and eating disorders.
100+
*/
101+
@SerialName("self-harm/intent") public val selfHarmIntent: Boolean,
102+
103+
/**
104+
* Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that
105+
* gives instructions or advice on how to commit such acts.
106+
*/
107+
@SerialName("self-harm/instructions") public val selfHarmInstructions: Boolean,
86108
)
87109

88110
@Serializable
@@ -123,4 +145,24 @@ public class CategoryScores(
123145
* Violent content that depicts death, violence, or serious physical injury in extreme graphic detail.
124146
*/
125147
@SerialName("violence/graphic") public val violenceGraphic: Double,
148+
149+
/**
150+
* The score for the category 'harassment'.
151+
*/
152+
@SerialName("harassment") public val harassment: Double,
153+
154+
/**
155+
* The score for the category 'harassment/threatening'.
156+
*/
157+
@SerialName("harassment/threatening") public val harassmentThreatening: Double,
158+
159+
/**
160+
* The score for the category 'self-harm/intent'.
161+
*/
162+
@SerialName("self-harm/intent") public val selfHarmIntent: Double,
163+
164+
/**
165+
* The score for the category 'self-harm/instructions'.
166+
*/
167+
@SerialName("self-harm/instructions") public val selfHarmInstructions: Double,
126168
)

0 commit comments

Comments
 (0)