MentorAgent Docs
Menu

Questa pagina non è ancora tradotta in italiano: qui la trovi in inglese.

ReferencePackage: Novior.MentorAgent

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.

Namespace: Novior.MentorAgent.Options. Package: Novior.MentorAgent.

public sealed class MentorActionBuilder

Terminal
dotnet add package Novior.MentorAgent

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.

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.

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.

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.

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.

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.