Class GenerateContentResponse.PromptFeedback.Builder (1.1.0)

publicstaticfinalclass GenerateContentResponse.PromptFeedback.BuilderextendsGeneratedMessageV3.Builder<GenerateContentResponse.PromptFeedback.Builder>implementsGenerateContentResponse.PromptFeedbackOrBuilder

Content filter results for a prompt sent in the request.

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

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllSafetyRatings(Iterable<? extends SafetyRating> values)

publicGenerateContentResponse.PromptFeedback.BuilderaddAllSafetyRatings(Iterable<?extendsSafetyRating>values)

Output only. Safety ratings.

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

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicGenerateContentResponse.PromptFeedback.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

addSafetyRatings(SafetyRating value)

publicGenerateContentResponse.PromptFeedback.BuilderaddSafetyRatings(SafetyRatingvalue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuilderaddSafetyRatings(SafetyRating.BuilderbuilderForValue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuilderaddSafetyRatings(intindex,SafetyRatingvalue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuilderaddSafetyRatings(intindex,SafetyRating.BuilderbuilderForValue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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()

publicSafetyRating.BuilderaddSafetyRatingsBuilder()

Output only. Safety ratings.

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

Returns
Type Description
SafetyRating.Builder

addSafetyRatingsBuilder(int index)

publicSafetyRating.BuilderaddSafetyRatingsBuilder(intindex)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating.Builder

build()

publicGenerateContentResponse.PromptFeedbackbuild()
Returns
Type Description
GenerateContentResponse.PromptFeedback

buildPartial()

publicGenerateContentResponse.PromptFeedbackbuildPartial()
Returns
Type Description
GenerateContentResponse.PromptFeedback

clear()

publicGenerateContentResponse.PromptFeedback.Builderclear()
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearBlockReason()

publicGenerateContentResponse.PromptFeedback.BuilderclearBlockReason()

Output only. Blocked reason.

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

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

This builder for chaining.

clearBlockReasonMessage()

publicGenerateContentResponse.PromptFeedback.BuilderclearBlockReasonMessage()

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)

publicGenerateContentResponse.PromptFeedback.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicGenerateContentResponse.PromptFeedback.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

clearSafetyRatings()

publicGenerateContentResponse.PromptFeedback.BuilderclearSafetyRatings()

Output only. Safety ratings.

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

Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

clone()

publicGenerateContentResponse.PromptFeedback.Builderclone()
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

getBlockReason()

publicGenerateContentResponse.PromptFeedback.BlockedReasongetBlockReason()

Output only. Blocked reason.

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

Returns
Type Description
GenerateContentResponse.PromptFeedback.BlockedReason

The blockReason.

getBlockReasonMessage()

publicStringgetBlockReasonMessage()

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()

publicByteStringgetBlockReasonMessageBytes()

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()

publicintgetBlockReasonValue()

Output only. Blocked reason.

.google.cloud.vertexai.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()

publicGenerateContentResponse.PromptFeedbackgetDefaultInstanceForType()
Returns
Type Description
GenerateContentResponse.PromptFeedback

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getSafetyRatings(int index)

publicSafetyRatinggetSafetyRatings(intindex)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating

getSafetyRatingsBuilder(int index)

publicSafetyRating.BuildergetSafetyRatingsBuilder(intindex)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRating.Builder

getSafetyRatingsBuilderList()

publicList<SafetyRating.Builder>getSafetyRatingsBuilderList()

Output only. Safety ratings.

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

Returns
Type Description
List<Builder>

getSafetyRatingsCount()

publicintgetSafetyRatingsCount()

Output only. Safety ratings.

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

Returns
Type Description
int

getSafetyRatingsList()

publicList<SafetyRating>getSafetyRatingsList()

Output only. Safety ratings.

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

Returns
Type Description
List<SafetyRating>

getSafetyRatingsOrBuilder(int index)

publicSafetyRatingOrBuildergetSafetyRatingsOrBuilder(intindex)

Output only. Safety ratings.

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

Parameter
Name Description
index int
Returns
Type Description
SafetyRatingOrBuilder

getSafetyRatingsOrBuilderList()

publicList<?extendsSafetyRatingOrBuilder>getSafetyRatingsOrBuilderList()

Output only. Safety ratings.

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

Returns
Type Description
List<? extends com.google.cloud.vertexai.api.SafetyRatingOrBuilder>

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(GenerateContentResponse.PromptFeedback other)

publicGenerateContentResponse.PromptFeedback.BuildermergeFrom(GenerateContentResponse.PromptFeedbackother)
Parameter
Name Description
other GenerateContentResponse.PromptFeedback
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicGenerateContentResponse.PromptFeedback.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicGenerateContentResponse.PromptFeedback.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalGenerateContentResponse.PromptFeedback.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

removeSafetyRatings(int index)

publicGenerateContentResponse.PromptFeedback.BuilderremoveSafetyRatings(intindex)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuildersetBlockReason(GenerateContentResponse.PromptFeedback.BlockedReasonvalue)

Output only. Blocked reason.

.google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuildersetBlockReasonMessage(Stringvalue)

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)

publicGenerateContentResponse.PromptFeedback.BuildersetBlockReasonMessageBytes(ByteStringvalue)

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)

publicGenerateContentResponse.PromptFeedback.BuildersetBlockReasonValue(intvalue)

Output only. Blocked reason.

.google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

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

publicGenerateContentResponse.PromptFeedback.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

setSafetyRatings(int index, SafetyRating value)

publicGenerateContentResponse.PromptFeedback.BuildersetSafetyRatings(intindex,SafetyRatingvalue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicGenerateContentResponse.PromptFeedback.BuildersetSafetyRatings(intindex,SafetyRating.BuilderbuilderForValue)

Output only. Safety ratings.

repeated .google.cloud.vertexai.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)

publicfinalGenerateContentResponse.PromptFeedback.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
GenerateContentResponse.PromptFeedback.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.