Class Candidate.Builder (3.35.0)

public static final class Candidate.Builder extends GeneratedMessageV3.Builder<Candidate.Builder> implements CandidateOrBuilder

A response candidate generated from the model.

Protobuf type google.cloud.aiplatform.v1beta1.Candidate

Implements

CandidateOrBuilder

Static Methods

getDescriptor()

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

Methods

addAllSafetyRatings(Iterable<? extends SafetyRating> values)

public Candidate.Builder addAllSafetyRatings(Iterable<? extends SafetyRating> values)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.aiplatform.v1beta1.SafetyRating>
Returns
TypeDescription
Candidate.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Candidate.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Candidate.Builder
Overrides

addSafetyRatings(SafetyRating value)

public Candidate.Builder addSafetyRatings(SafetyRating value)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueSafetyRating
Returns
TypeDescription
Candidate.Builder

addSafetyRatings(SafetyRating.Builder builderForValue)

public Candidate.Builder addSafetyRatings(SafetyRating.Builder builderForValue)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueSafetyRating.Builder
Returns
TypeDescription
Candidate.Builder

addSafetyRatings(int index, SafetyRating value)

public Candidate.Builder addSafetyRatings(int index, SafetyRating value)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
valueSafetyRating
Returns
TypeDescription
Candidate.Builder

addSafetyRatings(int index, SafetyRating.Builder builderForValue)

public Candidate.Builder addSafetyRatings(int index, SafetyRating.Builder builderForValue)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
builderForValueSafetyRating.Builder
Returns
TypeDescription
Candidate.Builder

addSafetyRatingsBuilder()

public SafetyRating.Builder addSafetyRatingsBuilder()

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
SafetyRating.Builder

addSafetyRatingsBuilder(int index)

public SafetyRating.Builder addSafetyRatingsBuilder(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.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating.Builder

build()

public Candidate build()
Returns
TypeDescription
Candidate

buildPartial()

public Candidate buildPartial()
Returns
TypeDescription
Candidate

clear()

public Candidate.Builder clear()
Returns
TypeDescription
Candidate.Builder
Overrides

clearCitationMetadata()

public Candidate.Builder clearCitationMetadata()

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Candidate.Builder

clearContent()

public Candidate.Builder clearContent()

Output only. Content parts of the candidate.

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

Returns
TypeDescription
Candidate.Builder

clearField(Descriptors.FieldDescriptor field)

public Candidate.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Candidate.Builder
Overrides

clearFinishMessage()

public Candidate.Builder clearFinishMessage()

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
Candidate.Builder

This builder for chaining.

clearFinishReason()

public Candidate.Builder clearFinishReason()

Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

.google.cloud.aiplatform.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

clearIndex()

public Candidate.Builder clearIndex()

Output only. Index of the candidate.

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

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Candidate.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Candidate.Builder
Overrides

clearSafetyRatings()

public Candidate.Builder clearSafetyRatings()

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Candidate.Builder

clone()

public Candidate.Builder clone()
Returns
TypeDescription
Candidate.Builder
Overrides

getCitationMetadata()

public CitationMetadata getCitationMetadata()

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
CitationMetadata

The citationMetadata.

getCitationMetadataBuilder()

public CitationMetadata.Builder getCitationMetadataBuilder()

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
CitationMetadata.Builder

getCitationMetadataOrBuilder()

public CitationMetadataOrBuilder getCitationMetadataOrBuilder()

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.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.v1beta1.Content content = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Content

The content.

getContentBuilder()

public Content.Builder getContentBuilder()

Output only. Content parts of the candidate.

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

Returns
TypeDescription
Content.Builder

getContentOrBuilder()

public ContentOrBuilder getContentOrBuilder()

Output only. Content parts of the candidate.

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

Returns
TypeDescription
ContentOrBuilder

getDefaultInstanceForType()

public Candidate getDefaultInstanceForType()
Returns
TypeDescription
Candidate

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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.v1beta1.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.v1beta1.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.

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.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating

getSafetyRatingsBuilder(int index)

public SafetyRating.Builder getSafetyRatingsBuilder(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.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating.Builder

getSafetyRatingsBuilderList()

public List<SafetyRating.Builder> getSafetyRatingsBuilderList()

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
List<Builder>

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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

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

hasCitationMetadata()

public boolean hasCitationMetadata()

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.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.v1beta1.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.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeCitationMetadata(CitationMetadata value)

public Candidate.Builder mergeCitationMetadata(CitationMetadata value)

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueCitationMetadata
Returns
TypeDescription
Candidate.Builder

mergeContent(Content value)

public Candidate.Builder mergeContent(Content value)

Output only. Content parts of the candidate.

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

Parameter
NameDescription
valueContent
Returns
TypeDescription
Candidate.Builder

mergeFrom(Candidate other)

public Candidate.Builder mergeFrom(Candidate other)
Parameter
NameDescription
otherCandidate
Returns
TypeDescription
Candidate.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Candidate.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Candidate.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Candidate.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Candidate.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Candidate.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Candidate.Builder
Overrides

removeSafetyRatings(int index)

public Candidate.Builder removeSafetyRatings(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.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
indexint
Returns
TypeDescription
Candidate.Builder

setCitationMetadata(CitationMetadata value)

public Candidate.Builder setCitationMetadata(CitationMetadata value)

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueCitationMetadata
Returns
TypeDescription
Candidate.Builder

setCitationMetadata(CitationMetadata.Builder builderForValue)

public Candidate.Builder setCitationMetadata(CitationMetadata.Builder builderForValue)

Output only. Source attribution of the generated content.

.google.cloud.aiplatform.v1beta1.CitationMetadata citation_metadata = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueCitationMetadata.Builder
Returns
TypeDescription
Candidate.Builder

setContent(Content value)

public Candidate.Builder setContent(Content value)

Output only. Content parts of the candidate.

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

Parameter
NameDescription
valueContent
Returns
TypeDescription
Candidate.Builder

setContent(Content.Builder builderForValue)

public Candidate.Builder setContent(Content.Builder builderForValue)

Output only. Content parts of the candidate.

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

Parameter
NameDescription
builderForValueContent.Builder
Returns
TypeDescription
Candidate.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Candidate.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Candidate.Builder
Overrides

setFinishMessage(String value)

public Candidate.Builder setFinishMessage(String value)

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

Parameter
NameDescription
valueString

The finishMessage to set.

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

setFinishMessageBytes(ByteString value)

public Candidate.Builder setFinishMessageBytes(ByteString value)

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

Parameter
NameDescription
valueByteString

The bytes for finishMessage to set.

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

setFinishReason(Candidate.FinishReason value)

public Candidate.Builder setFinishReason(Candidate.FinishReason value)

Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

.google.cloud.aiplatform.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueCandidate.FinishReason

The finishReason to set.

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

setFinishReasonValue(int value)

public Candidate.Builder setFinishReasonValue(int value)

Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating the tokens.

.google.cloud.aiplatform.v1beta1.Candidate.FinishReason finish_reason = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The enum numeric value on the wire for finishReason to set.

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

setIndex(int value)

public Candidate.Builder setIndex(int value)

Output only. Index of the candidate.

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

Parameter
NameDescription
valueint

The index to set.

Returns
TypeDescription
Candidate.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Candidate.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Candidate.Builder
Overrides

setSafetyRatings(int index, SafetyRating value)

public Candidate.Builder setSafetyRatings(int index, SafetyRating value)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
valueSafetyRating
Returns
TypeDescription
Candidate.Builder

setSafetyRatings(int index, SafetyRating.Builder builderForValue)

public Candidate.Builder setSafetyRatings(int index, SafetyRating.Builder builderForValue)

Output only. List of ratings for the safety of a response candidate.

There is at most one rating per category.

repeated .google.cloud.aiplatform.v1beta1.SafetyRating safety_ratings = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
builderForValueSafetyRating.Builder
Returns
TypeDescription
Candidate.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Candidate.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Candidate.Builder
Overrides