Table of Contents

Class PropertyDefinition

Namespace
OpenAI.ObjectModels.SharedModels
Assembly
AntRunnerLib.dll
public class PropertyDefinition
Inheritance
System.Object
PropertyDefinition
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()

Properties

Default

Optional. Argument description.

[JsonPropertyName("default")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public object Default { get; set; }

Property Value

System.Object

Description

Optional. Argument description.

[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string Description { get; set; }

Property Value

System.String

Enum

Optional. List of allowed values for this argument.

[JsonPropertyName("enum")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IList<string>? Enum { get; set; }

Property Value

System.Nullable<IList<System.String>>

Example

Optional. Example.

[JsonPropertyName("example")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string Example { get; set; }

Property Value

System.String

Items

If type is "array", this specifies the element type for all items in the array. If type is not "array", this should be null. For more details, see https://json-schema.org/understanding-json-schema/reference/array.html

[JsonPropertyName("items")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ParametersDefinition Items { get; set; }

Property Value

ParametersDefinition

Parameters

Optional. The parameters the functions accepts, described as a JSON Schema object. See the guide for examples, and the JSON Schema reference for documentation about the format.

[JsonPropertyName("parameters")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ParametersDefinition Parameters { get; set; }

Property Value

ParametersDefinition

Type

Required. Function parameter object type. Default value is "object".

[JsonPropertyName("type")]
public string Type { get; set; }

Property Value

System.String

Methods

ConvertTypeToString(PropertyDefinition.FunctionObjectTypes)

Converts a FunctionObjectTypes enumeration value to its corresponding string representation.

public static string ConvertTypeToString(PropertyDefinition.FunctionObjectTypes type)

Parameters

type PropertyDefinition.FunctionObjectTypes

The type to convert

Returns

System.String

The string representation of the given type

DefineArray(ParametersDefinition)

public static PropertyDefinition DefineArray(ParametersDefinition arrayItems = null)

Parameters

arrayItems ParametersDefinition

Returns

PropertyDefinition

DefineBoolean(String)

public static PropertyDefinition DefineBoolean(string description = null)

Parameters

description System.String

Returns

PropertyDefinition

DefineEnum(List<String>, String)

public static PropertyDefinition DefineEnum(List<string> enumList, string description = null)

Parameters

enumList List<System.String>
description System.String

Returns

PropertyDefinition

DefineInteger(String)

public static PropertyDefinition DefineInteger(string description = null)

Parameters

description System.String

Returns

PropertyDefinition

DefineNull(String)

public static PropertyDefinition DefineNull(string description = null)

Parameters

description System.String

Returns

PropertyDefinition

DefineNumber(String)

public static PropertyDefinition DefineNumber(string description = null)

Parameters

description System.String

Returns

PropertyDefinition

DefineObject(Nullable<IDictionary<String, PropertyDefinition>>, String, String)

public static PropertyDefinition DefineObject(IDictionary<string, PropertyDefinition>? properties, string description, string defaultValue)

Parameters

properties System.Nullable<IDictionary<System.String, PropertyDefinition>>
description System.String
defaultValue System.String

Returns

PropertyDefinition

DefineString(String)

public static PropertyDefinition DefineString(string description = null)

Parameters

description System.String

Returns

PropertyDefinition