Method FromType
FromType(Type)
Creates ITool instances from all LMFunctionAttribute methods on the specified type
.
public static List<ITool> FromType(Type type)
Parameters
type
TypeType to instantiate and inspect. Must have a public parameterless constructor.
Returns
Exceptions
- ArgumentNullException
Thrown if
type
isnull
.- 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
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.