Package com.google.genai.types
Class GenerateContentResponsePromptFeedback
-
- All Implemented Interfaces:
public abstract class GenerateContentResponsePromptFeedback extends JsonSerializable
Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classGenerateContentResponsePromptFeedback.BuilderBuilder for GenerateContentResponsePromptFeedback.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description GenerateContentResponsePromptFeedback()
-
Method Summary
Modifier and Type Method Description abstract Optional<BlockedReason>blockReason()Output only. abstract Optional<String>blockReasonMessage()Output only. abstract Optional<List<SafetyRating>>safetyRatings()Output only. static GenerateContentResponsePromptFeedback.Builderbuilder()Instantiates a builder for GenerateContentResponsePromptFeedback. abstract GenerateContentResponsePromptFeedback.BuildertoBuilder()Creates a builder with the same values as this instance. static GenerateContentResponsePromptFeedbackfromJson(String jsonString)Deserializes a JSON string to a GenerateContentResponsePromptFeedback object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
blockReason
abstract Optional<BlockedReason> blockReason()
Output only. The reason why the prompt was blocked.
-
blockReasonMessage
abstract Optional<String> blockReasonMessage()
Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API.
-
safetyRatings
abstract Optional<List<SafetyRating>> safetyRatings()
Output only. A list of safety ratings for the prompt. There is one rating per category.
-
builder
static GenerateContentResponsePromptFeedback.Builder builder()
Instantiates a builder for GenerateContentResponsePromptFeedback.
-
toBuilder
abstract GenerateContentResponsePromptFeedback.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static GenerateContentResponsePromptFeedback fromJson(String jsonString)
Deserializes a JSON string to a GenerateContentResponsePromptFeedback object.
-
-
-
-