Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see
Model versions and lifecycle .
Send feedback
Interface GenerateContentResponse.PromptFeedbackOrBuilder (1.32.0)
Stay organized with collections
Save and categorize content based on your preferences.
public static interface GenerateContentResponse . PromptFeedbackOrBuilder extends MessageOrBuilder
Methods
getBlockReason()
public abstract GenerateContentResponse . PromptFeedback . BlockedReason getBlockReason ()
Output only. Blocked reason.
.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
getBlockReasonMessage()
public abstract 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 abstract 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 abstract int getBlockReasonValue ()
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.
getSafetyRatings(int index)
public abstract SafetyRating getSafetyRatings ( int index )
Output only. Safety ratings.
repeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter
Name
Description
index
int
getSafetyRatingsCount()
public abstract int getSafetyRatingsCount ()
Output only. Safety ratings.
repeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
Returns
Type
Description
int
getSafetyRatingsList()
public abstract List<SafetyRating> getSafetyRatingsList ()
Output only. Safety ratings.
repeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
getSafetyRatingsOrBuilder(int index)
public abstract SafetyRatingOrBuilder getSafetyRatingsOrBuilder ( int index )
Output only. Safety ratings.
repeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
Parameter
Name
Description
index
int
getSafetyRatingsOrBuilderList()
public abstract List <? extends SafetyRatingOrBuilder > 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 >
Send feedback
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-08-16 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-16 UTC."],[],[],null,["# Interface GenerateContentResponse.PromptFeedbackOrBuilder (1.32.0)\n\n public static interface GenerateContentResponse.PromptFeedbackOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### getBlockReason()\n\n public abstract GenerateContentResponse.PromptFeedback.BlockedReason getBlockReason()\n\nOutput only. Blocked reason.\n\n`\n.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getBlockReasonMessage()\n\n public abstract String getBlockReasonMessage()\n\nOutput only. A readable block reason message.\n\n`string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];`\n\n### getBlockReasonMessageBytes()\n\n public abstract ByteString getBlockReasonMessageBytes()\n\nOutput only. A readable block reason message.\n\n`string block_reason_message = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];`\n\n### getBlockReasonValue()\n\n public abstract int getBlockReasonValue()\n\nOutput only. Blocked reason.\n\n`\n.google.cloud.vertexai.v1.GenerateContentResponse.PromptFeedback.BlockedReason block_reason = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getSafetyRatings(int index)\n\n public abstract SafetyRating getSafetyRatings(int index)\n\nOutput only. Safety ratings.\n\n`\nrepeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getSafetyRatingsCount()\n\n public abstract int getSafetyRatingsCount()\n\nOutput only. Safety ratings.\n\n`\nrepeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getSafetyRatingsList()\n\n public abstract List\u003cSafetyRating\u003e getSafetyRatingsList()\n\nOutput only. Safety ratings.\n\n`\nrepeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getSafetyRatingsOrBuilder(int index)\n\n public abstract SafetyRatingOrBuilder getSafetyRatingsOrBuilder(int index)\n\nOutput only. Safety ratings.\n\n`\nrepeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`\n\n### getSafetyRatingsOrBuilderList()\n\n public abstract List\u003c? extends SafetyRatingOrBuilder\u003e getSafetyRatingsOrBuilderList()\n\nOutput only. Safety ratings.\n\n`\nrepeated .google.cloud.vertexai.v1.SafetyRating safety_ratings = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];\n`"]]