PromptFeedback interface
Stay organized with collections
Save and categorize content based on your preferences.
If the prompt was blocked, this will be populated with blockReason
and the relevant safetyRatings
.
Signature:
export interface PromptFeedback
Properties
PromptFeedback.blockReason
Signature:
blockReason?: BlockReason;
PromptFeedback.blockReasonMessage
A human-readable description of the blockReason
.
This property is only supported in the Vertex AI Gemini API (VertexAIBackend).
Signature:
blockReasonMessage?: string;
PromptFeedback.safetyRatings
Signature:
safetyRatings: SafetyRating[];
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-05-20 UTC.
[null,null,["Last updated 2025-05-20 UTC."],[],[],null,["# PromptFeedback interface\n\nIf the prompt was blocked, this will be populated with `blockReason` and the relevant `safetyRatings`.\n\n**Signature:** \n\n export interface PromptFeedback \n\nProperties\n----------\n\n| Property | Type | Description |\n|-------------------------------------------------------------------------------|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [blockReason](./ai.promptfeedback.md#promptfeedbackblockreason) | [BlockReason](./ai.md#blockreason) | |\n| [blockReasonMessage](./ai.promptfeedback.md#promptfeedbackblockreasonmessage) | string | A human-readable description of the `blockReason`.This property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)). |\n| [safetyRatings](./ai.promptfeedback.md#promptfeedbacksafetyratings) | [SafetyRating](./ai.safetyrating.md#safetyrating_interface)\\[\\] | |\n\nPromptFeedback.blockReason\n--------------------------\n\n**Signature:** \n\n blockReason?: BlockReason;\n\nPromptFeedback.blockReasonMessage\n---------------------------------\n\nA human-readable description of the `blockReason`.\n\nThis property is only supported in the Vertex AI Gemini API ([VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class)).\n\n**Signature:** \n\n blockReasonMessage?: string;\n\nPromptFeedback.safetyRatings\n----------------------------\n\n**Signature:** \n\n safetyRatings: SafetyRating[];"]]