Send feedback
Class CountTokensResponse (3.58.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latest keyboard_arrow_down
public final class CountTokensResponse extends GeneratedMessageV3 implements CountTokensResponseOrBuilder
Response message for [PredictionService.CountTokens][].
Protobuf type google.cloud.aiplatform.v1.CountTokensResponse
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
public static final int PROMPT_TOKENS_DETAILS_FIELD_NUMBER
Field Value
Type
Description
int
public static final int TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER
Field Value
Type
Description
int
public static final int TOTAL_TOKENS_FIELD_NUMBER
Field Value
Type
Description
int
Static Methods
public static CountTokensResponse getDefaultInstance ()
public static final Descriptors . Descriptor getDescriptor ()
public static CountTokensResponse . Builder newBuilder ()
public static CountTokensResponse . Builder newBuilder ( CountTokensResponse prototype )
public static CountTokensResponse parseDelimitedFrom ( InputStream input )
public static CountTokensResponse parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
public static CountTokensResponse parseFrom ( byte [] data )
Parameter
Name
Description
data
byte []
public static CountTokensResponse parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry )
public static CountTokensResponse parseFrom ( ByteString data )
public static CountTokensResponse parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry )
public static CountTokensResponse parseFrom ( CodedInputStream input )
public static CountTokensResponse parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
public static CountTokensResponse parseFrom ( InputStream input )
public static CountTokensResponse parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry )
public static CountTokensResponse parseFrom ( ByteBuffer data )
public static CountTokensResponse parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry )
public static Parser<CountTokensResponse> parser ()
Methods
public boolean equals ( Object obj )
Parameter
Name
Description
obj
Object
Overrides
public CountTokensResponse getDefaultInstanceForType ()
public Parser<CountTokensResponse> getParserForType ()
Overrides
public ModalityTokenCount getPromptTokensDetails ( int index )
Output only. List of modalities that were processed in the request input.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter
Name
Description
index
int
public int getPromptTokensDetailsCount ()
Output only. List of modalities that were processed in the request input.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type
Description
int
public List<ModalityTokenCount> getPromptTokensDetailsList ()
Output only. List of modalities that were processed in the request input.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
public ModalityTokenCountOrBuilder getPromptTokensDetailsOrBuilder ( int index )
Output only. List of modalities that were processed in the request input.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter
Name
Description
index
int
public List <? extends ModalityTokenCountOrBuilder > getPromptTokensDetailsOrBuilderList ()
Output only. List of modalities that were processed in the request input.
repeated .google.cloud.aiplatform.v1.ModalityTokenCount prompt_tokens_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type
Description
List <? extends com.google.cloud.aiplatform.v1.ModalityTokenCountOrBuilder >
public int getSerializedSize ()
Returns
Type
Description
int
Overrides
public int getTotalBillableCharacters ()
The total number of billable characters counted across all instances from
the request.
int32 total_billable_characters = 2;
Returns
Type
Description
int
The totalBillableCharacters.
public int getTotalTokens ()
The total number of tokens counted across all instances from the request.
int32 total_tokens = 1;
Returns
Type
Description
int
The totalTokens.
Returns
Type
Description
int
Overrides
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
public final boolean isInitialized ()
Overrides
public CountTokensResponse . Builder newBuilderForType ()
protected CountTokensResponse . Builder newBuilderForType ( GeneratedMessageV3 . BuilderParent parent )
Overrides
protected Object newInstance ( GeneratedMessageV3 . UnusedPrivateParameter unused )
Returns
Type
Description
Object
Overrides
public CountTokensResponse . Builder toBuilder ()
public void writeTo ( CodedOutputStream output )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-05 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-05 UTC."],[],[]]