docs-devsite/ai.safetyrating.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
A safety rating associated with a GenerateContentCandidate
<b>Signature:</b>
export interface SafetyRating
| Property | Type | Description |
|---|---|---|
| blocked | boolean | |
| category | HarmCategory | |
| probability | HarmProbability | |
| probabilityScore | number | The probability score of the harm category.<!-- -->This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to 0. |
| severity | HarmSeverity | The harm severity level.<!-- -->This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to <code>HarmSeverity.UNSUPPORTED</code>. |
| severityScore | number | The severity score of the harm category.<!-- -->This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to 0. |
<b>Signature:</b>
blocked: boolean;
<b>Signature:</b>
category: HarmCategory;
<b>Signature:</b>
probability: HarmProbability;
The probability score of the harm category.
This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to 0.
<b>Signature:</b>
probabilityScore: number;
The harm severity level.
This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to HarmSeverity.UNSUPPORTED<!-- -->.
<b>Signature:</b>
severity: HarmSeverity;
The severity score of the harm category.
This property is only supported when using the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), this property is not supported and will default to 0.
<b>Signature:</b>
severityScore: number;