Table of Contents

Method FromType

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

FromType(Type)

Creates ITool instances from all LMFunctionAttribute methods on the specified type.

public static List<ITool> FromType(Type type)

Parameters

type Type

Type to instantiate and inspect. Must have a public parameterless constructor.

Returns

List<ITool>

A list of ITool adapters discovered on the created instance.

Exceptions

ArgumentNullException

Thrown if type is null.

MissingMethodException

Thrown if type lacks a public parameterless constructor.

TargetInvocationException

Thrown if the constructor throws.

ArgumentException

Thrown if a parameter type is not supported for tool arguments.

FromType<T>()

Creates ITool instances from all LMFunctionAttribute methods on T.

public static List<ITool> FromType<T>() where T : new()

Returns

List<ITool>

A list of ITool adapters discovered on the created instance.

Type Parameters

T

A type with a public parameterless constructor and annotated instance methods.

Exceptions

ArgumentException

Thrown if a parameter type is not supported for tool arguments.