[Free Module] Use Groq AI to filter spam emails and form submissions!

2025 Update

Hello everyone who has been using this module, and for those who want to test this module out:

Since my last post above in 2024, Groq has deprecated the ilama-3.1-70b-versatile model, and also the example words in the prompt used above may trip Groq’s “unsafe” filters. Hence, an update to this module is due.

Here’s a screenshot of the new settings with the latest model, improved prompt:

Get the module below —

Module Export - quick import into your scenario

You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.

  1. Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:

  2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.

  3. Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.

JSON module export — paste this directly in your scenario

{"subflows":[{"flow":[{"id":2,"module":"groq:createJSONChatCompletion","version":1,"parameters":{"__IMTCONN__":1},"mapper":{"model":"llama-3.3-70b-versatile","systemPrompt":"Analyse the provided content. Consider factors such as language, grammar, urgency, suspicious links, and requested actions. Provide a score ranging from 0.00 for legitimate to 1.00 for definitely spam, and a concise reason for the classification. If the content is not in English, then provide a translation.\n\nIf the content is similar to \"hello I want to know your price\" and has a link from a link shortener or suspicious TLDs (like .ru), then it is likely spam.\n\nYour response must strictly follow the following example JSON object format and property types. Never wrap the JSON output with codefences, markup, or explanations.\n\n{\n  \"is_spam\": true,\n  \"score\": 0.74,\n  \"reason\": \"The content contains a suspicious link and keywords.\",\n  \"suspicious_keywords\": [ \"click\" ],\n  \"suspicious_links\": [ \"https://bit.ly/example\" ],\n  \"translation\": null\n}","userMessage":"{{join(map(toArray(1.data); \"value\"); newline)}}","temperature":"0.10"},"metadata":{"designer":{"x":300,"y":600,"name":"AI Spam Filter"},"parameters":[{"name":"__IMTCONN__","type":"account:groq","label":"Connection","required":true}]}}]}],"metadata":{"version":1}}

Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?

Hope you continue to find this module useful!

@samliew

2 Likes