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
-
objectGuardrailBuilderExtensions
- 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
storeholds: a DocumentGuardrailSource with the optionsconfiguresets becomes the client's guardrail source, withsetsas the default sets, the kinds, subjects and settings the options declare, and their CodeSettings as the client's code layer (CodeSettings); the built-inschemakind, the YAML format and the RuleDocumentValidator are added to the client. The validator compares a raisedclient.*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
storeholds, applyingsetswhen a check names none. See WithGuardrailFiles(IntentClientBuilder, IDocumentStore, Action<GuardrailSourceOptions>, params string[]).