Skip to content

Commit 518974e

Browse files
author
David Motsonashvili
committed
make SafetySettings#method nullable
1 parent 8869a14 commit 518974e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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)