Skip to content

Commit d24d196

Browse files
committed
Add support for OFF
1 parent 9a07498 commit d24d196

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) {
2525

2626
internal fun toInternal() =
2727
when (this) {
28+
OFF -> Internal.OFF
2829
NONE -> Internal.BLOCK_NONE
2930
ONLY_HIGH -> Internal.BLOCK_ONLY_HIGH
3031
MEDIUM_AND_ABOVE -> Internal.BLOCK_MEDIUM_AND_ABOVE
@@ -39,6 +40,7 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) {
3940
BLOCK_MEDIUM_AND_ABOVE,
4041
BLOCK_ONLY_HIGH,
4142
BLOCK_NONE,
43+
OFF
4244
}
4345

4446
public companion object {
@@ -53,5 +55,13 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) {
5355

5456
/** All content is allowed regardless of harm. */
5557
@JvmField public val NONE: HarmBlockThreshold = HarmBlockThreshold(3)
58+
59+
/**
60+
* All content is allowed regardless of harm.
61+
*
62+
* The same as [NONE], but metadata when the corresponding [HarmCategory] occurs will **NOT** be
63+
* present in the response.
64+
*/
65+
@JvmField public val OFF: HarmBlockThreshold = HarmBlockThreshold(4)
5666
}
5767
}

0 commit comments

Comments
 (0)