Skip to content

MEAI Tools

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

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

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

// Create AIFunction tools from the Creatomate client.
var createRenderTool = client.AsCreateRenderTool();
var getRenderStatusTool = client.AsGetRenderStatusTool();
var listTemplatesTool = client.AsListTemplatesTool();
var getTemplateTool = client.AsGetTemplateTool();

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

// These tools can be passed to any IChatClient for function calling.
var tools = new[] { createRenderTool, getRenderStatusTool, listTemplatesTool, getTemplateTool };