From b90c093228dc3699dd33d5f7e6f88ead46f47c5e Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Wed, 12 Mar 2025 17:24:17 -0400 Subject: [PATCH 1/2] Add GenerationConfig to CountTokenRequest's --- .../main/kotlin/com/google/firebase/vertexai/common/Request.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/Request.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/Request.kt index 7f84e053147..7b0bd65e0dc 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/Request.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common/Request.kt @@ -49,6 +49,7 @@ internal data class CountTokensRequest( val contents: List? = null, val tools: List? = null, @SerialName("system_instruction") val systemInstruction: Content.Internal? = null, + val generationConfig: GenerationConfig.Internal? = null ) : Request { companion object { @@ -58,6 +59,7 @@ internal data class CountTokensRequest( contents = generateContentRequest.contents, tools = generateContentRequest.tools, systemInstruction = generateContentRequest.systemInstruction, + generationConfig = generateContentRequest.generationConfig, ) } } From 0c64dbe8dfde960cebecf048cf77931475f4450c Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Wed, 12 Mar 2025 17:28:27 -0400 Subject: [PATCH 2/2] Update changelog.md --- firebase-vertexai/CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/firebase-vertexai/CHANGELOG.md b/firebase-vertexai/CHANGELOG.md index e28c285822e..863b520831f 100644 --- a/firebase-vertexai/CHANGELOG.md +++ b/firebase-vertexai/CHANGELOG.md @@ -1,5 +1,5 @@ # Unreleased - +* [feature] `CountTokenRequest` now includes `GenerationConfig` from the model. # 16.2.0 * [fixed] Added support for new values sent by the server for `FinishReason` and `BlockReason`. @@ -69,4 +69,3 @@ * [feature] Added support for `responseMimeType` in `GenerationConfig`. * [changed] Renamed `GoogleGenerativeAIException` to `FirebaseVertexAIException`. * [changed] Updated the KDocs for various classes and functions. -