From 897a1a11710268ae5504eabd00d4d069ac46fa26 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Date: Thu, 4 Apr 2024 09:54:53 -0400 Subject: [PATCH] Set the right apiClient value (#5830) Additionally: - Right version for the SDK - Address https://github.com/google/generative-ai-android/pull/104 --- firebase-vertexai/gradle.properties | 2 +- .../kotlin/com/google/firebase/vertexai/GenerativeModel.kt | 7 ++++++- .../com/google/firebase/vertexai/type/UsageMetadata.kt | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/firebase-vertexai/gradle.properties b/firebase-vertexai/gradle.properties index c93a5bf2842..7c2ed94cc5c 100644 --- a/firebase-vertexai/gradle.properties +++ b/firebase-vertexai/gradle.properties @@ -12,5 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=16.0.0 +version=16.0.0-alpha01 latestReleasedVersion=0.0.0 diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/GenerativeModel.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/GenerativeModel.kt index 9826939e2db..2319d896150 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/GenerativeModel.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/GenerativeModel.kt @@ -75,7 +75,12 @@ internal constructor( safetySettings, requestOptions, tools, - APIController(apiKey, modelName, requestOptions.toInternal()) + APIController( + apiKey, + modelName, + requestOptions.toInternal(), + "gl-kotlin/ fire/${BuildConfig.VERSION_NAME}" + ) ) /** diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/UsageMetadata.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/UsageMetadata.kt index 4c9de50909e..6b403e11530 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/UsageMetadata.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/UsageMetadata.kt @@ -25,6 +25,6 @@ package com.google.firebase.vertexai.type */ class UsageMetadata( val promptTokenCount: Int, - val candidatesTokenCount: Int, + val candidatesTokenCount: Int?, val totalTokenCount: Int )