Skip to content

MEAI Tools

Example showing how to create MEAI AIFunction tools from the Novu client for use with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// Create a Novu client and convert to AIFunction tools.
using var client = new NovuClient(apiKey: "test-key");

// Create tools for use with any IChatClient.
var triggerTool = client.AsTriggerEventTool();
var subscribersTool = client.AsSearchSubscribersTool();
var workflowsTool = client.AsListWorkflowsTool();
var notificationsTool = client.AsListNotificationsTool();
var getNotificationTool = client.AsGetNotificationTool();
var topicsTool = client.AsListTopicsTool();

// Verify tool names and descriptions are set.