This example assumes using Nixtla; is in scope and apiKey contains your Nixtla API key.
1 2 3 4 5 6 7 8 91011121314
varapiKey=Environment.GetEnvironmentVariable("NIXTLA_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("NIXTLA_API_KEY environment variable is not found.");usingvarclient=newNixtlaClient(apiKey);// Create tools for forecasting, anomaly detection, and model listing.varforecastTool=client.AsForecastTool();varanomalyDetectionTool=client.AsAnomalyDetectionTool();varlistModelsTool=client.AsListModelsTool();// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{forecastTool,anomalyDetectionTool,listModelsTool};