Table of Contents

Class FunctionDefinitionBuilder

Namespace
OpenAI.Builders
Assembly
AntRunnerLib.dll

FunctionDefinitionBuilder is used to build and validate a FunctionDefinition object.

public class FunctionDefinitionBuilder
Inheritance
System.Object
FunctionDefinitionBuilder
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

name System.String

The name of the function

description System.String

The optional description of the function

Methods

AddParameter(String, PropertyDefinition, Boolean)

public FunctionDefinitionBuilder AddParameter(string name, PropertyDefinition value, bool required = true)

Parameters

name System.String
value PropertyDefinition
required System.Boolean

Returns

FunctionDefinitionBuilder

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

functionName System.String

The name of the function to validate