Class GenerateContentResponsePromptFeedback
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.
public record GenerateContentResponsePromptFeedback : IEquatable<GenerateContentResponsePromptFeedback>
- Inheritance
-
GenerateContentResponsePromptFeedback
- Implements
- Inherited Members
Properties
BlockReason
Output only. The reason why the prompt was blocked.
[JsonPropertyName("blockReason")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public BlockedReason? BlockReason { get; set; }
Property Value
BlockReasonMessage
Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API.
[JsonPropertyName("blockReasonMessage")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BlockReasonMessage { get; set; }
Property Value
SafetyRatings
Output only. A list of safety ratings for the prompt. There is one rating per category.
[JsonPropertyName("safetyRatings")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<SafetyRating>? SafetyRatings { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a GenerateContentResponsePromptFeedback object.
public static GenerateContentResponsePromptFeedback? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- GenerateContentResponsePromptFeedback
The deserialized GenerateContentResponsePromptFeedback object, or null if deserialization fails.