Table of Contents

Property Tools

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

Tools

Registry of model-callable tools available to this conversation.

Register tools before the first user turn so they are advertised to the model. Tool invocation requires a model that supports tool calls (HasToolCalls).

Important: Grammar-constrained generation and tool-calls are mutually exclusive. If any tool is registered and Grammar is non-null, submission throws InvalidOperationException.

Example:
if (conversation.Model.HasToolCalls)
{
    conversation.Tools.Register(new WebSearchTool());
    conversation.ToolPolicy.Choice = ToolChoice.Auto;
}
else
{
    conversation.ToolPolicy.Choice = ToolChoice.None; // avoid tool-call attempts
}
public ToolRegistry Tools { get; }

Property Value

ToolRegistry