Class PropertyDefinition
- Namespace
- OpenAI.ObjectModels.SharedModels
- Assembly
- AntRunnerLib.dll
Function parameter is a JSON Schema object. https://json-schema.org/understanding-json-schema/reference/object.html
public class PropertyDefinition
- Inheritance
-
System.ObjectPropertyDefinition
- 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
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
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
typePropertyDefinition.FunctionObjectTypesThe type to convert
Returns
- System.String
The string representation of the given type
DefineArray(ParametersDefinition)
public static PropertyDefinition DefineArray(ParametersDefinition arrayItems = null)
Parameters
arrayItemsParametersDefinition
Returns
DefineBoolean(String)
public static PropertyDefinition DefineBoolean(string description = null)
Parameters
descriptionSystem.String
Returns
DefineEnum(List<String>, String)
public static PropertyDefinition DefineEnum(List<string> enumList, string description = null)
Parameters
enumListList<System.String>descriptionSystem.String
Returns
DefineInteger(String)
public static PropertyDefinition DefineInteger(string description = null)
Parameters
descriptionSystem.String
Returns
DefineNull(String)
public static PropertyDefinition DefineNull(string description = null)
Parameters
descriptionSystem.String
Returns
DefineNumber(String)
public static PropertyDefinition DefineNumber(string description = null)
Parameters
descriptionSystem.String
Returns
DefineObject(Nullable<IDictionary<String, PropertyDefinition>>, String, String)
public static PropertyDefinition DefineObject(IDictionary<string, PropertyDefinition>? properties, string description, string defaultValue)
Parameters
propertiesSystem.Nullable<IDictionary<System.String, PropertyDefinition>>descriptionSystem.StringdefaultValueSystem.String
Returns
DefineString(String)
public static PropertyDefinition DefineString(string description = null)
Parameters
descriptionSystem.String