Class CountTokensResponse.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder>
com.google.cloud.aiplatform.v1.CountTokensResponse.Builder
All Implemented Interfaces:
CountTokensResponseOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CountTokensResponse

public static final class CountTokensResponse.Builder extends com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder> implements CountTokensResponseOrBuilder
 Response message for [PredictionService.CountTokens][].
 
Protobuf type google.cloud.aiplatform.v1.CountTokensResponse
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder>
    • getDefaultInstanceForType

      public CountTokensResponse getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public CountTokensResponse build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public CountTokensResponse buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public CountTokensResponse.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CountTokensResponse.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<CountTokensResponse.Builder>
    • mergeFrom

      public CountTokensResponse.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CountTokensResponse.Builder>
      Throws:
      IOException
    • getTotalTokens

      public int getTotalTokens()
       The total number of tokens counted across all instances from the request.
       
      int32 total_tokens = 1;
      Specified by:
      getTotalTokens in interface CountTokensResponseOrBuilder
      Returns:
      The totalTokens.
    • setTotalTokens

      public CountTokensResponse.Builder setTotalTokens(int value)
       The total number of tokens counted across all instances from the request.
       
      int32 total_tokens = 1;
      Parameters:
      value - The totalTokens to set.
      Returns:
      This builder for chaining.
    • clearTotalTokens

      public CountTokensResponse.Builder clearTotalTokens()
       The total number of tokens counted across all instances from the request.
       
      int32 total_tokens = 1;
      Returns:
      This builder for chaining.
    • getTotalBillableCharacters

      public int getTotalBillableCharacters()
       The total number of billable characters counted across all instances from
       the request.
       
      int32 total_billable_characters = 2;
      Specified by:
      getTotalBillableCharacters in interface CountTokensResponseOrBuilder
      Returns:
      The totalBillableCharacters.
    • setTotalBillableCharacters

      public CountTokensResponse.Builder setTotalBillableCharacters(int value)
       The total number of billable characters counted across all instances from
       the request.
       
      int32 total_billable_characters = 2;
      Parameters:
      value - The totalBillableCharacters to set.
      Returns:
      This builder for chaining.
    • clearTotalBillableCharacters

      public CountTokensResponse.Builder clearTotalBillableCharacters()
       The total number of billable characters counted across all instances from
       the request.
       
      int32 total_billable_characters = 2;
      Returns:
      This builder for chaining.
    • getPromptTokensDetailsList

      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];
      Specified by:
      getPromptTokensDetailsList in interface CountTokensResponseOrBuilder
    • getPromptTokensDetailsCount

      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];
      Specified by:
      getPromptTokensDetailsCount in interface CountTokensResponseOrBuilder
    • getPromptTokensDetails

      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];
      Specified by:
      getPromptTokensDetails in interface CountTokensResponseOrBuilder
    • setPromptTokensDetails

      public CountTokensResponse.Builder setPromptTokensDetails(int index, ModalityTokenCount value)
       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];
    • setPromptTokensDetails

      public CountTokensResponse.Builder setPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)
       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];
    • addPromptTokensDetails

      public CountTokensResponse.Builder addPromptTokensDetails(ModalityTokenCount value)
       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];
    • addPromptTokensDetails

      public CountTokensResponse.Builder addPromptTokensDetails(int index, ModalityTokenCount value)
       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];
    • addPromptTokensDetails

      public CountTokensResponse.Builder addPromptTokensDetails(ModalityTokenCount.Builder builderForValue)
       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];
    • addPromptTokensDetails

      public CountTokensResponse.Builder addPromptTokensDetails(int index, ModalityTokenCount.Builder builderForValue)
       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];
    • addAllPromptTokensDetails

      public CountTokensResponse.Builder addAllPromptTokensDetails(Iterable<? extends ModalityTokenCount> values)
       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];
    • clearPromptTokensDetails

      public CountTokensResponse.Builder clearPromptTokensDetails()
       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];
    • removePromptTokensDetails

      public CountTokensResponse.Builder removePromptTokensDetails(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];
    • getPromptTokensDetailsBuilder

      public ModalityTokenCount.Builder getPromptTokensDetailsBuilder(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];
    • getPromptTokensDetailsOrBuilder

      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];
      Specified by:
      getPromptTokensDetailsOrBuilder in interface CountTokensResponseOrBuilder
    • getPromptTokensDetailsOrBuilderList

      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];
      Specified by:
      getPromptTokensDetailsOrBuilderList in interface CountTokensResponseOrBuilder
    • addPromptTokensDetailsBuilder

      public ModalityTokenCount.Builder addPromptTokensDetailsBuilder()
       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];
    • addPromptTokensDetailsBuilder

      public ModalityTokenCount.Builder addPromptTokensDetailsBuilder(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];
    • getPromptTokensDetailsBuilderList

      public List<ModalityTokenCount.Builder> getPromptTokensDetailsBuilderList()
       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];