Skip to content

Commit

Permalink
make SafetySettings#method nullable (#6379)
Browse files Browse the repository at this point in the history
Co-authored-by: David Motsonashvili <[email protected]>
Co-authored-by: Rodrigo Lazo <[email protected]>
  • Loading branch information
3 people authored and daymxn committed Oct 17, 2024
1 parent a80c351 commit 9871277
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions firebase-vertexai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* [changed] **Breaking Change**: Replaced sealed classes with abstract classes for `StringFormat`. (#6334)
* [changed] **Breaking Change**: Refactored enum classes to be normal classes. (#6340)
* [changed] **Breaking Change**: Marked `GenerativeModel` properties as private. (#6309)
* [changed] **Breaking Change**: Changed `method` parameter type to be nullable in `SafetySettings`. (#6379)


# 16.0.0-beta05
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal fun SafetySetting.toInternal() =
com.google.firebase.vertexai.common.shared.SafetySetting(
harmCategory.toInternal(),
threshold.toInternal(),
method.toInternal()
method?.toInternal()
)

internal fun makeMissingCaseException(source: String, ordinal: Int): SerializationException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ package com.google.firebase.vertexai.type
*
* @param harmCategory The relevant [HarmCategory].
* @param threshold The threshold form harm allowable.
* @param method Specify if the threshold is used for probability or severity score.
* @param method Specify if the threshold is used for probability or severity score, if not
* specified it will default to [HarmBlockMethod.PROBABILITY].
*/
public class SafetySetting(
internal val harmCategory: HarmCategory,
internal val threshold: HarmBlockThreshold,
internal val method: HarmBlockMethod = HarmBlockMethod.PROBABILITY
internal val method: HarmBlockMethod? = null,
)

0 comments on commit 9871277

Please sign in to comment.