Skip to content

MEAI Tools

Example showing how to use Gretel AIFunction tools with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// Gretel provides AIFunction tools that can be used with any `IChatClient`.
// These tools wrap common Gretel API operations for use in AI agent workflows.
using var client = new GretelClient(apiKey);

var tools = new[]
{
    client.AsListProjectsTool(),
    client.AsGetProjectTool(),
    client.AsListModelsTool(),
    client.AsGetModelTool(),
    client.AsGetWorkflowRunTool(),
    client.AsListWorkflowsTool(),
};