Table of Contents

Method WithSkills

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

WithSkills(SkillRegistry)

Sets the skill registry for the agent.

public AgentBuilder WithSkills(SkillRegistry skills)

Parameters

skills SkillRegistry

The skill registry containing available skills.

Returns

AgentBuilder

This builder instance for method chaining.

Examples

Using a skill registry:

using LMKit.Model;
using LMKit.Agents;
using LMKit.Agents.Skills;

// Pre-load skills
var skills = new SkillRegistry();
skills.LoadFromDirectory("./skills");

using var model = new LM("path/to/model.gguf");

var agent = new AgentBuilder()
    .WithModel(model)
    .WithSkills(skills)
    .Build();

Remarks

Skills are modular instruction packages that can be activated based on context. Use this overload with a pre-configured registry.

WithSkills(Action<SkillRegistry>)

Configures skills using a setup action.

public AgentBuilder WithSkills(Action<SkillRegistry> configure)

Parameters

configure Action<SkillRegistry>

An action to configure the skill registry.

Returns

AgentBuilder

This builder instance for method chaining.

Examples

Configuring skills inline:

using LMKit.Model;
using LMKit.Agents;
using LMKit.Agents.Skills;

using var model = new LM("path/to/model.gguf");

var agent = new AgentBuilder()
    .WithModel(model)
    .WithPersona("Versatile Assistant")
    .WithSkills(skills =>
    {
        // Load skills from various sources
        skills.LoadFromDirectory("./skills/general");
        skills.LoadFromDirectory("./skills/specialized");
    })
    .Build();

Remarks

Creates a new skill registry if one hasn't been set. The action receives the registry for inline configuration.

Exceptions

ArgumentNullException

Thrown when configure is null.