Skip to content

MeaiTools

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
var apiKey =
    Environment.GetEnvironmentVariable("SCALEAI_API_KEY") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("SCALEAI_API_KEY environment variable is not found.");

using var client = new ScaleAIClient(apiKey);

// Create tools for projects, tasks, and batch status.
var listProjectsTool = client.AsListProjectsTool();
var getProjectTool = client.AsGetProjectTool();
var listTasksTool = client.AsListTasksTool();
var getTaskTool = client.AsGetTaskTool();
var getBatchStatusTool = client.AsGetBatchStatusTool();

// These tools can be passed to any IChatClient that supports function calling.
var tools = new[] { listProjectsTool, getProjectTool, listTasksTool, getTaskTool, getBatchStatusTool };