< Summary

Information
Class: Intentum.AI.Models.LlmIntentModel
Assembly: Intentum.AI
File(s): /home/runner/work/Intentum/Intentum/src/Intentum.AI/Models/LlmIntentModel.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 35
Line coverage: 100%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)50%44100%
Infer(...)100%11100%

File(s)

/home/runner/work/Intentum/Intentum/src/Intentum.AI/Models/LlmIntentModel.cs

#LineLine coverage
 1using Intentum.AI.Embeddings;
 2using Intentum.AI.Similarity;
 3using Intentum.Core.Behavior;
 4using Intentum.Core.Contracts;
 5using Intentum.Core.Intents;
 6using Intentum.Core.Pipeline;
 7
 8namespace Intentum.AI.Models;
 9
 10/// <summary>
 11/// AI-assisted intent inference using embeddings and similarity scoring.
 12/// Uses the resolution pipeline internally (signal → vector → LLM inference → confidence).
 13/// Uses dimension counts as weights when the engine supports it; uses time decay when the engine implements ITimeAwareS
 14/// </summary>
 15public sealed class LlmIntentModel : IIntentModel
 16{
 17    private readonly IntentResolutionPipeline _pipeline;
 18
 19    /// <summary>
 20    /// Creates an LLM intent model with the given embedding provider and similarity engine.
 21    /// </summary>
 7322    public LlmIntentModel(
 7323        IIntentEmbeddingProvider embeddingProvider,
 7324        IIntentSimilarityEngine similarityEngine)
 7325    {
 7326        var step = new LlmInferenceStep(
 7327            embeddingProvider ?? throw new ArgumentNullException(nameof(embeddingProvider)),
 7328            similarityEngine ?? throw new ArgumentNullException(nameof(similarityEngine)));
 7329        _pipeline = new IntentResolutionPipeline(step);
 7330    }
 31
 32    /// <inheritdoc />
 33    public Intent Infer(BehaviorSpace behaviorSpace, BehaviorVector? precomputedVector = null)
 9734        => _pipeline.Infer(behaviorSpace, precomputedVector);
 35}