MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Declarative

MentorDeclarativeOptions class

The MentorDeclarativeOptions class of Novior.MentorAgent.Declarative: Where AddMentorAgentDeclarative() looks for YAML agent definitions.

View as Markdown
On this page

Where AddMentorAgentDeclarative() looks for YAML agent definitions.

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

public sealed class MentorDeclarativeOptions

Terminal
dotnet add package Novior.MentorAgent.Declarative

public MentorDeclarativeOptions()

public string? ConfigurationSection { get; set; }

Name of the configuration section whose values the YAML may reference. Default: null — no configuration is exposed.

Do not be tempted to widen this. The Agent Framework's factory loads the configuration you give it into the Power Fx engine as variables, one per key, in its constructor. Every key therefore has to be a valid Power Fx identifier, and a single one that is not takes the whole factory down before a single definition is read — this was found the hard way, with a key named ${name} that came from an unrelated configuration provider and produced ArgumentException: Invalid name: ${name}. Naming one section bounds the blast radius to keys you control.

Example
o.ConfigurationSection = "AgentSettings";   // only AgentSettings:* reaches the YAML

public IList<string> Definitions { get; }

YAML definitions supplied directly, for agents that come from a database, a configuration service or a test. Loaded in addition to MentorDeclarativeOptions.Directory.

public string? Directory { get; set; }

Directory to scan, relative to the application's base directory or absolute.

This is a deploy-time path. A definition file chooses the model, writes the system instructions and names the tools the agent may call — it is code, not configuration. Point this at a folder that ships with the application; never at an upload folder, a user profile directory, or anything assembled from request input.

public bool Recursive { get; set; }

Scan subdirectories as well. Default: false.

public string SearchPattern { get; set; }

File pattern inside MentorDeclarativeOptions.Directory. Default: *.agent.yaml.