ChatWidget class
The ChatWidget class of Novior.MentorAgent.Abstractions.Components. Part of the Novior.MentorAgent.Abstractions package.
On this page
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Abstractions.Components. Package: Novior.MentorAgent.Abstractions.
public class ChatWidget : ComponentBase, IDisposable
dotnet add package Novior.MentorAgent.AbstractionsConstructors
Section titled “Constructors”public ChatWidget()
Properties
Section titled “Properties”CardTemplate
Section titled “CardTemplate”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:
<ChatWidget>
<CardTemplate Context="card">
@if (card.Kind == "order") { <OrderCard Card="card" /> }
else { <MentorCardView Card="card" /> }
</CardTemplate>
</ChatWidget>Language
Section titled “Language”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:
<ChatWidget Language="@_language" />Methods
Section titled “Methods”Dispose
Section titled “Dispose”public void Dispose()
