Skip to content

MEAI Tools

Using AvatarTalk as AIFunction tools with any Microsoft.Extensions.AI IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
using var client = new AvatarTalkClient(apiKey);

// Create AIFunction tools from the AvatarTalk client.
var generateVideoTool = client.AsGenerateVideoTool();
var createSessionTool = client.AsCreateLiveKitSessionTool();
var deleteSessionTool = client.AsDeleteLiveKitSessionTool();
var paymentStatusTool = client.AsGetPaymentStatusTool();

// Verify all tools are created with the expected names.

// These tools can be passed to any IChatClient for function calling.
var tools = new[] { generateVideoTool, createSessionTool, deleteSessionTool, paymentStatusTool };