Class FunctionDefinition
Represents a function that can be called by AI
public class FunctionDefinition
- Inheritance
-
FunctionDefinition
- Inherited Members
Constructors
FunctionDefinition()
public FunctionDefinition()
Properties
AllowAsync
Allows a supporting model and API to continue working while this function executes. Defaults to false. Unsupported providers use the ordinary blocking tool-call flow without changing this setting.
public bool AllowAsync { get; set; }
Property Value
Description
public string Description { get; set; }
Property Value
Handler
Gets or replaces the tool handler. This compatibility view invokes a cancellation-aware handler with CancellationToken.None when called directly. Setting either handler property replaces the same callable; handlers registered here do not receive execution cancellation.
public Func<Dictionary<string, object>, Task<string>>? Handler { get; set; }
Property Value
HandlerWithCancellation
Gets or replaces the tool handler that receives execution cancellation. Pass the token to cancellable operations to stop cooperatively. Setting this also updates Handler.
public Func<Dictionary<string, object>, CancellationToken, Task<string>>? HandlerWithCancellation { get; set; }
Property Value
Name
public string Name { get; set; }
Property Value
Parameters
public FunctionParameters Parameters { get; set; }