| | | 1 | | using Intentum.Runtime.Policy; |
| | | 2 | | |
| | | 3 | | namespace Intentum.Explainability; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Root of an intent decision tree: the final policy decision and matched rule. |
| | | 7 | | /// </summary> |
| | | 8 | | /// <param name="Decision">Policy decision for the intent.</param> |
| | | 9 | | /// <param name="MatchedRuleName">Name of the rule that matched, or null if default (Observe).</param> |
| | | 10 | | /// <param name="Intent">Summary of the inferred intent (name, confidence).</param> |
| | | 11 | | /// <param name="Signals">Contributing signals (behavior dimensions / intent signals).</param> |
| | | 12 | | /// <param name="BehaviorSummary">Optional summary of behavior events that led to the intent (e.g. from metadata).</para |
| | | 13 | | public sealed record IntentDecisionTree( |
| | | 14 | | PolicyDecision Decision, |
| | | 15 | | string? MatchedRuleName, |
| | | 16 | | IntentTreeIntentSummary Intent, |
| | | 17 | | IReadOnlyList<IntentTreeSignalNode> Signals, |
| | | 18 | | string? BehaviorSummary = null); |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Summary of the inferred intent for the tree (name and confidence). |
| | | 22 | | /// </summary> |
| | 4 | 23 | | public sealed record IntentTreeIntentSummary( |
| | 1 | 24 | | string Name, |
| | 1 | 25 | | string ConfidenceLevel, |
| | 5 | 26 | | double ConfidenceScore); |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// A signal node in the intent tree (source, description, weight). |
| | | 30 | | /// </summary> |
| | | 31 | | public sealed record IntentTreeSignalNode( |
| | | 32 | | string Source, |
| | | 33 | | string Description, |
| | | 34 | | double Weight); |