Skip to content

MEAI Tools

Shows how to use Label Studio operations as AIFunction tools with any IChatClient.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
var client = Client;

// Create AIFunction tools for use with any IChatClient.
var listProjectsTool = client.AsListProjectsTool();
var getProjectTool = client.AsGetProjectTool();
var listTasksTool = client.AsListTasksTool();
var createAnnotationTool = client.AsCreateAnnotationTool();

// All tools should be valid AIFunction instances.

// Tools can be added to ChatOptions for use with any IChatClient.
var options = new ChatOptions
{
    Tools =
    [
        listProjectsTool,
        getProjectTool,
        listTasksTool,
        createAnnotationTool,
    ],
};