Class GenerateContentResponse.PromptFeedback.Builder (3.42.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.v1beta1.GenerateContentResponse.PromptFeedback

Static Methods

getDescriptor()

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

Methods

addAllSafetyRatings(Iterable<? extends SafetyRating> values)

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

Output only. Safety ratings.

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

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addSafetyRatings(SafetyRating value)

public GenerateContentResponse.PromptFeedback.Builder addSafetyRatings(SafetyRating value)

Output only. Safety ratings.

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

Parameter
NameDescription
valueSafetyRating
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatings(SafetyRating.Builder builderForValue)

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

Output only. Safety ratings.

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

Parameter
NameDescription
builderForValueSafetyRating.Builder
Returns
TypeDescription
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.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
valueSafetyRating
Returns
TypeDescription
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.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
builderForValueSafetyRating.Builder
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

addSafetyRatingsBuilder()

public SafetyRating.Builder addSafetyRatingsBuilder()

Output only. Safety ratings.

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

Returns
TypeDescription
SafetyRating.Builder

addSafetyRatingsBuilder(int index)

public SafetyRating.Builder addSafetyRatingsBuilder(int index)

Output only. Safety ratings.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating.Builder

build()

public GenerateContentResponse.PromptFeedback build()
Returns
TypeDescription
GenerateContentResponse.PromptFeedback

buildPartial()

public GenerateContentResponse.PromptFeedback buildPartial()
Returns
TypeDescription
GenerateContentResponse.PromptFeedback

clear()

public GenerateContentResponse.PromptFeedback.Builder clear()
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearBlockReason()

public GenerateContentResponse.PromptFeedback.Builder clearBlockReason()

Output only. Blocked reason.

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

Returns
TypeDescription
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
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearSafetyRatings()

public GenerateContentResponse.PromptFeedback.Builder clearSafetyRatings()

Output only. Safety ratings.

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

Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

clone()

public GenerateContentResponse.PromptFeedback.Builder clone()
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder
Overrides

getBlockReason()

public GenerateContentResponse.PromptFeedback.BlockedReason getBlockReason()

Output only. Blocked reason.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for blockReasonMessage.

getBlockReasonValue()

public int getBlockReasonValue()

Output only. Blocked reason.

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

Returns
TypeDescription
int

The enum numeric value on the wire for blockReason.

getDefaultInstanceForType()

public GenerateContentResponse.PromptFeedback getDefaultInstanceForType()
Returns
TypeDescription
GenerateContentResponse.PromptFeedback

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getSafetyRatings(int index)

public SafetyRating getSafetyRatings(int index)

Output only. Safety ratings.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating

getSafetyRatingsBuilder(int index)

public SafetyRating.Builder getSafetyRatingsBuilder(int index)

Output only. Safety ratings.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRating.Builder

getSafetyRatingsBuilderList()

public List<SafetyRating.Builder> getSafetyRatingsBuilderList()

Output only. Safety ratings.

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

Returns
TypeDescription
List<Builder>

getSafetyRatingsCount()

public int getSafetyRatingsCount()

Output only. Safety ratings.

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

Returns
TypeDescription
int

getSafetyRatingsList()

public List<SafetyRating> getSafetyRatingsList()

Output only. Safety ratings.

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

Returns
TypeDescription
List<SafetyRating>

getSafetyRatingsOrBuilder(int index)

public SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index)

Output only. Safety ratings.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
SafetyRatingOrBuilder

getSafetyRatingsOrBuilderList()

public List<? extends SafetyRatingOrBuilder> getSafetyRatingsOrBuilderList()

Output only. Safety ratings.

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

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

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(GenerateContentResponse.PromptFeedback other)

public GenerateContentResponse.PromptFeedback.Builder mergeFrom(GenerateContentResponse.PromptFeedback other)
Parameter
NameDescription
otherGenerateContentResponse.PromptFeedback
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeSafetyRatings(int index)

public GenerateContentResponse.PromptFeedback.Builder removeSafetyRatings(int index)

Output only. Safety ratings.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

setBlockReason(GenerateContentResponse.PromptFeedback.BlockedReason value)

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

Output only. Blocked reason.

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

Parameter
NameDescription
valueGenerateContentResponse.PromptFeedback.BlockedReason

The blockReason to set.

Returns
TypeDescription
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
NameDescription
valueString

The blockReasonMessage to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for blockReasonMessage to set.

Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setBlockReasonValue(int value)

public GenerateContentResponse.PromptFeedback.Builder setBlockReasonValue(int value)

Output only. Blocked reason.

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

Parameter
NameDescription
valueint

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

Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public GenerateContentResponse.PromptFeedback.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
valueSafetyRating
Returns
TypeDescription
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.v1beta1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameters
NameDescription
indexint
builderForValueSafetyRating.Builder
Returns
TypeDescription
GenerateContentResponse.PromptFeedback.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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