Skip to content

Commit dd23959

Browse files
davidmotsonDavid Motsonashvilirlazo
authored
make SafetySettings#method nullable (#6379)
Co-authored-by: David Motsonashvili <[email protected]> Co-authored-by: Rodrigo Lazo <[email protected]>
1 parent 2dd9beb commit dd23959

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

firebase-vertexai/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* [changed] **Breaking Change**: Replaced sealed classes with abstract classes for `StringFormat`. (#6334)
1919
* [changed] **Breaking Change**: Refactored enum classes to be normal classes. (#6340)
2020
* [changed] **Breaking Change**: Marked `GenerativeModel` properties as private. (#6309)
21+
* [changed] **Breaking Change**: Changed `method` parameter type to be nullable in `SafetySettings`. (#6379)
2122

2223

2324
# 16.0.0-beta05

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/internal/util/conversions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ internal fun SafetySetting.toInternal() =
100100
com.google.firebase.vertexai.common.shared.SafetySetting(
101101
harmCategory.toInternal(),
102102
threshold.toInternal(),
103-
method.toInternal()
103+
method?.toInternal()
104104
)
105105

106106
internal fun makeMissingCaseException(source: String, ordinal: Int): SerializationException {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ package com.google.firebase.vertexai.type
2222
*
2323
* @param harmCategory The relevant [HarmCategory].
2424
* @param threshold The threshold form harm allowable.
25-
* @param method Specify if the threshold is used for probability or severity score.
25+
* @param method Specify if the threshold is used for probability or severity score, if not
26+
* specified it will default to [HarmBlockMethod.PROBABILITY].
2627
*/
2728
public class SafetySetting(
2829
internal val harmCategory: HarmCategory,
2930
internal val threshold: HarmBlockThreshold,
30-
internal val method: HarmBlockMethod = HarmBlockMethod.PROBABILITY
31+
internal val method: HarmBlockMethod? = null,
3132
)

0 commit comments

Comments
 (0)