Class Answer.GroundingSupport.Builder

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

public static final class Answer.GroundingSupport.Builder extends com.google.protobuf.GeneratedMessage.Builder<Answer.GroundingSupport.Builder> implements Answer.GroundingSupportOrBuilder
 Grounding support for a claim in `answer_text`.
 
Protobuf type google.cloud.discoveryengine.v1.Answer.GroundingSupport
  • 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<Answer.GroundingSupport.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<Answer.GroundingSupport.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<Answer.GroundingSupport.Builder>
    • getDefaultInstanceForType

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

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

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

      public Answer.GroundingSupport.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<Answer.GroundingSupport.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<Answer.GroundingSupport.Builder>
    • mergeFrom

      public Answer.GroundingSupport.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<Answer.GroundingSupport.Builder>
      Throws:
      IOException
    • getStartIndex

      public long getStartIndex()
       Required. Index indicates the start of the claim, measured in bytes
       (UTF-8 unicode).
       
      int64 start_index = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getStartIndex in interface Answer.GroundingSupportOrBuilder
      Returns:
      The startIndex.
    • setStartIndex

      public Answer.GroundingSupport.Builder setStartIndex(long value)
       Required. Index indicates the start of the claim, measured in bytes
       (UTF-8 unicode).
       
      int64 start_index = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The startIndex to set.
      Returns:
      This builder for chaining.
    • clearStartIndex

      public Answer.GroundingSupport.Builder clearStartIndex()
       Required. Index indicates the start of the claim, measured in bytes
       (UTF-8 unicode).
       
      int64 start_index = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getEndIndex

      public long getEndIndex()
       Required. End of the claim, exclusive.
       
      int64 end_index = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getEndIndex in interface Answer.GroundingSupportOrBuilder
      Returns:
      The endIndex.
    • setEndIndex

      public Answer.GroundingSupport.Builder setEndIndex(long value)
       Required. End of the claim, exclusive.
       
      int64 end_index = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The endIndex to set.
      Returns:
      This builder for chaining.
    • clearEndIndex

      public Answer.GroundingSupport.Builder clearEndIndex()
       Required. End of the claim, exclusive.
       
      int64 end_index = 2 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • hasGroundingScore

      public boolean hasGroundingScore()
       A score in the range of [0, 1] describing how grounded is a specific
       claim by the references.
       Higher value means that the claim is better supported by the reference
       chunks.
       
      optional double grounding_score = 3;
      Specified by:
      hasGroundingScore in interface Answer.GroundingSupportOrBuilder
      Returns:
      Whether the groundingScore field is set.
    • getGroundingScore

      public double getGroundingScore()
       A score in the range of [0, 1] describing how grounded is a specific
       claim by the references.
       Higher value means that the claim is better supported by the reference
       chunks.
       
      optional double grounding_score = 3;
      Specified by:
      getGroundingScore in interface Answer.GroundingSupportOrBuilder
      Returns:
      The groundingScore.
    • setGroundingScore

      public Answer.GroundingSupport.Builder setGroundingScore(double value)
       A score in the range of [0, 1] describing how grounded is a specific
       claim by the references.
       Higher value means that the claim is better supported by the reference
       chunks.
       
      optional double grounding_score = 3;
      Parameters:
      value - The groundingScore to set.
      Returns:
      This builder for chaining.
    • clearGroundingScore

      public Answer.GroundingSupport.Builder clearGroundingScore()
       A score in the range of [0, 1] describing how grounded is a specific
       claim by the references.
       Higher value means that the claim is better supported by the reference
       chunks.
       
      optional double grounding_score = 3;
      Returns:
      This builder for chaining.
    • hasGroundingCheckRequired

      public boolean hasGroundingCheckRequired()
       Indicates that this claim required grounding check. When the
       system decided this claim didn't require attribution/grounding check,
       this field is set to false. In that case, no grounding check was
       done for the claim and therefore `grounding_score`, `sources` is not
       returned.
       
      optional bool grounding_check_required = 4;
      Specified by:
      hasGroundingCheckRequired in interface Answer.GroundingSupportOrBuilder
      Returns:
      Whether the groundingCheckRequired field is set.
    • getGroundingCheckRequired

      public boolean getGroundingCheckRequired()
       Indicates that this claim required grounding check. When the
       system decided this claim didn't require attribution/grounding check,
       this field is set to false. In that case, no grounding check was
       done for the claim and therefore `grounding_score`, `sources` is not
       returned.
       
      optional bool grounding_check_required = 4;
      Specified by:
      getGroundingCheckRequired in interface Answer.GroundingSupportOrBuilder
      Returns:
      The groundingCheckRequired.
    • setGroundingCheckRequired

      public Answer.GroundingSupport.Builder setGroundingCheckRequired(boolean value)
       Indicates that this claim required grounding check. When the
       system decided this claim didn't require attribution/grounding check,
       this field is set to false. In that case, no grounding check was
       done for the claim and therefore `grounding_score`, `sources` is not
       returned.
       
      optional bool grounding_check_required = 4;
      Parameters:
      value - The groundingCheckRequired to set.
      Returns:
      This builder for chaining.
    • clearGroundingCheckRequired

      public Answer.GroundingSupport.Builder clearGroundingCheckRequired()
       Indicates that this claim required grounding check. When the
       system decided this claim didn't require attribution/grounding check,
       this field is set to false. In that case, no grounding check was
       done for the claim and therefore `grounding_score`, `sources` is not
       returned.
       
      optional bool grounding_check_required = 4;
      Returns:
      This builder for chaining.
    • getSourcesList

      public List<Answer.CitationSource> getSourcesList()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourcesList in interface Answer.GroundingSupportOrBuilder
    • getSourcesCount

      public int getSourcesCount()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourcesCount in interface Answer.GroundingSupportOrBuilder
    • getSources

      public Answer.CitationSource getSources(int index)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSources in interface Answer.GroundingSupportOrBuilder
    • setSources

      public Answer.GroundingSupport.Builder setSources(int index, Answer.CitationSource value)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • setSources

      public Answer.GroundingSupport.Builder setSources(int index, Answer.CitationSource.Builder builderForValue)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addSources

       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addSources

      public Answer.GroundingSupport.Builder addSources(int index, Answer.CitationSource value)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addSources

       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addSources

      public Answer.GroundingSupport.Builder addSources(int index, Answer.CitationSource.Builder builderForValue)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addAllSources

      public Answer.GroundingSupport.Builder addAllSources(Iterable<? extends Answer.CitationSource> values)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • clearSources

      public Answer.GroundingSupport.Builder clearSources()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • removeSources

      public Answer.GroundingSupport.Builder removeSources(int index)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • getSourcesBuilder

      public Answer.CitationSource.Builder getSourcesBuilder(int index)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • getSourcesOrBuilder

      public Answer.CitationSourceOrBuilder getSourcesOrBuilder(int index)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourcesOrBuilder in interface Answer.GroundingSupportOrBuilder
    • getSourcesOrBuilderList

      public List<? extends Answer.CitationSourceOrBuilder> getSourcesOrBuilderList()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getSourcesOrBuilderList in interface Answer.GroundingSupportOrBuilder
    • addSourcesBuilder

      public Answer.CitationSource.Builder addSourcesBuilder()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • addSourcesBuilder

      public Answer.CitationSource.Builder addSourcesBuilder(int index)
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];
    • getSourcesBuilderList

      public List<Answer.CitationSource.Builder> getSourcesBuilderList()
       Optional. Citation sources for the claim.
       
      repeated .google.cloud.discoveryengine.v1.Answer.CitationSource sources = 5 [(.google.api.field_behavior) = OPTIONAL];