Skip to content

Commit ef05d13

Browse files
committed
Address several issues from the review
- update api.txt - bump version - Add missing kdoc A note about api.txt and version. While this change is technically removing two methods, those are constructors of classes returned by the server, which shouldn't be instantiated by clients. In an upcoming breaking release we should moved them to be hidden using the `internal` visibility.
1 parent a42f8ae commit ef05d13

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

firebase-vertexai/api.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,30 @@ package com.google.firebase.vertexai.type {
165165
method public static com.google.firebase.vertexai.type.Content content(String? role = "user", kotlin.jvm.functions.Function1<? super com.google.firebase.vertexai.type.Content.Builder,kotlin.Unit> init);
166166
}
167167

168+
public final class ContentModality {
169+
method public int getOrdinal();
170+
property public final int ordinal;
171+
field public static final com.google.firebase.vertexai.type.ContentModality AUDIO;
172+
field public static final com.google.firebase.vertexai.type.ContentModality.Companion Companion;
173+
field public static final com.google.firebase.vertexai.type.ContentModality DOCUMENT;
174+
field public static final com.google.firebase.vertexai.type.ContentModality IMAGE;
175+
field public static final com.google.firebase.vertexai.type.ContentModality TEXT;
176+
field public static final com.google.firebase.vertexai.type.ContentModality UNSPECIFIED;
177+
field public static final com.google.firebase.vertexai.type.ContentModality VIDEO;
178+
}
179+
180+
public static final class ContentModality.Companion {
181+
}
182+
168183
public final class CountTokensResponse {
169-
ctor public CountTokensResponse(int totalTokens, Integer? totalBillableCharacters = null);
184+
ctor public CountTokensResponse(int totalTokens, Integer? totalBillableCharacters = null, java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? promptTokensDetails = null);
170185
method public operator int component1();
171186
method public operator Integer? component2();
187+
method public operator java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? component3();
188+
method public java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? getPromptTokensDetails();
172189
method public Integer? getTotalBillableCharacters();
173190
method public int getTotalTokens();
191+
property public final java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? promptTokensDetails;
174192
property public final Integer? totalBillableCharacters;
175193
property public final int totalTokens;
176194
}
@@ -369,6 +387,15 @@ package com.google.firebase.vertexai.type {
369387
public final class InvalidStateException extends com.google.firebase.vertexai.type.FirebaseVertexAIException {
370388
}
371389

390+
public final class ModalityTokenCount {
391+
method public operator com.google.firebase.vertexai.type.ContentModality component1();
392+
method public operator int component2();
393+
method public com.google.firebase.vertexai.type.ContentModality getModality();
394+
method public int getTokenCount();
395+
property public final com.google.firebase.vertexai.type.ContentModality modality;
396+
property public final int tokenCount;
397+
}
398+
372399
public interface Part {
373400
}
374401

@@ -549,12 +576,16 @@ package com.google.firebase.vertexai.type {
549576
}
550577

551578
public final class UsageMetadata {
552-
ctor public UsageMetadata(int promptTokenCount, Integer? candidatesTokenCount, int totalTokenCount);
579+
ctor public UsageMetadata(int promptTokenCount, Integer? candidatesTokenCount, int totalTokenCount, java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? promptTokensDetails, java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? candidatesTokensDetails);
553580
method public Integer? getCandidatesTokenCount();
581+
method public java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? getCandidatesTokensDetails();
554582
method public int getPromptTokenCount();
583+
method public java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? getPromptTokensDetails();
555584
method public int getTotalTokenCount();
556585
property public final Integer? candidatesTokenCount;
586+
property public final java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? candidatesTokensDetails;
557587
property public final int promptTokenCount;
588+
property public final java.util.List<com.google.firebase.vertexai.type.ModalityTokenCount>? promptTokensDetails;
558589
property public final int totalTokenCount;
559590
}
560591

firebase-vertexai/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
version=16.1.1
15+
version=16.2.0
1616
latestReleasedVersion=16.1.0

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/ContentModality.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import kotlinx.serialization.KSerializer
2121
import kotlinx.serialization.SerialName
2222
import kotlinx.serialization.Serializable
2323

24+
/** Content part modality.*/
2425
public class ContentModality private constructor(public val ordinal: Int) {
2526

2627
@Serializable(Internal.Serializer::class)
@@ -46,6 +47,7 @@ public class ContentModality private constructor(public val ordinal: Int) {
4647
}
4748

4849
public companion object {
50+
/** Unspecified modality. */
4951
@JvmField public val UNSPECIFIED: ContentModality = ContentModality(0)
5052

5153
/** Plain text. */

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/CountTokensResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import kotlinx.serialization.Serializable
3030
* to the model as a prompt. **Important:** this property does not include billable image, video or
3131
* other non-text input. See
3232
* [Vertex AI pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing) for details.
33-
* @property promptTokenDetails The breakdown, by modality, of how many tokens are consumed by the
33+
* @property promptTokensDetails The breakdown, by modality, of how many tokens are consumed by the
3434
* prompt.
3535
*/
3636
public class CountTokensResponse(

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/UsageMetadata.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import kotlinx.serialization.Serializable
2626
* @param totalTokenCount Total number of tokens.
2727
* @param promptTokensDetails The breakdown, by modality, of how many tokens are consumed by the
2828
* prompt.
29-
* @param cacheTokensDetails The breakdown, by modality, of how many tokens are consumed by the
30-
* cache.
3129
* @param candidatesTokensDetails The breakdown, by modality, of how many tokens are consumed by the
3230
* candidates.
3331
*/

0 commit comments

Comments
 (0)