diff --git a/firebase-vertexai/CHANGELOG.md b/firebase-vertexai/CHANGELOG.md index f43495222bc..0974c8a76e2 100644 --- a/firebase-vertexai/CHANGELOG.md +++ b/firebase-vertexai/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased - +* [feature] Added support for `HarmBlockThreshold.OFF`. See the + [model documentation](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/configure-safety-filters#how_to_configure_content_filters){: .external} + for more information. # 16.3.0 * [feature] Emits a warning when attempting to use an incompatible model with diff --git a/firebase-vertexai/api.txt b/firebase-vertexai/api.txt index eb7eabdddf2..137d49f490c 100644 --- a/firebase-vertexai/api.txt +++ b/firebase-vertexai/api.txt @@ -384,6 +384,7 @@ package com.google.firebase.vertexai.type { field public static final com.google.firebase.vertexai.type.HarmBlockThreshold LOW_AND_ABOVE; field public static final com.google.firebase.vertexai.type.HarmBlockThreshold MEDIUM_AND_ABOVE; field public static final com.google.firebase.vertexai.type.HarmBlockThreshold NONE; + field public static final com.google.firebase.vertexai.type.HarmBlockThreshold OFF; field public static final com.google.firebase.vertexai.type.HarmBlockThreshold ONLY_HIGH; } diff --git a/firebase-vertexai/gradle.properties b/firebase-vertexai/gradle.properties index fc232d40fc3..6b68ce2a134 100644 --- a/firebase-vertexai/gradle.properties +++ b/firebase-vertexai/gradle.properties @@ -12,5 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=16.3.1 +version=16.4.0 latestReleasedVersion=16.3.0 diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.kt index 1b3233bda2a..d200fef9bf3 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/HarmBlockThreshold.kt @@ -25,6 +25,7 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) { internal fun toInternal() = when (this) { + OFF -> Internal.OFF NONE -> Internal.BLOCK_NONE ONLY_HIGH -> Internal.BLOCK_ONLY_HIGH MEDIUM_AND_ABOVE -> Internal.BLOCK_MEDIUM_AND_ABOVE @@ -39,6 +40,7 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) { BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE, + OFF } public companion object { @@ -53,5 +55,13 @@ public class HarmBlockThreshold private constructor(public val ordinal: Int) { /** All content is allowed regardless of harm. */ @JvmField public val NONE: HarmBlockThreshold = HarmBlockThreshold(3) + + /** + * All content is allowed regardless of harm. + * + * The same as [NONE], but metadata when the corresponding [HarmCategory] occurs will **NOT** be + * present in the response. + */ + @JvmField public val OFF: HarmBlockThreshold = HarmBlockThreshold(4) } }