Skip to content

MEAI Tools

Using Inworld endpoints as AIFunction tools with any Microsoft.Extensions.AI IChatClient.

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

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

// Create AIFunction tools from the Inworld client.
var synthesizeTool = client.AsSynthesizeSpeechTool();
var listVoicesTool = client.AsListVoicesTool();
var listModelsTool = client.AsListModelsTool();
var designVoiceTool = client.AsDesignVoiceTool();

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

// These tools can be passed to any IChatClient for function calling.
var tools = new[] { synthesizeTool, listVoicesTool, listModelsTool, designVoiceTool };