MentorAgent Docs
Menu

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

ReferencePackage: Novior.MentorAgent.Declarative

Declarative.ServiceCollectionExtensions

The ServiceCollectionExtensions class of Novior.MentorAgent.Declarative: Registers YAML-defined Level-2 specialists (roadmap #23).

On this page

Registers YAML-defined Level-2 specialists (roadmap #23).

Namespace: Novior.MentorAgent.Declarative. Package: Novior.MentorAgent.Declarative.

public static class ServiceCollectionExtensions

Terminal
dotnet add package Novior.MentorAgent.Declarative

public static IServiceCollection AddMentorAgentDeclarative(this IServiceCollection services, Action<MentorDeclarativeOptions> configure)

Loads agent definitions from YAML and adds them to MentorAgent's handoff graph, alongside the ones declared with [MentorAgent].

Example
builder.Services.AddMentorAgentDeclarative(o => o.Directory = "Agents");
builder.Services.AddMentorAgent(o => { /* … */ });   // order does not matter

A definition looks like this — note that toolsnames tools, it does not define them; each name must match a tool your application already exposes:

Example
kind: Prompt
name: ShippingAgent
description: Answers questions about deliveries and shipping costs
instructions: |
  You handle shipping questions only. Use the available tools to look up real orders;
  never invent a tracking number. If the question is not about shipping, say so.
model:
  options:
    temperature: 0.2
tools:
  - kind: function          # required on every entry; `function` is the only kind kept
    name: get_order_status
  - kind: function
    name: get_all_orders

Treat definition files as code. They choose the model, write the system instructions and name the callable tools, so load them only from a location that ships with the application. What they cannot do is grant themselves anything new: a named tool is resolved from the ones already registered and arrives already wrapped in MentorAgent's gate, keeping RequiredRoles and human approval in force. The provider-hosted kinds the Agent Framework also reads (webSearch, codeInterpreter, fileSearch, mcp) are removed with a warning: those capabilities are the host's to configure.