Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
IMentorSessionManager interface
The IMentorSessionManager interface of the global namespace: Manages the Agent Framework AgentSession for the current session. In Blazor Server: Scoped (one…
On this page
Manages the Agent Framework AgentSession for the current session. In Blazor Server: Scoped (one session per circuit/user). In Blazor WASM: Singleton (one session per tab). AgentSession is the container for the Agent Framework conversation history: we do not manage messages manually — the session handles that internally.
Definition
Section titled “Definition”Namespace: none, the global namespace. Package: Novior.MentorAgent.
public interface IMentorSessionManager
dotnet add package Novior.MentorAgentMethods
Section titled “Methods”GetOrCreateSessionAsync
Section titled “GetOrCreateSessionAsync”Task<AgentSession> GetOrCreateSessionAsync(AIAgent agent, CancellationToken ct = default)
Returns the current session, creating it on first access.
ResetAsync
Section titled “ResetAsync”Task ResetAsync(AIAgent agent, CancellationToken ct = default)
Resets the current session (starts a new conversation).
RestoreSessionAsync
Section titled “RestoreSessionAsync”Task RestoreSessionAsync(AIAgent agent, JsonElement serialized, CancellationToken ct = default)
Restores a serialized session.
SerializeCurrentSessionAsync
Section titled “SerializeCurrentSessionAsync”Task<JsonElement?> SerializeCurrentSessionAsync(AIAgent agent)
Serializes the current session for persistence (e.g. WASM localStorage).
Events
Section titled “Events”OnSessionChanged
Section titled “OnSessionChanged”event Action? OnSessionChanged
Event: the session has changed (reset or restore).
