Class CheckGroundingResponse.Claim

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim
All Implemented Interfaces:
CheckGroundingResponse.ClaimOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
Enclosing class:
CheckGroundingResponse

public static final class CheckGroundingResponse.Claim extends com.google.protobuf.GeneratedMessage implements CheckGroundingResponse.ClaimOrBuilder
 Text and citation info for a claim in the answer candidate.
 
Protobuf type google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim
See Also:
  • Field Details

    • START_POS_FIELD_NUMBER

      public static final int START_POS_FIELD_NUMBER
      See Also:
    • END_POS_FIELD_NUMBER

      public static final int END_POS_FIELD_NUMBER
      See Also:
    • CLAIM_TEXT_FIELD_NUMBER

      public static final int CLAIM_TEXT_FIELD_NUMBER
      See Also:
    • CITATION_INDICES_FIELD_NUMBER

      public static final int CITATION_INDICES_FIELD_NUMBER
      See Also:
    • GROUNDING_CHECK_REQUIRED_FIELD_NUMBER

      public static final int GROUNDING_CHECK_REQUIRED_FIELD_NUMBER
      See Also:
    • SCORE_FIELD_NUMBER

      public static final int SCORE_FIELD_NUMBER
      See Also:
  • 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
    • hasStartPos

      public boolean hasStartPos()
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Specified by:
      hasStartPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the startPos field is set.
    • getStartPos

      public int getStartPos()
       Position indicating the start of the claim in the answer candidate,
       measured in bytes. Note that this is not measured in characters and,
       therefore, must be rendered in the user interface keeping in mind that
       some characters may take more than one byte. For example,
       if the claim text contains non-ASCII characters, the start and end
       positions vary when measured in characters
       (programming-language-dependent) and when measured in bytes
       (programming-language-independent).
       
      optional int32 start_pos = 1;
      Specified by:
      getStartPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The startPos.
    • hasEndPos

      public boolean hasEndPos()
       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Specified by:
      hasEndPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the endPos field is set.
    • getEndPos

      public int getEndPos()
       Position indicating the end of the claim in the answer candidate,
       exclusive, in bytes. Note that this is not measured in characters and,
       therefore, must be rendered as such. For example, if the claim text
       contains non-ASCII characters, the start and end positions vary when
       measured in characters (programming-language-dependent) and when measured
       in bytes (programming-language-independent).
       
      optional int32 end_pos = 2;
      Specified by:
      getEndPos in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The endPos.
    • getClaimText

      public String getClaimText()
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Specified by:
      getClaimText in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The claimText.
    • getClaimTextBytes

      public com.google.protobuf.ByteString getClaimTextBytes()
       Text for the claim in the answer candidate. Always provided regardless of
       whether citations or anti-citations are found.
       
      string claim_text = 3;
      Specified by:
      getClaimTextBytes in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The bytes for claimText.
    • getCitationIndicesList

      public List<Integer> getCitationIndicesList()
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndicesList in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      A list containing the citationIndices.
    • getCitationIndicesCount

      public int getCitationIndicesCount()
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndicesCount in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The count of citationIndices.
    • getCitationIndices

      public int getCitationIndices(int index)
       A list of indices (into 'cited_chunks') specifying the citations
       associated with the claim. For instance [1,3,4] means that
       cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited
       supporting for the claim. A citation to a fact indicates that the claim
       is supported by the fact.
       
      repeated int32 citation_indices = 4;
      Specified by:
      getCitationIndices in interface CheckGroundingResponse.ClaimOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The citationIndices at the given index.
    • hasGroundingCheckRequired

      public boolean hasGroundingCheckRequired()
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Specified by:
      hasGroundingCheckRequired in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the groundingCheckRequired field is set.
    • getGroundingCheckRequired

      public boolean getGroundingCheckRequired()
       Indicates that this claim required grounding check. When the system
       decided this claim doesn't require attribution/grounding check, this
       field will be set to false. In that case, no grounding check was done for
       the claim and therefore
       [citation_indices][google.cloud.discoveryengine.v1.CheckGroundingResponse.Claim.citation_indices]
       should not be returned.
       
      optional bool grounding_check_required = 6;
      Specified by:
      getGroundingCheckRequired in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The groundingCheckRequired.
    • hasScore

      public boolean hasScore()
       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Specified by:
      hasScore in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      Whether the score field is set.
    • getScore

      public double getScore()
       Confidence score for the claim in the answer candidate, in the range of
       [0, 1]. This is set only when
       `CheckGroundingRequest.grounding_spec.enable_claim_level_score` is true.
       
      optional double score = 7;
      Specified by:
      getScore in interface CheckGroundingResponse.ClaimOrBuilder
      Returns:
      The score.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CheckGroundingResponse.Claim parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static CheckGroundingResponse.Claim parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static CheckGroundingResponse.Claim parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public CheckGroundingResponse.Claim.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static CheckGroundingResponse.Claim.Builder newBuilder()
    • newBuilder

    • toBuilder

      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected CheckGroundingResponse.Claim.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static CheckGroundingResponse.Claim getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<CheckGroundingResponse.Claim> parser()
    • getParserForType

      public com.google.protobuf.Parser<CheckGroundingResponse.Claim> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public CheckGroundingResponse.Claim getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder