Documentation
Table of Contents

Class GuardrailBuilderExtensions

Namespace
IntentSharp.Guardrails
Assembly
IntentSharp.Guardrails.dll

Makes a client from IntentClientBuilder check the rule files a document store holds:

var store = new FolderDocumentStore("policy");
using var client = new IntentClientBuilder()
    .UseProviderOptions(store)
    .WithDocumentStore(store)
    .WithGuardrailFiles(store, "orders-data")
    .Build();
public static class GuardrailBuilderExtensions
Inheritance
object
GuardrailBuilderExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

Methods

WithGuardrailFiles(IntentClientBuilder, IDocumentStore, Action<GuardrailSourceOptions>, params string[])

Makes the client check the rule files store holds: a DocumentGuardrailSource with the options configure sets becomes the client's guardrail source, with sets as the default sets, the kinds, subjects and settings the options declare, and their CodeSettings as the client's code layer (CodeSettings); the built-in schema kind, the YAML format and the RuleDocumentValidator are added to the client. The validator compares a raised client.* limit that no running version sets with this builder's IntentClientOptions value when the code settings do not set it, as the client applies it, a value set after this call included. Like WithGuardrails(GuardrailOptions), it is called once per builder, and Build() throws when a default set is not loaded.

WithGuardrailFiles(IntentClientBuilder, IDocumentStore, params string[])

Makes the client check the rule files store holds, applying sets when a check names none. See WithGuardrailFiles(IntentClientBuilder, IDocumentStore, Action<GuardrailSourceOptions>, params string[]).