Class SingleFunctionCall
- Namespace
- LMKit.FunctionCalling
- Assembly
- LM-Kit.NET.dll
The SingleFunctionCall
class provides an interface to execute a single method
based on a natural language prompt, leveraging language model inference for function selection
and parameter extraction. It supports dynamic method invocation, function registration,
and parameter validation.
public class SingleFunctionCall : IDisposable
- Inheritance
-
SingleFunctionCall
- Implements
- Inherited Members
Constructors
- SingleFunctionCall(LLM)
Initializes a new instance of the
SingleFunctionCall
class with the specified language model.
Properties
- InvokeFunctions
Gets or sets a value indicating whether the registered functions should be invoked automatically. The default value is
true
.
Methods
- ImportFunctions(object)
Registers all methods in the specified object instance that are marked with the LMFunctionAttribute.
- ImportFunctions<T>()
Registers all methods in the specified type
T
that are marked with the LMFunctionAttribute.
- Submit(string, CancellationToken)
Synchronously submits a natural language prompt and returns the result of the function invocation.
- SubmitAsync(string, CancellationToken)
Asynchronously submits a natural language prompt and returns the result of the function invocation.
Events
- BeforeMethodInvoke
Occurs before the invocation of an identified method, allowing subscribers to cancel the invocation.