Updated and supported automatically if there are no breaking changes
All modern .NET features - nullability, trimming, NativeAOT, etc.
Support .Net Framework/.Net Standard 2.0
MEAI (Microsoft.Extensions.AI) AIFunction tools for use with any IChatClient
Usage
1 2 3 4 5 6 7 8 9101112131415161718
usingLabelStudio;// Label Studio uses Token-based authusingvarclient=newLabelStudioClient(apiKey);// List projectsvarprojects=awaitclient.Projects2.ListAsync();// Get project detailsvarproject=awaitclient.Projects2.GetAsync(id:1);// List tasks in a projectvartasks=awaitclient.Tasks2.List2Async(project:1);// Create an annotationvarannotation=awaitclient.Annotations2.CreateAsync(id:1,// task IDresult:newList<object>());
MEAI Tools
1 2 3 4 5 6 7 8 910111213
usingLabelStudio;usingMicrosoft.Extensions.AI;usingvarclient=newLabelStudioClient(apiKey);// Create AIFunction tools for use with any IChatClientvartools=newAITool[]{client.AsListProjectsTool(),client.AsGetProjectTool(),client.AsListTasksTool(),client.AsCreateAnnotationTool(),};
MEAI Tools
Shows how to use Label Studio operations as AIFunction tools with any IChatClient.
1 2 3 4 5 6 7 8 9101112131415161718192021
varclient=Client;// Create AIFunction tools for use with any IChatClient.varlistProjectsTool=client.AsListProjectsTool();vargetProjectTool=client.AsGetProjectTool();varlistTasksTool=client.AsListTasksTool();varcreateAnnotationTool=client.AsCreateAnnotationTool();// All tools should be valid AIFunction instances.// Tools can be added to ChatOptions for use with any IChatClient.varoptions=newChatOptions{Tools=[ listProjectsTool, getProjectTool, listTasksTool, createAnnotationTool, ],};