- Fully generated C# SDK based on official Guardrails AI OpenAPI specification using AutoSDK
- Same day update to support new features
- Updated and supported automatically if there are no breaking changes
- All modern .NET features - nullability, trimming, NativeAOT, etc.
- MEAI
AIFunctiontools for use with anyIChatClient
usingGuardrails;// Connect to a self-hosted Guardrails server (default: http://localhost:8000)usingvarclient=newGuardrailsClient(apiKey);// Or specify a custom base URLusingvarclient=newGuardrailsClient(apiKey,baseUri:newUri("https://my-guardrails-server.example.com"));varresult=awaitclient.Validate.ValidateAsync(guardName:"my-guard",llmOutput:"Some LLM output to validate");Console.WriteLine($"Validation passed: {result.ValidationPassed}");varguards=awaitclient.Guard.GetGuardsAsync();foreach(varguardinguards){Console.WriteLine($"Guard: {guard.Name} ({guard.Id})");}usingMicrosoft.Extensions.AI;// Use Guardrails as tools with any IChatClientvartools=new[]{client.AsValidateTool(),client.AsListGuardsTool(),client.AsGetGuardTool(),};varchatOptions=newChatOptions{Tools=[..tools]};Priority place for bugs: https://github.com/tryAGI/Guardrails/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Guardrails/discussions
Discord: https://discord.gg/Ca2xhfBf3v
This project is supported by JetBrains through the Open Source Support Program.
