C# Re-implementation (#5)

Re-implementation of C# interceptors SDK with clearer focus on
server-side / gateway interceptors.
Fixes a lot of issues with the existing implementation.
Still more boilerplate than I'm happy with, but this is better than what
was there. Will refine further in later PRs.
This commit is contained in:
Peder Holdgaard Pedersen 2026-05-14 15:11:41 +02:00 • committed by GitHub
commit d01a626b76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,36 @@
namespace AvatarMoodInterceptorSample;
public enum Mood
{
Neutral,
Happy,
Curious,
Focused,
Confused,
Frustrated,
}
public sealed class AvatarState
{
private readonly object _lock = new();
private readonly List<Mood> _history = [];
public Mood Current { get; private set; } = Mood.Neutral;
public float Confidence { get; private set; }
public string? ClassifierModel { get; private set; }
public IReadOnlyList<Mood> History
{
get { lock (_lock) { return _history.ToArray(); } }
}
public void Update(Mood mood, float confidence, string? classifierModel)
{
lock (_lock)
{
Current = mood;
Confidence = confidence;
ClassifierModel = classifierModel;
_history.Add(mood);
}
}
}