From 9281adad9c79a505f83cd04d5875abec11c0da50 Mon Sep 17 00:00:00 2001 From: David Motsonashvili Date: Tue, 2 Apr 2024 16:52:24 -0700 Subject: [PATCH] Make candidateTokenCount optional for cases with no candidate --- .../kotlin/com/google/ai/client/generativeai/common/Response.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/com/google/ai/client/generativeai/common/Response.kt b/common/src/main/kotlin/com/google/ai/client/generativeai/common/Response.kt index 6f0016ad..009f4743 100644 --- a/common/src/main/kotlin/com/google/ai/client/generativeai/common/Response.kt +++ b/common/src/main/kotlin/com/google/ai/client/generativeai/common/Response.kt @@ -37,6 +37,6 @@ data class GenerateContentResponse( @Serializable data class UsageMetadata( val promptTokenCount: Int, - val candidatesTokenCount: Int, + val candidatesTokenCount: Int?, val totalTokenCount: Int )