Skip to content

Commit 468b487

Browse files
committed
internal constructor; update CHANGELOG
1 parent 346908c commit 468b487

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

firebase-ai/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Unreleased
2-
* [feat] Added support for setting thinking budget for the Gemini models that support it. (#6990)
2+
* [feature] Added support for configuring the "thinking" budget when using Gemini
3+
2.5 series models. (#6990)
34

45
# 16.2.0
56
* [changed] Deprecate the `totalBillableCharacters` field (only usable with pre-2.0 models). (#7042)

firebase-ai/api.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -936,15 +936,12 @@ package com.google.firebase.ai.type {
936936
}
937937

938938
public final class ThinkingConfig {
939-
ctor public ThinkingConfig(Integer? thinkingBudget);
940-
method public Integer? getThinkingBudget();
941-
property public final Integer? thinkingBudget;
942939
}
943940

944941
public static final class ThinkingConfig.Builder {
945942
ctor public ThinkingConfig.Builder();
946943
method public com.google.firebase.ai.type.ThinkingConfig build();
947-
method public com.google.firebase.ai.type.ThinkingConfig.Builder setThinkingBudget(Integer? thinkingBudget);
944+
method public com.google.firebase.ai.type.ThinkingConfig.Builder setThinkingBudget(int thinkingBudget);
948945
field public Integer? thinkingBudget;
949946
}
950947

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/ThinkingConfig.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ import kotlinx.serialization.SerialName
2020
import kotlinx.serialization.Serializable
2121

2222
/** Configuration parameters for thinking features. */
23-
public class ThinkingConfig(public val thinkingBudget: Int?) {
23+
public class ThinkingConfig
24+
private constructor(
25+
internal val thinkingBudget: Int? = null,
26+
) {
2427

2528
public class Builder() {
26-
@JvmField public var thinkingBudget: Int? = null
29+
@JvmField
30+
@set:JvmSynthetic // hide void setter from Java
31+
public var thinkingBudget: Int? = null
2732

28-
/** The number of thoughts tokens that the model should generate. */
29-
public fun setThinkingBudget(thinkingBudget: Int?): Builder = apply {
33+
/**
34+
* Indicates the thinking budget in tokens. 0 is DISABLED. -1 is AUTOMATIC. The default values
35+
* and allowed ranges are model dependent.
36+
*/
37+
public fun setThinkingBudget(thinkingBudget: Int): Builder = apply {
3038
this.thinkingBudget = thinkingBudget
3139
}
3240

0 commit comments

Comments
 (0)