Class FunctionDefinitionBuilder
- Namespace
- OpenAI.Builders
- Assembly
- AntRunnerLib.dll
FunctionDefinitionBuilder is used to build and validate a FunctionDefinition object.
public class FunctionDefinitionBuilder
- Inheritance
-
System.ObjectFunctionDefinitionBuilder
- Inherited Members
-
System.Object.Equals(System.Object)System.Object.Equals(System.Object, System.Object)System.Object.GetHashCode()System.Object.GetType()System.Object.MemberwiseClone()System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ToString()
Constructors
FunctionDefinitionBuilder(String, String)
Initializes a new instance of FunctionDefinitionBuilder.
public FunctionDefinitionBuilder(string name, string description = null)
Parameters
nameSystem.StringThe name of the function
descriptionSystem.StringThe optional description of the function
Methods
AddParameter(String, PropertyDefinition, Boolean)
public FunctionDefinitionBuilder AddParameter(string name, PropertyDefinition value, bool required = true)
Parameters
nameSystem.StringvaluePropertyDefinitionrequiredSystem.Boolean
Returns
Build()
Builds the FunctionDefinition object.
public FunctionDefinition Build()
Returns
- FunctionDefinition
The built FunctionDefinition object
Validate()
Validates the function definition.
public FunctionDefinitionBuilder Validate()
Returns
- FunctionDefinitionBuilder
The FunctionDefinitionBuilder instance for fluent configuration
ValidateName(String)
Validates the name of the function.
public static void ValidateName(string functionName)
Parameters
functionNameSystem.StringThe name of the function to validate