Method WithModel
WithModel(LM)
Sets the language model for the agent.
public AgentBuilder WithModel(LM model)
Parameters
modelLMThe 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
modelis null.