Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions firebase-vertexai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Unreleased
* [changed] Added support for Civic Integrity in Harm Category. (#6502)
* [fixed] Improved error message when using an invalid location. (#6428)
* [fixed] Fixed issue where Firebase App Check error tokens were unintentionally missing from the requests. (#6409)
* [fixed] Clarified in the documentation that `Schema.integer` and `Schema.float` only provide hints to the model. (#6420)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ internal enum class HarmCategory {
@SerialName("HARM_CATEGORY_HARASSMENT") HARASSMENT,
@SerialName("HARM_CATEGORY_HATE_SPEECH") HATE_SPEECH,
@SerialName("HARM_CATEGORY_SEXUALLY_EXPLICIT") SEXUALLY_EXPLICIT,
@SerialName("HARM_CATEGORY_DANGEROUS_CONTENT") DANGEROUS_CONTENT
@SerialName("HARM_CATEGORY_DANGEROUS_CONTENT") DANGEROUS_CONTENT,
@SerialName("HARM_CATEGORY_CIVIC_INTEGRITY") CIVIC_INTEGRITY,
}

internal typealias Base64 = String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ internal fun HarmCategory.toInternal() =
com.google.firebase.vertexai.common.shared.HarmCategory.SEXUALLY_EXPLICIT
HarmCategory.DANGEROUS_CONTENT ->
com.google.firebase.vertexai.common.shared.HarmCategory.DANGEROUS_CONTENT
HarmCategory.CIVIC_INTEGRITY ->
com.google.firebase.vertexai.common.shared.HarmCategory.CIVIC_INTEGRITY
HarmCategory.UNKNOWN -> com.google.firebase.vertexai.common.shared.HarmCategory.UNKNOWN
else -> throw makeMissingCaseException("HarmCategory", ordinal)
}
Expand Down Expand Up @@ -315,6 +317,8 @@ internal fun com.google.firebase.vertexai.common.shared.HarmCategory.toPublic()
HarmCategory.SEXUALLY_EXPLICIT
com.google.firebase.vertexai.common.shared.HarmCategory.DANGEROUS_CONTENT ->
HarmCategory.DANGEROUS_CONTENT
com.google.firebase.vertexai.common.shared.HarmCategory.CIVIC_INTEGRITY ->
HarmCategory.CIVIC_INTEGRITY
else -> HarmCategory.UNKNOWN
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ public class HarmCategory private constructor(public val ordinal: Int) {

/** Dangerous content. */
@JvmField public val DANGEROUS_CONTENT: HarmCategory = HarmCategory(4)

/** Content that may be used to harm civic integrity. */
@JvmField public val CIVIC_INTEGRITY: HarmCategory = HarmCategory(5)
}
}
Loading