Skip to content

MEAI Tools

Example showing how to use Sightengine as AI function tools with any IChatClient.

This example assumes using Sightengine; is in scope and apiKey contains your Sightengine API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
using var client = new SightengineClient(apiKey);

// Sightengine provides AIFunction tools that can be used with any
// Microsoft.Extensions.AI IChatClient for content moderation.

// Moderate images for harmful content
var moderateImageTool = client.AsModerateImageTool();

// Detect AI-generated images
var detectAiTool = client.AsDetectAiGeneratedTool();

// Moderate text for profanity and personal info
var moderateTextTool = client.AsModerateTextTool();

// Validate usernames
var validateUsernameTool = client.AsValidateUsernameTool();