Skip to content

make SafetySettings#method nullable #6379

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Oct 17, 2024
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
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,
)
Loading