| | | 1 | | using Intentum.Core.Behavior; |
| | | 2 | | using Intentum.Core.Extensions; |
| | | 3 | | using Intentum.Core.Intents; |
| | | 4 | | |
| | | 5 | | namespace Intentum.Core.Contracts; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Adapter interface for LLM/ML intent inference models. |
| | | 9 | | /// </summary> |
| | | 10 | | public interface IIntentModel |
| | | 11 | | { |
| | | 12 | | /// <summary>Infers intent and confidence from the observed behavior space. Pass a pre-computed vector to avoid reco |
| | | 13 | | /// <param name="behaviorSpace">The observed behavior space.</param> |
| | | 14 | | /// <param name="precomputedVector">Optional pre-computed behavior vector (e.g. from persistence); when null, comput |
| | | 15 | | Intent Infer(BehaviorSpace behaviorSpace, BehaviorVector? precomputedVector = null); |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public static class IntentModelExtensions |
| | | 19 | | { |
| | | 20 | | public static Intent InferWithValidation(this IIntentModel model, BehaviorSpace behaviorSpace, BehaviorVector? preco |
| | 3 | 21 | | { |
| | 3 | 22 | | ArgumentNullException.ThrowIfNull(model); |
| | 3 | 23 | | behaviorSpace.EnsureNotEmpty(); |
| | 1 | 24 | | return model.Infer(behaviorSpace, precomputedVector); |
| | 1 | 25 | | } |
| | | 26 | | } |