Class CountTokensResponse (3.49.0)

public final class CountTokensResponse extends GeneratedMessageV3 implements CountTokensResponseOrBuilder

Response message for [PredictionService.CountTokens][].

Protobuf type google.cloud.aiplatform.v1.CountTokensResponse

Static Fields

TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER

public static final int TOTAL_BILLABLE_CHARACTERS_FIELD_NUMBER
Field Value
Type Description
int

TOTAL_TOKENS_FIELD_NUMBER

public static final int TOTAL_TOKENS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CountTokensResponse getDefaultInstance()
Returns
Type Description
CountTokensResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CountTokensResponse.Builder newBuilder()
Returns
Type Description
CountTokensResponse.Builder

newBuilder(CountTokensResponse prototype)

public static CountTokensResponse.Builder newBuilder(CountTokensResponse prototype)
Parameter
Name Description
prototype CountTokensResponse
Returns
Type Description
CountTokensResponse.Builder

parseDelimitedFrom(InputStream input)

public static CountTokensResponse parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CountTokensResponse parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CountTokensResponse parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CountTokensResponse parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CountTokensResponse parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CountTokensResponse parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CountTokensResponse
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CountTokensResponse> parser()
Returns
Type Description
Parser<CountTokensResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public CountTokensResponse getDefaultInstanceForType()
Returns
Type Description
CountTokensResponse

getParserForType()

public Parser<CountTokensResponse> getParserForType()
Returns
Type Description
Parser<CountTokensResponse>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTotalBillableCharacters()

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.

getTotalTokens()

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CountTokensResponse.Builder newBuilderForType()
Returns
Type Description
CountTokensResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CountTokensResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CountTokensResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CountTokensResponse.Builder toBuilder()
Returns
Type Description
CountTokensResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException