Class CountTokensResponse (3.41.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
TypeDescription
int

TOTAL_TOKENS_FIELD_NUMBER

public static final int TOTAL_TOKENS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static CountTokensResponse getDefaultInstance()
Returns
TypeDescription
CountTokensResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static CountTokensResponse.Builder newBuilder()
Returns
TypeDescription
CountTokensResponse.Builder

newBuilder(CountTokensResponse prototype)

public static CountTokensResponse.Builder newBuilder(CountTokensResponse prototype)
Parameter
NameDescription
prototypeCountTokensResponse
Returns
TypeDescription
CountTokensResponse.Builder

parseDelimitedFrom(InputStream input)

public static CountTokensResponse parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static CountTokensResponse parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CountTokensResponse parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CountTokensResponse parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static CountTokensResponse parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static CountTokensResponse parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CountTokensResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CountTokensResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<CountTokensResponse> parser()
Returns
TypeDescription
Parser<CountTokensResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public CountTokensResponse getDefaultInstanceForType()
Returns
TypeDescription
CountTokensResponse

getParserForType()

public Parser<CountTokensResponse> getParserForType()
Returns
TypeDescription
Parser<CountTokensResponse>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
int

The totalBillableCharacters.

getTotalTokens()

public int getTotalTokens()

The total number of tokens counted across all instances from the request.

int32 total_tokens = 1;

Returns
TypeDescription
int

The totalTokens.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public CountTokensResponse.Builder newBuilderForType()
Returns
TypeDescription
CountTokensResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CountTokensResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
CountTokensResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public CountTokensResponse.Builder toBuilder()
Returns
TypeDescription
CountTokensResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException