MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

IMentorAssistantStatus interface

The IMentorAssistantStatus interface of Novior.MentorAgent.Abstractions.Interfaces: Whether the application's assistant is on: the chat widget reads it, and…

View as Markdown
On this page

Whether the application's assistant is on: the chat widget reads it, and while it is off the input and the send button are disabled and a sentence says the assistant was turned off, before anyone writes. An application that turns its assistant off from somewhere else — a console, a switch of its own — registers one; without one the assistant is on.

Namespace: Novior.MentorAgent.Abstractions.Interfaces. Package: Novior.MentorAgent.Abstractions.

public interface IMentorAssistantStatus

Terminal
dotnet add package Novior.MentorAgent.Abstractions

Only on or off: no reason, no author. Off means that the switch refuses the requests to the model, not that a budget is used up: MentorAgent does not refuse them because of this service.

IMentorAssistantStatus.Changed is raised only when IMentorAssistantStatus.IsOn changes, with the service as the sender and EventArgs.Empty, and may be raised on a background thread: a Blazor component re-renders through InvokeAsync(StateHasChanged). A handler reads IMentorAssistantStatus.IsOn again and returns at once; one that throws must not stop the service or the other handlers.

Register it as a singleton.

bool IsOn { get; }

Whether the assistant is on. true unless the application turned it off.

event EventHandler? Changed

Raised when IMentorAssistantStatus.IsOn changes, possibly on a background thread.