public final class TokenUsage extends GeneratedMessage implements TokenUsageOrBuilderOverall token usage tracking for the response.
Protobuf type google.cloud.geminidataanalytics.v1beta.TokenUsage
Inheritance
Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessage > TokenUsageImplements
TokenUsageOrBuilderStatic Fields
INPUT_TOKEN_COUNT_FIELD_NUMBER
public static final int INPUT_TOKEN_COUNT_FIELD_NUMBER| Field Value | |
|---|---|
| Type | Description |
int |
|
OUTPUT_TOKEN_COUNT_FIELD_NUMBER
public static final int OUTPUT_TOKEN_COUNT_FIELD_NUMBER| Field Value | |
|---|---|
| Type | Description |
int |
|
Static Methods
getDefaultInstance()
public static TokenUsage getDefaultInstance()| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()| Returns | |
|---|---|
| Type | Description |
Descriptor |
|
newBuilder()
public static TokenUsage.Builder newBuilder()| Returns | |
|---|---|
| Type | Description |
TokenUsage.Builder |
|
newBuilder(TokenUsage prototype)
public static TokenUsage.Builder newBuilder(TokenUsage prototype)| Parameter | |
|---|---|
| Name | Description |
prototype |
TokenUsage |
| Returns | |
|---|---|
| Type | Description |
TokenUsage.Builder |
|
parseDelimitedFrom(InputStream input)
public static TokenUsage parseDelimitedFrom(InputStream input)| Parameter | |
|---|---|
| Name | Description |
input |
InputStream |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
InputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseFrom(byte[] data)
public static TokenUsage parseFrom(byte[] data)| Parameter | |
|---|---|
| Name | Description |
data |
byte[] |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
data |
byte[] |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parseFrom(ByteString data)
public static TokenUsage parseFrom(ByteString data)| Parameter | |
|---|---|
| Name | Description |
data |
ByteString |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
data |
ByteString |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parseFrom(CodedInputStream input)
public static TokenUsage parseFrom(CodedInputStream input)| Parameter | |
|---|---|
| Name | Description |
input |
CodedInputStream |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseFrom(InputStream input)
public static TokenUsage parseFrom(InputStream input)| Parameter | |
|---|---|
| Name | Description |
input |
InputStream |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
input |
InputStream |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
parseFrom(ByteBuffer data)
public static TokenUsage parseFrom(ByteBuffer data)| Parameter | |
|---|---|
| Name | Description |
data |
ByteBuffer |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static TokenUsage parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)| Parameters | |
|---|---|
| Name | Description |
data |
ByteBuffer |
extensionRegistry |
ExtensionRegistryLite |
| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
| Exceptions | |
|---|---|
| Type | Description |
InvalidProtocolBufferException |
|
parser()
public static Parser<TokenUsage> parser()| Returns | |
|---|---|
| Type | Description |
Parser<TokenUsage> |
|
Methods
equals(Object obj)
public boolean equals(Object obj)| Parameter | |
|---|---|
| Name | Description |
obj |
Object |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
getDefaultInstanceForType()
public TokenUsage getDefaultInstanceForType()| Returns | |
|---|---|
| Type | Description |
TokenUsage |
|
getInputTokenCount()
public int getInputTokenCount()The total number of input tokens used in this request.
int32 input_token_count = 1;
| Returns | |
|---|---|
| Type | Description |
int |
The inputTokenCount. |
getOutputTokenCount()
public int getOutputTokenCount()The total number of output tokens used in this request.
int32 output_token_count = 2;
| Returns | |
|---|---|
| Type | Description |
int |
The outputTokenCount. |
getParserForType()
public Parser<TokenUsage> getParserForType()| Returns | |
|---|---|
| Type | Description |
Parser<TokenUsage> |
|
getSerializedSize()
public int getSerializedSize()| Returns | |
|---|---|
| Type | Description |
int |
|
hashCode()
public int hashCode()| Returns | |
|---|---|
| Type | Description |
int |
|
internalGetFieldAccessorTable()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()| Returns | |
|---|---|
| Type | Description |
FieldAccessorTable |
|
isInitialized()
public final boolean isInitialized()| Returns | |
|---|---|
| Type | Description |
boolean |
|
newBuilderForType()
public TokenUsage.Builder newBuilderForType()| Returns | |
|---|---|
| Type | Description |
TokenUsage.Builder |
|
newBuilderForType(AbstractMessage.BuilderParent parent)
protected TokenUsage.Builder newBuilderForType(AbstractMessage.BuilderParent parent)| Parameter | |
|---|---|
| Name | Description |
parent |
BuilderParent |
| Returns | |
|---|---|
| Type | Description |
TokenUsage.Builder |
|
toBuilder()
public TokenUsage.Builder toBuilder()| Returns | |
|---|---|
| Type | Description |
TokenUsage.Builder |
|
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)| Parameter | |
|---|---|
| Name | Description |
output |
CodedOutputStream |
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|