Class FunctionCall
Represents a function call to be used with the AI chat.
Namespace: Glitch9.AIDevKit
Assembly: .dll
Syntax
public class FunctionCall : ToolCall
Constructors
FunctionCall()
Declaration
public FunctionCall()
FunctionCall(FunctionDeclaration)
Initializes a new instance of the FunctionCall class with the specified function and delegate. Sets the type to Function.
Declaration
public FunctionCall(FunctionDeclaration function)
Parameters
Type | Name | Description |
---|---|---|
FunctionDeclaration | function | The function to be used. |
FunctionCall(string, string)
Creates a new FunctionCall instance with the specified name, description, and delegate. Using this method won't generate Parameters based on your return type class. Instead, the return type will be string.
Declaration
public FunctionCall(string name, string description)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the function. |
string | description | The description of the function. |
FunctionCall(string, string, string)
Declaration
public FunctionCall(string id, string name, string args)
Parameters
Type | Name | Description |
---|---|---|
string | id | |
string | name | |
string | args |
Properties
Args
Declaration
public string Args { get; }
Property Value
Type | Description |
---|---|
string |
Function
Gets or sets the function to be used. This property is required.
Declaration
public FunctionDeclaration Function { get; set; }
Property Value
Type | Description |
---|---|
FunctionDeclaration |
Name
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
FromJsonSchema<T>(string, string)
Creates a new FunctionCall instance with the specified name, description, and delegate.
The parameters for the function are generated based on the specified type T
.
T
is the return type of the function.
Declaration
public static FunctionCall FromJsonSchema<T>(string name, string description) where T : class
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the function. |
string | description | The description of the function. |
Returns
Type | Description |
---|---|
FunctionCall | A new instance of the FunctionCall class. |
Type Parameters
Name | Description |
---|---|
T | The type used to generate the function's parameters schema. |