Table of Contents

Method WithModel

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

WithModel(LM)

Sets the language model for the agent.

public AgentBuilder WithModel(LM model)

Parameters

model LM

The language model to use for inference.

Returns

AgentBuilder

This builder instance for method chaining.

Examples

Setting the model:

using LMKit.Model;
using LMKit.Agents;

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

var agent = new AgentBuilder()
    .WithModel(model)
    .WithPersona("Assistant")
    .Build();

Remarks

The model is required for agent execution. This should typically be the first configuration step after creating the builder.

Exceptions

ArgumentNullException

Thrown when model is null.