SafetySetting interface

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

Signature:

export interface SafetySetting 

Properties

Property Type Description
category HarmCategory
method HarmBlockMethod 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.
threshold HarmBlockThreshold

SafetySetting.category

Signature:

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.

Signature:

method?: HarmBlockMethod;

SafetySetting.threshold

Signature:

threshold: HarmBlockThreshold;