OpenAI Moderation
CometChat allows you to integrate OpenAI for real-time message moderation, enabling automated detection of harmful, offensive, or inappropriate content.
Integration
Step 1: Configure OpenAI Settings
-
Login to the CometChat Dashboard
- Navigate to CometChat Dashboard and select your app.
-
Navigate to Moderation Settings
- Go to Moderation → Settings in the left-hand menu.
-
Open OpenAI Settings Tab
- Click on the OpenAI Settings tab within the Moderation Settings.
-
Fill in the OpenAI Configuration
-
Select OpenAI Model
- Choose the OpenAI model you want to use (e.g.,
gpt-4-turbo
).
- Choose the OpenAI model you want to use (e.g.,
-
Provide OpenAI API Key
- Enter your OpenAI API key to authenticate requests.
-
Set Action on OpenAI Error
- Define how the system should respond if OpenAI is unavailable (e.g., "Allow message" or "Block message").
-
Set Context Window
- Specify the number of previous messages in a conversation that will be used for OpenAI context.
-
-
Click Save Settings
Step 2: Enable OpenAI Moderation
- Navigate to Moderation → List.
- Click "Create New Rule".
- Select OpenAI as the moderation type.
- Select a predefined prompt from the List Section or create your own.
- Ensure that the rule type is either
Text Contains
orImage Contains
. - Save the rule and Enable it.
Note: The rule you create should be of type Text Contains or Image Contains to work with OpenAI moderation.