Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.
MentorActionBuilder class
The MentorActionBuilder class of Novior.MentorAgent.Options: What a registered action declares, as [MentorAction] would: given to the callback of…
On this page
What a registered action declares, as [MentorAction] would: given to the callback of MentorActionRegistrations.Add, MentorActionRegistrations.AddCommand and MentorActionRegistrations.AddQuery. Each call returns the builder, to write the next.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Options. Package: Novior.MentorAgent.
public sealed class MentorActionBuilder
dotnet add package Novior.MentorAgentMethods
Section titled “Methods”Category
Section titled “Category”public MentorActionBuilder Category(string category)
A free-form category, published as the skill's tag on the A2A agent card, as [MentorAction(Category = …)]. It does not change what the assistant sees or does.
Describe
Section titled “Describe”public MentorActionBuilder Describe(string description)
What the action does, in the words the model reads to decide when to call it. Required.
public MentorActionBuilder Hint(string guidance)
Guidance for the assistant about what to suggest before or after the action, appended to its description as "Guidance: …", as [MentorAction(ProactiveHint = …)].
public MentorActionBuilder Name(string name)
The name the model calls the action by, instead of the method's name, or the command's or the query's type's, in snake_case: letters, digits, _ and -, up to 64. Another name stops the registration.
NavigateTo
Section titled “NavigateTo”public MentorActionBuilder NavigateTo(string url)
The page MentorAgent opens after the action succeeds, when the user is on another one, as [MentorAction(NavigateTo = …)].
public MentorActionBuilder Off()
The action ships off, as [MentorAction(Enabled = false)]: it is in the catalogue and nowhere else, and a call to it does not run, until an IMentorActionGovernor turns it on.
ReadOnly
Section titled “ReadOnly”public MentorActionBuilder ReadOnly()
The action only reads: it changes no data. MentorAgent takes your word for it, as for [MentorAction(ReadOnly = true)]. Ignored when the action also asks for confirmation. A query is always read-only; a command cannot be.
RequireConfirmation
Section titled “RequireConfirmation”public MentorActionBuilder RequireConfirmation(bool required = true)
Whether the user confirms before the action runs, declared: true asks, false opts the action out. Not called, the action follows MentorOptions.RequireConfirmationForWrites, as a [MentorAction] that declares nothing: on by default, so an action that is not MentorActionBuilder.ReadOnly asks.
RequireRoles
Section titled “RequireRoles”public MentorActionBuilder RequireRoles(params string[] roles)
The roles allowed to run the action: a signed-in user who holds any one of them, checked with ClaimsPrincipal.IsInRole, as [MentorAction(RequiredRoles = …)]. A second call replaces the first.
