HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/mysqlsh/lib/python3.8/site-packages/oci/generative_ai/models/content_moderation_config.py
# coding: utf-8
# Copyright (c) 2016, 2025, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20231130


from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class ContentModerationConfig(object):
    """
    The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses.
    """

    #: A constant which can be used with the mode property of a ContentModerationConfig.
    #: This constant has a value of "INFORM"
    MODE_INFORM = "INFORM"

    #: A constant which can be used with the mode property of a ContentModerationConfig.
    #: This constant has a value of "BLOCK"
    MODE_BLOCK = "BLOCK"

    def __init__(self, **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):

        :param mode:
            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'.
        :type mode: str

        :param model_id:
            The value to assign to the model_id property of this ContentModerationConfig.
        :type model_id: str

        :param is_enabled:
            The value to assign to the is_enabled property of this ContentModerationConfig.
        :type is_enabled: bool

        """
        self.swagger_types = {
            'mode': 'str',
            'model_id': 'str',
            'is_enabled': 'bool'
        }
        self.attribute_map = {
            'mode': 'mode',
            'model_id': 'modelId',
            'is_enabled': 'isEnabled'
        }
        self._mode = None
        self._model_id = None
        self._is_enabled = None

    @property
    def mode(self):
        """
        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'.


        :return: The mode of this ContentModerationConfig.
        :rtype: str
        """
        return self._mode

    @mode.setter
    def mode(self, mode):
        """
        Sets the mode of this ContentModerationConfig.
        Enum for the modes of operation for inference protection.


        :param mode: The mode of this ContentModerationConfig.
        :type: str
        """
        allowed_values = ["INFORM", "BLOCK"]
        if not value_allowed_none_or_none_sentinel(mode, allowed_values):
            mode = 'UNKNOWN_ENUM_VALUE'
        self._mode = mode

    @property
    def model_id(self):
        """
        Gets the model_id of this ContentModerationConfig.
        The OCID of the model used for the feature.


        :return: The model_id of this ContentModerationConfig.
        :rtype: str
        """
        return self._model_id

    @model_id.setter
    def model_id(self, model_id):
        """
        Sets the model_id of this ContentModerationConfig.
        The OCID of the model used for the feature.


        :param model_id: The model_id of this ContentModerationConfig.
        :type: str
        """
        self._model_id = model_id

    @property
    def is_enabled(self):
        """
        **[Required]** Gets the is_enabled of this ContentModerationConfig.
        Whether to enable the content moderation feature.


        :return: The is_enabled of this ContentModerationConfig.
        :rtype: bool
        """
        return self._is_enabled

    @is_enabled.setter
    def is_enabled(self, is_enabled):
        """
        Sets the is_enabled of this ContentModerationConfig.
        Whether to enable the content moderation feature.


        :param is_enabled: The is_enabled of this ContentModerationConfig.
        :type: bool
        """
        self._is_enabled = is_enabled

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other