Class Candidate

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.aiplatform.v1.Candidate
All Implemented Interfaces:
CandidateOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class Candidate extends com.google.protobuf.GeneratedMessage implements CandidateOrBuilder
 A response candidate generated from the model.
 
Protobuf type google.cloud.aiplatform.v1.Candidate
See Also:
  • Field Details

    • INDEX_FIELD_NUMBER

      public static final int INDEX_FIELD_NUMBER
      See Also:
    • CONTENT_FIELD_NUMBER

      public static final int CONTENT_FIELD_NUMBER
      See Also:
    • SCORE_FIELD_NUMBER

      public static final int SCORE_FIELD_NUMBER
      See Also:
    • AVG_LOGPROBS_FIELD_NUMBER

      public static final int AVG_LOGPROBS_FIELD_NUMBER
      See Also:
    • LOGPROBS_RESULT_FIELD_NUMBER

      public static final int LOGPROBS_RESULT_FIELD_NUMBER
      See Also:
    • FINISH_REASON_FIELD_NUMBER

      public static final int FINISH_REASON_FIELD_NUMBER
      See Also:
    • SAFETY_RATINGS_FIELD_NUMBER

      public static final int SAFETY_RATINGS_FIELD_NUMBER
      See Also:
    • FINISH_MESSAGE_FIELD_NUMBER

      public static final int FINISH_MESSAGE_FIELD_NUMBER
      See Also:
    • CITATION_METADATA_FIELD_NUMBER

      public static final int CITATION_METADATA_FIELD_NUMBER
      See Also:
    • GROUNDING_METADATA_FIELD_NUMBER

      public static final int GROUNDING_METADATA_FIELD_NUMBER
      See Also:
    • URL_CONTEXT_METADATA_FIELD_NUMBER

      public static final int URL_CONTEXT_METADATA_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
    • getIndex

      public int getIndex()
       Output only. Index of the candidate.
       
      int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getIndex in interface CandidateOrBuilder
      Returns:
      The index.
    • hasContent

      public boolean hasContent()
       Output only. Content parts of the candidate.
       
      .google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasContent in interface CandidateOrBuilder
      Returns:
      Whether the content field is set.
    • getContent

      public Content getContent()
       Output only. Content parts of the candidate.
       
      .google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getContent in interface CandidateOrBuilder
      Returns:
      The content.
    • getContentOrBuilder

      public ContentOrBuilder getContentOrBuilder()
       Output only. Content parts of the candidate.
       
      .google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getContentOrBuilder in interface CandidateOrBuilder
    • getScore

      public double getScore()
       Output only. Confidence score of the candidate.
       
      double score = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getScore in interface CandidateOrBuilder
      Returns:
      The score.
    • getAvgLogprobs

      public double getAvgLogprobs()
       Output only. Average log probability score of the candidate.
       
      double avg_logprobs = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getAvgLogprobs in interface CandidateOrBuilder
      Returns:
      The avgLogprobs.
    • hasLogprobsResult

      public boolean hasLogprobsResult()
       Output only. Log-likelihood scores for the response tokens and top tokens
       
      .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasLogprobsResult in interface CandidateOrBuilder
      Returns:
      Whether the logprobsResult field is set.
    • getLogprobsResult

      public LogprobsResult getLogprobsResult()
       Output only. Log-likelihood scores for the response tokens and top tokens
       
      .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getLogprobsResult in interface CandidateOrBuilder
      Returns:
      The logprobsResult.
    • getLogprobsResultOrBuilder

      public LogprobsResultOrBuilder getLogprobsResultOrBuilder()
       Output only. Log-likelihood scores for the response tokens and top tokens
       
      .google.cloud.aiplatform.v1.LogprobsResult logprobs_result = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getLogprobsResultOrBuilder in interface CandidateOrBuilder
    • getFinishReasonValue

      public int getFinishReasonValue()
       Output only. The reason why the model stopped generating tokens.
       If empty, the model has not stopped generating the tokens.
       
      .google.cloud.aiplatform.v1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getFinishReasonValue in interface CandidateOrBuilder
      Returns:
      The enum numeric value on the wire for finishReason.
    • getFinishReason

      public Candidate.FinishReason getFinishReason()
       Output only. The reason why the model stopped generating tokens.
       If empty, the model has not stopped generating the tokens.
       
      .google.cloud.aiplatform.v1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getFinishReason in interface CandidateOrBuilder
      Returns:
      The finishReason.
    • getSafetyRatingsList

      public List<SafetyRating> getSafetyRatingsList()
       Output only. List of ratings for the safety of a response candidate.
      
       There is at most one rating per category.
       
      repeated .google.cloud.aiplatform.v1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSafetyRatingsList in interface CandidateOrBuilder
    • getSafetyRatingsOrBuilderList

      public List<? extends SafetyRatingOrBuilder> getSafetyRatingsOrBuilderList()
       Output only. List of ratings for the safety of a response candidate.
      
       There is at most one rating per category.
       
      repeated .google.cloud.aiplatform.v1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSafetyRatingsOrBuilderList in interface CandidateOrBuilder
    • getSafetyRatingsCount

      public int getSafetyRatingsCount()
       Output only. List of ratings for the safety of a response candidate.
      
       There is at most one rating per category.
       
      repeated .google.cloud.aiplatform.v1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSafetyRatingsCount in interface CandidateOrBuilder
    • getSafetyRatings

      public SafetyRating getSafetyRatings(int index)
       Output only. List of ratings for the safety of a response candidate.
      
       There is at most one rating per category.
       
      repeated .google.cloud.aiplatform.v1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSafetyRatings in interface CandidateOrBuilder
    • getSafetyRatingsOrBuilder

      public SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index)
       Output only. List of ratings for the safety of a response candidate.
      
       There is at most one rating per category.
       
      repeated .google.cloud.aiplatform.v1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getSafetyRatingsOrBuilder in interface CandidateOrBuilder
    • hasFinishMessage

      public boolean hasFinishMessage()
       Output only. Describes the reason the mode stopped generating tokens in
       more detail. This is only filled when `finish_reason` is set.
       
      optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasFinishMessage in interface CandidateOrBuilder
      Returns:
      Whether the finishMessage field is set.
    • getFinishMessage

      public String getFinishMessage()
       Output only. Describes the reason the mode stopped generating tokens in
       more detail. This is only filled when `finish_reason` is set.
       
      optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getFinishMessage in interface CandidateOrBuilder
      Returns:
      The finishMessage.
    • getFinishMessageBytes

      public com.google.protobuf.ByteString getFinishMessageBytes()
       Output only. Describes the reason the mode stopped generating tokens in
       more detail. This is only filled when `finish_reason` is set.
       
      optional string finish_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getFinishMessageBytes in interface CandidateOrBuilder
      Returns:
      The bytes for finishMessage.
    • hasCitationMetadata

      public boolean hasCitationMetadata()
       Output only. Source attribution of the generated content.
       
      .google.cloud.aiplatform.v1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasCitationMetadata in interface CandidateOrBuilder
      Returns:
      Whether the citationMetadata field is set.
    • getCitationMetadata

      public CitationMetadata getCitationMetadata()
       Output only. Source attribution of the generated content.
       
      .google.cloud.aiplatform.v1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCitationMetadata in interface CandidateOrBuilder
      Returns:
      The citationMetadata.
    • getCitationMetadataOrBuilder

      public CitationMetadataOrBuilder getCitationMetadataOrBuilder()
       Output only. Source attribution of the generated content.
       
      .google.cloud.aiplatform.v1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCitationMetadataOrBuilder in interface CandidateOrBuilder
    • hasGroundingMetadata

      public boolean hasGroundingMetadata()
       Output only. Metadata specifies sources used to ground generated content.
       
      .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasGroundingMetadata in interface CandidateOrBuilder
      Returns:
      Whether the groundingMetadata field is set.
    • getGroundingMetadata

      public GroundingMetadata getGroundingMetadata()
       Output only. Metadata specifies sources used to ground generated content.
       
      .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getGroundingMetadata in interface CandidateOrBuilder
      Returns:
      The groundingMetadata.
    • getGroundingMetadataOrBuilder

      public GroundingMetadataOrBuilder getGroundingMetadataOrBuilder()
       Output only. Metadata specifies sources used to ground generated content.
       
      .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getGroundingMetadataOrBuilder in interface CandidateOrBuilder
    • hasUrlContextMetadata

      public boolean hasUrlContextMetadata()
       Output only. Metadata related to url context retrieval tool.
       
      .google.cloud.aiplatform.v1.UrlContextMetadata url_context_metadata = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasUrlContextMetadata in interface CandidateOrBuilder
      Returns:
      Whether the urlContextMetadata field is set.
    • getUrlContextMetadata

      public UrlContextMetadata getUrlContextMetadata()
       Output only. Metadata related to url context retrieval tool.
       
      .google.cloud.aiplatform.v1.UrlContextMetadata url_context_metadata = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUrlContextMetadata in interface CandidateOrBuilder
      Returns:
      The urlContextMetadata.
    • getUrlContextMetadataOrBuilder

      public UrlContextMetadataOrBuilder getUrlContextMetadataOrBuilder()
       Output only. Metadata related to url context retrieval tool.
       
      .google.cloud.aiplatform.v1.UrlContextMetadata url_context_metadata = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getUrlContextMetadataOrBuilder in interface CandidateOrBuilder
    • 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 Candidate parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

      public static Candidate parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

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

      public static Candidate parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

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

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

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

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

      public static Candidate.Builder newBuilder()
    • newBuilder

      public static Candidate.Builder newBuilder(Candidate prototype)
    • toBuilder

      public Candidate.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

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

      public static Candidate getDefaultInstance()
    • parser

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

      public com.google.protobuf.Parser<Candidate> 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 Candidate getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder