Class DefaultIntentDocumentValidator
- Namespace
- IntentSharp.Documents
- Assembly
- IntentSharp.dll
Checks a proposed version of a default intent document, such as the target runtime's plan intent at
defaults/intentsharp.target.plan.json: the intents the library runs itself, which a developer or a model may
replace in the document store. A version that does not load is refused before it is stored; a change to the
document's output rules is reported in Changes. Every client registers one, so an edit of a
default intent passes the same checks as any other edit.
public sealed class DefaultIntentDocumentValidator : IDocumentValidator
- Inheritance
-
objectDefaultIntentDocumentValidator
- Implements
- Inherited Members
-
object.Equals(object)object.Equals(object, object)object.GetHashCode()object.GetType()object.ReferenceEquals(object, object)object.ToString()
- Extension Methods
Remarks
A default intent document is JSON with these keys: intentsharp (exactly intent-default/1),
name (the document's file name without .json), intent (required), instructions and
outputRequirements (optional text), outputSchema (required: a JSON Schema object, or
@commandPlan for the target runtime's plan), rules (optional output rules in an intent file's
rules vocabulary, plus deny), attempts and maxOutputTokens (optional whole numbers of 1
or more). An unknown key, or one written twice, does not load.
The validator never reports a widening of security: an output rule of a default intent checks the model's reply, not access to anything. Safe to share between threads.
Constructors
- DefaultIntentDocumentValidator()
Creates the validator.
Methods
- AssessAsync(DocumentId, string?, string, CancellationToken)
Loads
proposedas a default intent document and compares its output rules withcurrent's. A proposed text that does not load gives an impact that does not load cleanly, with one problem per mistake and its line; one that loads gives one change per output rule that differs, namedrules.<path>(for examplerules.properties.explanation.maxLength) with the rule's value before and after.
- Handles(DocumentId)
True for a JSON document under
defaults/, such asdefaults/intentsharp.target.plan.json.