Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
MentorAgentBlazorOptions class
Configuration for AddMentorAgentBlazor(). Provides UI settings for the chat widget and the SignalR hub URL.
On this page
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Blazor.Models. Package: Novior.MentorAgent.Blazor.
public sealed class MentorAgentBlazorOptions
dotnet add package Novior.MentorAgent.BlazorConstructors
Section titled “Constructors”public MentorAgentBlazorOptions()
Properties
Section titled “Properties”AccessTokenProvider
Section titled “AccessTokenProvider”public Func<Task<string?>>? AccessTokenProvider { get; set; }
Supplies the bearer token for the hub connection, called on every connect and reconnect. Without this the hub sees an anonymous caller, whatever your application has signed the user in as — which means every RequiredRoles action is blocked and the user is keyed as anonymous: with the server's AnonymousIdentity = PerSession, the default, memory and RateLimitPerUser last only as long as the connection; with Shared every user shares the single memory key "anonymous" and one global limit. This is the WASM equivalent of the JavaScript client's accessTokenFactory, and the server reads the resulting principal off HubCallerContext.User. Return null while nobody is signed in; the connection then behaves exactly as it did before a provider was set.
builder.Services.AddSingleton<TokenStore>();
builder.Services.AddMentorAgentBlazor(options =>
{
options.HubUrl = "https://api.example.com/mentor-hub";
options.AccessTokenProvider = () => Task.FromResult(tokenStore.Token);
});AiDisclosureMessage
Section titled “AiDisclosureMessage”public string? AiDisclosureMessage { get; set; }
The notice's text, shown as written. If null, uses the localized default in MentorAgentBlazorOptions.Language.
AllowedImageTypes
Section titled “AllowedImageTypes”public List<string> AllowedImageTypes { get; set; }
Client-side MIME allow-list for attachments.
AvatarUrl
Section titled “AvatarUrl”public string? AvatarUrl { get; set; }
Custom avatar URL.
BotName
Section titled “BotName”public string BotName { get; set; }
Bot name shown in the widget header.
ConfigureConnection
Section titled “ConfigureConnection”public Action<HttpConnectionOptions>? ConfigureConnection { get; set; }
Escape hatch applied to the hub's HttpConnectionOptions after MentorAgentBlazorOptions.AccessTokenProvider — custom headers, a transport restriction, cookies, UseDefaultCredentials. Use it for anything the options above do not name.
options.ConfigureConnection = o => o.Headers["X-Tenant"] = tenantId;EnableImageInput
Section titled “EnableImageInput”public bool EnableImageInput { get; set; }
Show the image-attachment button and enable paste / drag-and-drop / URL input (roadmap #13). Must also be enabled server-side (MentorOptions.EnableImageInput), which is where attachments are actually validated.
EnableOnboardingTour
Section titled “EnableOnboardingTour”public bool EnableOnboardingTour { get; set; }
Show the guided tour on first run (roadmap #18). Default: false.
EnableSuggestions
Section titled “EnableSuggestions”public bool EnableSuggestions { get; set; }
Show suggestion chips in the welcome panel.
EnableVoiceInput
Section titled “EnableVoiceInput”public bool EnableVoiceInput { get; set; }
Show microphone button for voice input.
EnableVoiceOutput
Section titled “EnableVoiceOutput”public bool EnableVoiceOutput { get; set; }
Enable text-to-speech for AI responses.
HasMcpServers
Section titled “HasMcpServers”public bool HasMcpServers { get; set; }
Whether the server has MCP servers configured (enables the MCP badge).
HasRemoteAgents
Section titled “HasRemoteAgents”public bool HasRemoteAgents { get; set; }
Whether the server has remote A2A agents configured (enables the A2A badge).
HostedTools
Section titled “HostedTools”public MentorHostedTools HostedTools { get; set; }
Hosted tools active on the server (roadmap #15), used to fill the badge. Mirror whatever MentorOptions.HostedTools is set to on the Novior.MentorAgent.Server project.
HubUrl
Section titled “HubUrl”public string HubUrl { get; set; }
URL of the Novior.MentorAgent.Server SignalR hub. Default: "/mentor-hub". A relative URL is resolved against the page's base address, as a browser does ("/mentor-hub" against the origin, "mentor-hub" under the app's base path): use it when the server also serves the client. For a server on another origin, set its absolute URL.
InputPlaceholder
Section titled “InputPlaceholder”public string? InputPlaceholder { get; set; }
Input box placeholder text. If null, uses the localized default in MentorAgentBlazorOptions.Language.
Language
Section titled “Language”public MentorLanguage Language { get; set; }
Language for widget UI strings.
MaxImageBytes
Section titled “MaxImageBytes”public int MaxImageBytes { get; set; }
Client-side size cap per image, in bytes. Default: 4 MB.
MaxImagesPerMessage
Section titled “MaxImagesPerMessage”public int MaxImagesPerMessage { get; set; }
Client-side cap on images per message. Default: 4.
McpServerNames
Section titled “McpServerNames”public List<string> McpServerNames { get; set; }
Names of MCP client servers configured on the server. Used to pre-populate the MCP status badge.
Position
Section titled “Position”public ChatPosition Position { get; set; }
Widget position on screen.
PrimaryColor
Section titled “PrimaryColor”public string? PrimaryColor { get; set; }
Custom accent color (hex, e.g. "#7c3aed").
RemoteAgentDisplays
Section titled “RemoteAgentDisplays”public List<AgentDisplayInfo> RemoteAgentDisplays { get; set; }
Remote A2A agents to display in the A2A badge and detail bar.
ShowA2AStatus
Section titled “ShowA2AStatus”public bool ShowA2AStatus { get; set; }
Show A2A remote agent status badge in the widget header.
ShowAiDisclosure
Section titled “ShowAiDisclosure”public bool ShowAiDisclosure { get; set; }
Shows, under the header, the notice that tells people they are talking to an AI assistant, for the whole conversation. Default: true. The marker on each reply (data-ai-generated) stays either way.
ShowHostedToolsStatus
Section titled “ShowHostedToolsStatus”public bool ShowHostedToolsStatus { get; set; }
Show the provider-hosted tools badge in the widget header (roadmap #15). Purely informational — the tools themselves are configured and executed server-side.
ShowMcpStatus
Section titled “ShowMcpStatus”public bool ShowMcpStatus { get; set; }
Show MCP server connection status badge in the widget header.
ShowRagSources
Section titled “ShowRagSources”public bool ShowRagSources { get; set; }
Show RAG source citations below AI responses.
public MentorTheme Theme { get; set; }
Visual theme.
TourUrl
Section titled “TourUrl”public string TourUrl { get; set; }
Where to fetch the tour steps from (roadmap #18). Default: /mentor/tour.
A relative value is resolved against MentorAgentBlazorOptions.HubUrl's origin when that is absolute, because the tour is served by the same server as the hub — resolving it against the client app's own address instead would request it from a host that does not have it. Set an absolute URL here to override that entirely.
VoiceBargeIn
Section titled “VoiceBargeIn”public bool VoiceBargeIn { get; set; }
Stop playback when the user presses the microphone or sends a message (roadmap #17). Default: true.
VoiceHandsFree
Section titled “VoiceHandsFree”public bool VoiceHandsFree { get; set; }
Hands-free loop — send on silence, reopen the microphone after the answer (roadmap #17). Default: false.
VoiceRate
Section titled “VoiceRate”public double VoiceRate { get; set; }
Speech rate for SpeechSynthesisUtterance (0.5–2.0). Default: 1.0.
VoiceStreaming
Section titled “VoiceStreaming”public bool VoiceStreaming { get; set; }
Speak each sentence as it streams instead of reading the answer back (roadmap #17). Default: true.
WelcomeMessage
Section titled “WelcomeMessage”public string? WelcomeMessage { get; set; }
Welcome message shown when the chat is empty.
