Skip to content
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-ai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ModalityTokenCount>,
public val candidatesTokensDetails: List<ModalityTokenCount>,
public val thoughtsTokenCount: Int,
placeholder: Unit
) {

@Deprecated("Not intended for public use")
public constructor(
promptTokenCount: Int,
candidatesTokenCount: Int?,
totalTokenCount: Int,
promptTokensDetails: List<ModalityTokenCount>,
candidatesTokensDetails: List<ModalityTokenCount>,
thoughtsTokenCount: Int
) : this(
promptTokenCount,
candidatesTokenCount,
totalTokenCount,
promptTokensDetails,
candidatesTokensDetails,
thoughtsTokenCount,
Unit
)

@Serializable
internal data class Internal(
val promptTokenCount: Int? = null,
Expand Down