Skip to main content CometChat allows you to integrate OpenAI for real-time message moderation, enabling automated detection of harmful, offensive, or inappropriate content.
Integration
Login to the CometChat Dashboard
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).
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 or Image 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.