Method FromType
FromType(Type)
Creates ITool instances from all LMFunctionAttribute methods on the specified type.
public static List<ITool> FromType(Type type)
Parameters
typeTypeType to instantiate and inspect. Must have a public parameterless constructor.
Returns
Exceptions
- ArgumentNullException
Thrown if
typeisnull.- MissingMethodException
Thrown if
typelacks 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
TA type with a public parameterless constructor and annotated instance methods.
Exceptions
- ArgumentException
Thrown if a parameter type is not supported for tool arguments.