Table of Contents

Constructor LMFunctionAttribute

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

LMFunctionAttribute(string, string)

Creates a new LMFunctionAttribute with the specified name and description.

public LMFunctionAttribute(string name, string description)

Parameters

name string

The stable identifier for the tool. Recommended: lowercase snake_case. Leading/trailing quotes and dots are automatically trimmed.

description string

A short, imperative summary of what the tool does (under 200 characters recommended). Leading/trailing quotes and dots are automatically trimmed.

Examples

Example: Applying the attribute

public class WeatherService
{
    [LMFunction("get_weather", "Get current weather conditions for a location")]
    public string GetWeather(string location, bool includeForecast = false)
    {
        // Implementation...
    }

    [LMFunction("get_forecast", "Get weather forecast for the next several days")]
    public string GetForecast(string location, int days = 5)
    {
        // Implementation...
    }
}

Exceptions

ArgumentNullException

Thrown when name or description is null, empty, or consists only of whitespace.