Back to Firebase Js Sdk

SafetySetting interface

docs-devsite/ai.safetysetting.md

12.12.11.8 KB
Original Source

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 %}

SafetySetting interface

Safety setting that can be sent as part of request parameters.

<b>Signature:</b>

typescript
export interface SafetySetting 

Properties

PropertyTypeDescription
categoryHarmCategory
methodHarmBlockMethodThe harm block method.<!-- -->This property is only supported in the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), an AIError will be thrown if this property is defined.
thresholdHarmBlockThreshold

SafetySetting.category

<b>Signature:</b>

typescript
category: HarmCategory;

SafetySetting.method

The harm block method.

This property is only supported in the Vertex AI Gemini API (VertexAIBackend<!-- -->). When using the Gemini Developer API (GoogleAIBackend<!-- -->), an AIError will be thrown if this property is defined.

<b>Signature:</b>

typescript
method?: HarmBlockMethod;

SafetySetting.threshold

<b>Signature:</b>

typescript
threshold: HarmBlockThreshold;