Constructor LMFunctionAttribute
LMFunctionAttribute(string, string)
Creates a new LMFunctionAttribute.
public LMFunctionAttribute(string name, string description)
Parameters
namestringThe stable identifier for the function (recommended: lowercase snake_case). Leading/trailing quotes and dots are trimmed.
descriptionstringA short, imperative summary of what the function does (≈200 chars or fewer recommended). Leading/trailing quotes and dots are trimmed.
Examples
public sealed class WeatherService
{
[LMFunction("get_weather", "Get current weather for a location.")]
public string GetWeather(string location, bool includeForecast = false)
{
// ...
}
}
Exceptions
- ArgumentNullException
Thrown when
nameordescriptionis null, empty, or whitespace.