Skip to content

MEAI Tools

Shows how to create MEAI AIFunction tools from the RetellAI client for use with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// Create a RetellAI client with a test API key.
var client = new RetellAiClient(apiKey: "test-key");

// Create AIFunction tools from the client.
var tools = new AIFunction[]
{
    client.AsListAgentsTool(),
    client.AsGetAgentTool(),
    client.AsCreatePhoneCallTool(),
    client.AsListCallsTool(),
    client.AsGetCallTool(),
    client.AsListPhoneNumbersTool(),
};

// Verify all tools are created with valid names and descriptions.
foreach (var tool in tools)
{
}