Skip to content

AIFunction Tools

Use Lakera Guard as an AIFunction tool with any IChatClient agent.

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

1
2
3
4
5
6
7
using var client = new LakeraClient(apiKey);

// Create AIFunction tools for use with any IChatClient.
var guardTool = client.AsGuardTool();
var guardResultsTool = client.AsGuardResultsTool();

// The tools can be added to ChatOptions.Tools for any MEAI-compatible chat client.