Skip to content

MEAI Tools

Example showing how to create AIFunction tools for use with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// Create an authenticated client.
using var client = new MagicHourClient(apiKey);

// Create AIFunction tools from the Magic Hour client.
// These tools can be used with any `IChatClient` for AI agent workflows.
var textToVideoTool = client.AsTextToVideoTool();
var imageToVideoTool = client.AsImageToVideoTool();
var getVideoStatusTool = client.AsGetVideoStatusTool();
var getImageStatusTool = client.AsGetImageStatusTool();
var generateImageTool = client.AsGenerateImageTool();
var faceSwapTool = client.AsFaceSwapVideoTool();
var lipSyncTool = client.AsLipSyncTool();

// Each tool has a name and description suitable for LLM tool calling.