-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change enum to a value class with companion object values
- Loading branch information
Showing
2 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 30 additions & 33 deletions
63
...core/src/commonMain/kotlin/com.aallam.openai.azure.api/filtering/ContentFilterSeverity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,41 @@ | ||
package com.aallam.openai.azure.api.filtering | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Ratings for the intensity and risk level of harmful content. | ||
*/ | ||
@Serializable | ||
public enum class ContentFilterSeverity(@Serializable public val value: String) { | ||
@JvmInline | ||
public value class ContentFilterSeverity(public val value: String) { | ||
public companion object { | ||
/** | ||
* Content may be related to violence, self-harm, sexual, or hate categories but the terms | ||
* are used in general, journalistic, scientific, medical, and similar professional contexts, | ||
* which are appropriate for most audiences. | ||
*/ | ||
public val SAFE: ContentFilterSeverity = ContentFilterSeverity("safe") | ||
|
||
/** | ||
* Content may be related to violence, self-harm, sexual, or hate categories but the terms | ||
* are used in general, journalistic, scientific, medical, and similar professional contexts, | ||
* which are appropriate for most audiences. | ||
*/ | ||
@SerialName("safe") | ||
SAFE("safe"), | ||
/** | ||
* Content that expresses prejudiced, judgmental, or opinionated views, includes offensive | ||
* use of language, stereotyping, use cases exploring a fictional world (for example, gaming, | ||
* literature) and depictions at low intensity. | ||
*/ | ||
public val LOW: ContentFilterSeverity = ContentFilterSeverity("low") | ||
|
||
/** | ||
* Content that expresses prejudiced, judgmental, or opinionated views, includes offensive | ||
* use of language, stereotyping, use cases exploring a fictional world (for example, gaming, | ||
* literature) and depictions at low intensity. | ||
*/ | ||
@SerialName("low") | ||
LOW("low"), | ||
/** | ||
* Content that uses offensive, insulting, mocking, intimidating, or demeaning language | ||
* towards specific identity groups, includes depictions of seeking and executing harmful | ||
* instructions, fantasies, glorification, promotion of harm at medium intensity. | ||
*/ | ||
public val MEDIUM: ContentFilterSeverity = ContentFilterSeverity("medium") | ||
|
||
/** | ||
* Content that uses offensive, insulting, mocking, intimidating, or demeaning language | ||
* towards specific identity groups, includes depictions of seeking and executing harmful | ||
* instructions, fantasies, glorification, promotion of harm at medium intensity. | ||
*/ | ||
@SerialName("medium") | ||
MEDIUM("medium"), | ||
|
||
/** | ||
* Content that displays explicit and severe harmful instructions, actions, | ||
* damage, or abuse; includes endorsement, glorification, or promotion of severe | ||
* harmful acts, extreme or illegal forms of harm, radicalization, or non-consensual | ||
* power exchange or abuse. | ||
*/ | ||
@SerialName("high") | ||
HIGH("high") | ||
} | ||
/** | ||
* Content that displays explicit and severe harmful instructions, actions, | ||
* damage, or abuse; includes endorsement, glorification, or promotion of severe | ||
* harmful acts, extreme or illegal forms of harm, radicalization, or non-consensual | ||
* power exchange or abuse. | ||
*/ | ||
public val HIGH: ContentFilterSeverity = ContentFilterSeverity("high") | ||
} | ||
} |