Table of Contents

Constructor AgentIdentity

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

AgentIdentity(string, string)

Initializes a new instance of the AgentIdentity class with the specified persona and instruction.

public AgentIdentity(string persona, string instruction)

Parameters

persona string

The persona defining the agent's role and style. Can be null or empty if not needed.

instruction string

The base instruction guiding agent behavior. Can be null or empty if not needed.

Examples

Creating a complete identity:

using LMKit.Model;
using LMKit.Agents;

var identity = new AgentIdentity(
    persona: "Senior .NET Developer",
    instruction: "Help users write clean, efficient C# code. " +
                 "Follow Microsoft coding conventions. " +
                 "Explain your reasoning when suggesting changes."
);

using var model = new LM("path/to/model.gguf");
var agent = new Agent(identity, model);

var result = agent.Run("How do I implement the repository pattern?");
Console.WriteLine(result.Content);

AgentIdentity(string)

Initializes a new instance of the AgentIdentity class with only a persona.

public AgentIdentity(string persona)

Parameters

persona string

The persona defining the agent's role and style.

Examples

Creating a persona-only identity:

using LMKit.Agents;

// Persona alone can guide behavior for simple cases
var identity = new AgentIdentity("Friendly Chatbot");

Console.WriteLine(identity.HasPersona);     // True
Console.WriteLine(identity.HasInstruction); // False

Remarks

Use this constructor when the persona alone is sufficient to define the agent's behavior, or when instructions will be provided at runtime.