diff --git a/firebase-ai/CHANGELOG.md b/firebase-ai/CHANGELOG.md index a38389fca7c..d694b73cce8 100644 --- a/firebase-ai/CHANGELOG.md +++ b/firebase-ai/CHANGELOG.md @@ -3,6 +3,7 @@ - [changed] **Breaking Change**: Removed the `candidateCount` option from `LiveGenerationConfig` (#7382) - [changed] Added better error messages to `ServiceConnectionHandshakeFailedException` (#7412) +- [changed] Marked the public constructor for `UsageMetadata` as deprecated (#7420) # 17.3.0 diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/UsageMetadata.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/UsageMetadata.kt index 1c7d39103fb..e733445e916 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/UsageMetadata.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/type/UsageMetadata.kt @@ -30,15 +30,35 @@ import kotlinx.serialization.Serializable * candidates. * @param thoughtsTokenCount The number of tokens used by the model's internal "thinking" process. */ -public class UsageMetadata( +public class UsageMetadata +internal constructor( public val promptTokenCount: Int, public val candidatesTokenCount: Int?, public val totalTokenCount: Int, public val promptTokensDetails: List, public val candidatesTokensDetails: List, public val thoughtsTokenCount: Int, + placeholder: Unit ) { + @Deprecated("Not intended for public use") + public constructor( + promptTokenCount: Int, + candidatesTokenCount: Int?, + totalTokenCount: Int, + promptTokensDetails: List, + candidatesTokensDetails: List, + thoughtsTokenCount: Int + ) : this( + promptTokenCount, + candidatesTokenCount, + totalTokenCount, + promptTokensDetails, + candidatesTokensDetails, + thoughtsTokenCount, + Unit + ) + @Serializable internal data class Internal( val promptTokenCount: Int? = null,