Class Candidate (3.36.0)

public final class Candidate extends GeneratedMessageV3 implements CandidateOrBuilder

A response candidate generated from the model.

Protobuf type google.cloud.aiplatform.v1.Candidate

Implements

CandidateOrBuilder

Static Fields

CITATION_METADATA_FIELD_NUMBER

public static final int CITATION_METADATA_FIELD_NUMBER
Field Value
TypeDescription
int

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
TypeDescription
int

FINISH_MESSAGE_FIELD_NUMBER

public static final int FINISH_MESSAGE_FIELD_NUMBER
Field Value
TypeDescription
int

FINISH_REASON_FIELD_NUMBER

public static final int FINISH_REASON_FIELD_NUMBER
Field Value
TypeDescription
int

INDEX_FIELD_NUMBER

public static final int INDEX_FIELD_NUMBER
Field Value
TypeDescription
int

SAFETY_RATINGS_FIELD_NUMBER

public static final int SAFETY_RATINGS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Candidate getDefaultInstance()
Returns
TypeDescription
Candidate

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Candidate.Builder newBuilder()
Returns
TypeDescription
Candidate.Builder

newBuilder(Candidate prototype)

public static Candidate.Builder newBuilder(Candidate prototype)
Parameter
NameDescription
prototypeCandidate
Returns
TypeDescription
Candidate.Builder

parseDelimitedFrom(InputStream input)

public static Candidate parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Candidate parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Candidate parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Candidate parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Candidate parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Candidate parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Candidate parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Candidate parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Candidate parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Candidate parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Candidate parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Candidate parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Candidate> parser()
Returns
TypeDescription
Parser<Candidate>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

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];

Returns
TypeDescription
CitationMetadata

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];

Returns
TypeDescription
CitationMetadataOrBuilder

getContent()

public Content getContent()

Output only. Content parts of the candidate.

.google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Content

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];

Returns
TypeDescription
ContentOrBuilder

getDefaultInstanceForType()

public Candidate getDefaultInstanceForType()
Returns
TypeDescription
Candidate

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];

Returns
TypeDescription
String

The finishMessage.

getFinishMessageBytes()

public 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];

Returns
TypeDescription
ByteString

The bytes for finishMessage.

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];

Returns
TypeDescription
Candidate.FinishReason

The finishReason.

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];

Returns
TypeDescription
int

The enum numeric value on the wire for finishReason.

getIndex()

public int getIndex()

Output only. Index of the candidate.

int32 index = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The index.

getParserForType()

public Parser<Candidate> getParserForType()
Returns
TypeDescription
Parser<Candidate>
Overrides

getSafetyRatings(int index)

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];

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating

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];

Returns
TypeDescription
int

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];

Returns
TypeDescription
List<SafetyRating>

getSafetyRatingsOrBuilder(int index)

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];

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRatingOrBuilder

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];

Returns
TypeDescription
List<? extends com.google.cloud.aiplatform.v1.SafetyRatingOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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];

Returns
TypeDescription
boolean

Whether the citationMetadata field is set.

hasContent()

public boolean hasContent()

Output only. Content parts of the candidate.

.google.cloud.aiplatform.v1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the content field is set.

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];

Returns
TypeDescription
boolean

Whether the finishMessage field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Candidate.Builder newBuilderForType()
Returns
TypeDescription
Candidate.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Candidate.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Candidate.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Candidate.Builder toBuilder()
Returns
TypeDescription
Candidate.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException