How to set a filter on Chat message for text restriction?

Hi Guys:

May I know how to set a filter to restrict the text in chat message? For example, I want to stop
some chat message to present with hassle or insult words.

Hi Grant @crowdzoning,

Welcome to the forum!

One of the ways is to use AI content moderation for that. Adalo has a pre-built one (Power Your App with ChatGPT | Adalo Resources), there is an answer to your question in this doc.

If you’d like to have something more advanced, you will have to build integration by yourself, maybe with the help of 3rd party platforms like Make.

Best,
Victor.

Hi Vector:
Many Thanks for your help!

B.RGDS

Grant

1 Like

Hi Vector:
Thanks for your last reply about how to use OpenAI for chat message moderation.May I ask you a question:
In order to moderate some specific texts in the chat message,I add a custom action of AskChatGPT on my message submit button (please refer to my screenshot),
Then I was asked to input a prompt in the prompt field.May I know what I should enter:
Should I enter: Regex patterns for custom content moderation as follows:
const moderationPatterns = [
{ label: ‘Email’, regex: /\b[A-Za-z0-9._%±]+@[A-Za-z0-9.-]+.[A-Z|a-z]{2,}\b/ },
{ label: ‘Phone Number’, regex: /\b\d{10,}\b/ },
{ label: ‘Credit Card’, regex: /\b(?:\d[ -]*?){13,16}\b/ },
{ label: ‘PayPal’, regex: /\bpaypal\b/i },
{ label: ‘Social Media URL’, regex: /(facebook|instagram|twitter|tiktok|linkedin).com/i },
{ label: ‘Website URL’, regex: /\bhttps?://[^\s]+\b/ }

or I just paste the following in the field:

Prompt should contain this?

  1. Email Detection Prompt:
  • Prompt: “Scan the content for email addresses and flag them for review. Look for patterns like ‘example@domain.com’.”
  1. Phone Number Detection Prompt:
  • Prompt: “Identify any sequences of numbers with 10 or more digits that may represent phone numbers, such as ‘1234567890’, and mask them.”
  1. Credit Card Detection Prompt:
  • Prompt: “Check for sequences resembling credit card numbers, typically 13 to 16 digits, like ‘1234 5678 9012 3456’, and redact this information.”
  1. PayPal Mention Detection Prompt:
  • Prompt: “Detect any occurrences of the word ‘PayPal’, regardless of case, and notify the user for verification.”
  1. Social Media URL Detection Prompt:
  • Prompt: “Look for URLs that lead to major social media websites such as Facebook, Instagram, Twitter, TikTok, or LinkedIn, and flag them for review.”
  1. Generic Website URL Detection Prompt:
  • Prompt: “Identify any URLs starting with ‘http://’ or ‘https://’ and list them for further inspection.”

Thanks for your help

Grant

(attachments)



Hi Grant @crowdzoning,

I believe that you need to do it in a text format. However - what would you expect ChatGPT to return - you need to add an instruction for that. I think smth like “return original text with the following parts masked”. But that’s just my opinion, you need to experiment to get results.

Best,
Victor.