Skip to content

Add content moderation support via OpenAI moderations endpoint#228

Open
ahmadmayahi wants to merge 2 commits intolaravel:0.xfrom
ahmadmayahi:0.x
Open

Add content moderation support via OpenAI moderations endpoint#228
ahmadmayahi wants to merge 2 commits intolaravel:0.xfrom
ahmadmayahi:0.x

Conversation

@ahmadmayahi
Copy link

@ahmadmayahi ahmadmayahi commented Feb 27, 2026

  • Add content moderation support via OpenAI's /moderations endpoint
  • Support for all 13 moderation categories with flagged status and confidence scores
use Laravel\Ai\Moderation;

$response = Moderation::check('I want to hurt someone');

 // true/false
$response->flagged;                      

// all categories
$response->categories;

// only flagged ones
$response->flaggedCategories(); 

// specific category
$response->category('violence');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant