ContentModerationConfig

class oci.generative_ai.models.ContentModerationConfig(**kwargs)

Bases: object

The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses.

Attributes:

MODE_BLOCK

A constant which can be used with the mode property of a ContentModerationConfig.

MODE_INFORM

A constant which can be used with the mode property of a ContentModerationConfig.

is_enabled

[Required] Gets the is_enabled of this ContentModerationConfig.

mode

Gets the mode of this ContentModerationConfig.

model_id

Gets the model_id of this ContentModerationConfig.

Methods:

__init__(**kwargs)

Initializes a new ContentModerationConfig object with values from keyword arguments.

MODE_BLOCK = 'BLOCK'

A constant which can be used with the mode property of a ContentModerationConfig. This constant has a value of “BLOCK”

MODE_INFORM = 'INFORM'

A constant which can be used with the mode property of a ContentModerationConfig. This constant has a value of “INFORM”

__init__(**kwargs)

Initializes a new ContentModerationConfig object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • mode (str) – The value to assign to the mode property of this ContentModerationConfig. Allowed values for this property are: “INFORM”, “BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • model_id (str) – The value to assign to the model_id property of this ContentModerationConfig.

  • is_enabled (bool) – The value to assign to the is_enabled property of this ContentModerationConfig.

property is_enabled

[Required] Gets the is_enabled of this ContentModerationConfig. Whether to enable the content moderation feature.

Returns

The is_enabled of this ContentModerationConfig.

Return type

bool

property mode

Gets the mode of this ContentModerationConfig. Enum for the modes of operation for inference protection.

Allowed values for this property are: “INFORM”, “BLOCK”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The mode of this ContentModerationConfig.

Return type

str

property model_id

Gets the model_id of this ContentModerationConfig. The OCID of the model used for the feature.

Returns

The model_id of this ContentModerationConfig.

Return type

str