Class GenerateContentResponse.PromptFeedback.Builder (3.44.0)

public static final class GenerateContentResponse.PromptFeedback.Builder extends GeneratedMessageV3.Builder<GenerateContentResponse.PromptFeedback.Builder> implements GenerateContentResponse.PromptFeedbackOrBuilder

Content filter results for a prompt sent in the request.

Protobuf type google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllSafetyRatings(Iterable<? extends SafetyRating> values)

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

Output only. Safety ratings.

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

Parameter
Name Description
values Iterable<? extends com.google.cloud.aiplatform.v1.SafetyRating>
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.PromptFeedback.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

addSafetyRatings(SafetyRating value)

public GenerateContentResponse.PromptFeedback.Builder addSafetyRatings(SafetyRating value)

Output only. Safety ratings.

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

Parameter
Name Description
value SafetyRating
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatings(SafetyRating.Builder builderForValue)

public GenerateContentResponse.PromptFeedback.Builder addSafetyRatings(SafetyRating.Builder builderForValue)

Output only. Safety ratings.

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

Parameter
Name Description
builderForValue SafetyRating.Builder
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatings(int index, SafetyRating value)

public GenerateContentResponse.PromptFeedback.Builder addSafetyRatings(int index, SafetyRating value)

Output only. Safety ratings.

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

Parameters
Name Description
index int
value SafetyRating
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatings(int index, SafetyRating.Builder builderForValue)

public GenerateContentResponse.PromptFeedback.Builder addSafetyRatings(int index, SafetyRating.Builder builderForValue)

Output only. Safety ratings.

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

Parameters
Name Description
index int
builderForValue SafetyRating.Builder
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatingsBuilder()

public SafetyRating.Builder addSafetyRatingsBuilder()

Output only. Safety ratings.

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

Returns
Type Description
SafetyRating.Builder

addSafetyRatingsBuilder(int index)

public SafetyRating.Builder addSafetyRatingsBuilder(int index)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating.Builder

build()

public GenerateContentResponse.PromptFeedback build()
Returns
Type Description
GenerateContentResponse.PromptFeedback

buildPartial()

public GenerateContentResponse.PromptFeedback buildPartial()
Returns
Type Description
GenerateContentResponse.PromptFeedback

clear()

public GenerateContentResponse.PromptFeedback.Builder clear()
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearBlockReason()

public GenerateContentResponse.PromptFeedback.Builder clearBlockReason()

Output only. Blocked reason.

.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

clearBlockReasonMessage()

public GenerateContentResponse.PromptFeedback.Builder clearBlockReasonMessage()

Output only. A readable block reason message.

string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public GenerateContentResponse.PromptFeedback.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public GenerateContentResponse.PromptFeedback.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearSafetyRatings()

public GenerateContentResponse.PromptFeedback.Builder clearSafetyRatings()

Output only. Safety ratings.

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

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

clone()

public GenerateContentResponse.PromptFeedback.Builder clone()
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

getBlockReason()

public GenerateContentResponse.PromptFeedback.BlockedReason getBlockReason()

Output only. Blocked reason.

.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
GenerateContentResponse.PromptFeedback.BlockedReason

The blockReason.

getBlockReasonMessage()

public String getBlockReasonMessage()

Output only. A readable block reason message.

string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The blockReasonMessage.

getBlockReasonMessageBytes()

public ByteString getBlockReasonMessageBytes()

Output only. A readable block reason message.

string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for blockReasonMessage.

getBlockReasonValue()

public int getBlockReasonValue()

Output only. Blocked reason.

.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for blockReason.

getDefaultInstanceForType()

public GenerateContentResponse.PromptFeedback getDefaultInstanceForType()
Returns
Type Description
GenerateContentResponse.PromptFeedback

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getSafetyRatings(int index)

public SafetyRating getSafetyRatings(int index)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating

getSafetyRatingsBuilder(int index)

public SafetyRating.Builder getSafetyRatingsBuilder(int index)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating.Builder

getSafetyRatingsBuilderList()

public List<SafetyRating.Builder> getSafetyRatingsBuilderList()

Output only. Safety ratings.

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

Returns
Type Description
List<Builder>

getSafetyRatingsCount()

public int getSafetyRatingsCount()

Output only. Safety ratings.

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

Returns
Type Description
int

getSafetyRatingsList()

public List<SafetyRating> getSafetyRatingsList()

Output only. Safety ratings.

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

Returns
Type Description
List<SafetyRating>

getSafetyRatingsOrBuilder(int index)

public SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRatingOrBuilder

getSafetyRatingsOrBuilderList()

public List<? extends SafetyRatingOrBuilder> getSafetyRatingsOrBuilderList()

Output only. Safety ratings.

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

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

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GenerateContentResponse.PromptFeedback other)

public GenerateContentResponse.PromptFeedback.Builder mergeFrom(GenerateContentResponse.PromptFeedback other)
Parameter
Name Description
other GenerateContentResponse.PromptFeedback
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public GenerateContentResponse.PromptFeedback.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public GenerateContentResponse.PromptFeedback.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.PromptFeedback.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

removeSafetyRatings(int index)

public GenerateContentResponse.PromptFeedback.Builder removeSafetyRatings(int index)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

setBlockReason(GenerateContentResponse.PromptFeedback.BlockedReason value)

public GenerateContentResponse.PromptFeedback.Builder setBlockReason(GenerateContentResponse.PromptFeedback.BlockedReason value)

Output only. Blocked reason.

.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value GenerateContentResponse.PromptFeedback.BlockedReason

The blockReason to set.

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setBlockReasonMessage(String value)

public GenerateContentResponse.PromptFeedback.Builder setBlockReasonMessage(String value)

Output only. A readable block reason message.

string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The blockReasonMessage to set.

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setBlockReasonMessageBytes(ByteString value)

public GenerateContentResponse.PromptFeedback.Builder setBlockReasonMessageBytes(ByteString value)

Output only. A readable block reason message.

string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for blockReasonMessage to set.

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setBlockReasonValue(int value)

public GenerateContentResponse.PromptFeedback.Builder setBlockReasonValue(int value)

Output only. Blocked reason.

.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value int

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

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.PromptFeedback.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

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

public GenerateContentResponse.PromptFeedback.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

setSafetyRatings(int index, SafetyRating value)

public GenerateContentResponse.PromptFeedback.Builder setSafetyRatings(int index, SafetyRating value)

Output only. Safety ratings.

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

Parameters
Name Description
index int
value SafetyRating
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

setSafetyRatings(int index, SafetyRating.Builder builderForValue)

public GenerateContentResponse.PromptFeedback.Builder setSafetyRatings(int index, SafetyRating.Builder builderForValue)

Output only. Safety ratings.

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

Parameters
Name Description
index int
builderForValue SafetyRating.Builder
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final GenerateContentResponse.PromptFeedback.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides