Skip to content

/AWS1/CL_BDKGUARDRAILCONTFIL00

Contains filter strengths for harmful content. Guardrails support the following content filters to detect and filter harmful user inputs and FM-generated outputs.

  • Hate – Describes language or a statement that discriminates, criticizes, insults, denounces, or dehumanizes a person or group on the basis of an identity (such as race, ethnicity, gender, religion, sexual orientation, ability, and national origin).

  • Insults – Describes language or a statement that includes demeaning, humiliating, mocking, insulting, or belittling language. This type of language is also labeled as bullying.

  • Sexual – Describes language or a statement that indicates sexual interest, activity, or arousal using direct or indirect references to body parts, physical traits, or sex.

  • Violence – Describes language or a statement that includes glorification of or threats to inflict physical pain, hurt, or injury toward a person, group or thing.

Content filtering depends on the confidence classification of user inputs and FM responses across each of the four harmful categories. All input and output statements are classified into one of four confidence levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, if a statement is classified as Hate with HIGH confidence, the likelihood of the statement representing hateful content is high. A single statement can be classified across multiple categories with varying confidence levels. For example, a single statement can be classified as Hate with HIGH confidence, Insults with LOW confidence, Sexual with NONE confidence, and Violence with MEDIUM confidence.

For more information, see Guardrails content filters.

CONSTRUCTOR

IMPORTING

Required arguments:

IV_TYPE TYPE /AWS1/BDKGUARDRAILCONTFILTTYPE /AWS1/BDKGUARDRAILCONTFILTTYPE

The harmful category that the content filter is applied to.

IV_INPUTSTRENGTH TYPE /AWS1/BDKGUARDRAILFILTSTRENGTH /AWS1/BDKGUARDRAILFILTSTRENGTH

The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.

IV_OUTPUTSTRENGTH TYPE /AWS1/BDKGUARDRAILFILTSTRENGTH /AWS1/BDKGUARDRAILFILTSTRENGTH

The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.


Queryable Attributes

type

The harmful category that the content filter is applied to.

Accessible with the following methods

Method Description
GET_TYPE() Getter for TYPE, with configurable default
ASK_TYPE() Getter for TYPE w/ exceptions if field has no value
HAS_TYPE() Determine if TYPE has a value

inputStrength

The strength of the content filter to apply to prompts. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.

Accessible with the following methods

Method Description
GET_INPUTSTRENGTH() Getter for INPUTSTRENGTH, with configurable default
ASK_INPUTSTRENGTH() Getter for INPUTSTRENGTH w/ exceptions if field has no value
HAS_INPUTSTRENGTH() Determine if INPUTSTRENGTH has a value

outputStrength

The strength of the content filter to apply to model responses. As you increase the filter strength, the likelihood of filtering harmful content increases and the probability of seeing harmful content in your application reduces.

Accessible with the following methods

Method Description
GET_OUTPUTSTRENGTH() Getter for OUTPUTSTRENGTH, with configurable default
ASK_OUTPUTSTRENGTH() Getter for OUTPUTSTRENGTH w/ exceptions if field has no valu
HAS_OUTPUTSTRENGTH() Determine if OUTPUTSTRENGTH has a value

Public Local Types In This Class

Internal table types, representing arrays and maps of this class, are defined as local types:

TT_GUARDRAILCONTFILTERSCONFIG

TYPES TT_GUARDRAILCONTFILTERSCONFIG TYPE STANDARD TABLE OF REF TO /AWS1/CL_BDKGUARDRAILCONTFIL00 WITH DEFAULT KEY
.