MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

ChatWidget class

The ChatWidget class of Novior.MentorAgent.Abstractions.Components. Part of the Novior.MentorAgent.Abstractions package.

View as Markdown
On this page

Namespace: Novior.MentorAgent.Abstractions.Components. Package: Novior.MentorAgent.Abstractions.

public class ChatWidget : ComponentBase, IDisposable

Terminal
dotnet add package Novior.MentorAgent.Abstractions

public ChatWidget()

public RenderFragment<MentorCard>? CardTemplate { get; set; }

Optional custom renderer for generative cards (#14 L2). When set it replaces MentorCardView for every card, so switch on card.Kind inside it and fall back to <MentorCardView /> for the kinds you do not handle:

Example
<ChatWidget>
    <CardTemplate Context="card">
        @if (card.Kind == "order") { <OrderCard Card="card" /> }
        else                       { <MentorCardView Card="card" /> }
    </CardTemplate>
</ChatWidget>

public MentorLanguage? Language { get; set; }

The language of this widget, for this page: its texts, the voice, the tour, and every turn it sends, which the assistant answers in. null (the default) means MentorOptions.Language. Bind it to the page's language and the widget follows a change at once, keeping the conversation:

Example
<ChatWidget Language="@_language" />

public void Dispose()