This example assumes using ScaleAI; is in scope and apiKey contains your ScaleAI API key.
1 2 3 4 5 6 7 8 910111213141516
varapiKey=Environment.GetEnvironmentVariable("SCALEAI_API_KEY")is{Length:>0}value?value:thrownewAssertInconclusiveException("SCALEAI_API_KEY environment variable is not found.");usingvarclient=newScaleAIClient(apiKey);// Create tools for projects, tasks, and batch status.varlistProjectsTool=client.AsListProjectsTool();vargetProjectTool=client.AsGetProjectTool();varlistTasksTool=client.AsListTasksTool();vargetTaskTool=client.AsGetTaskTool();vargetBatchStatusTool=client.AsGetBatchStatusTool();// These tools can be passed to any IChatClient that supports function calling.vartools=new[]{listProjectsTool,getProjectTool,listTasksTool,getTaskTool,getBatchStatusTool};