Skip to content

MeaiTools

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

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

using var client = new NixtlaClient(apiKey);

// Create tools for forecasting, anomaly detection, and model listing.
var forecastTool = client.AsForecastTool();
var anomalyDetectionTool = client.AsAnomalyDetectionTool();
var listModelsTool = client.AsListModelsTool();

// These tools can be passed to any IChatClient that supports function calling.
var tools = new[] { forecastTool, anomalyDetectionTool, listModelsTool };