@ -16,6 +16,7 @@ public enum PropertyValueType
public class AIToolPropertyDescriptor
public class AIToolPropertyDescriptor
{
{
public string Name { get ; }
public string Name { get ; }
public bool Required { get ; }
public PropertyValueType ValueType { get ; }
public PropertyValueType ValueType { get ; }
public List < NameValue < object > > Options { get ; }
public List < NameValue < object > > Options { get ; }
public ILocalizableString DisplayName { get ; }
public ILocalizableString DisplayName { get ; }
@ -24,12 +25,14 @@ public class AIToolPropertyDescriptor
string name ,
string name ,
PropertyValueType valueType ,
PropertyValueType valueType ,
ILocalizableString displayName ,
ILocalizableString displayName ,
ILocalizableString ? description = null )
ILocalizableString ? description = null ,
bool required = false )
{
{
Name = name ;
Name = name ;
ValueType = valueType ;
ValueType = valueType ;
DisplayName = displayName ;
DisplayName = displayName ;
Description = description ;
Description = description ;
Required = required ;
Options = new List < NameValue < object > > ( ) ;
Options = new List < NameValue < object > > ( ) ;
}
}
@ -37,37 +40,43 @@ public class AIToolPropertyDescriptor
public static AIToolPropertyDescriptor CreateStringProperty (
public static AIToolPropertyDescriptor CreateStringProperty (
string name ,
string name ,
ILocalizableString displayName ,
ILocalizableString displayName ,
ILocalizableString ? description = null )
ILocalizableString ? description = null ,
bool required = false )
{
{
return new AIToolPropertyDescriptor (
return new AIToolPropertyDescriptor (
name ,
name ,
PropertyValueType . String ,
PropertyValueType . String ,
displayName ,
displayName ,
description ) ;
description ,
required ) ;
}
}
public static AIToolPropertyDescriptor CreateNumberProperty (
public static AIToolPropertyDescriptor CreateNumberProperty (
string name ,
string name ,
ILocalizableString displayName ,
ILocalizableString displayName ,
ILocalizableString ? description = null )
ILocalizableString ? description = null ,
bool required = false )
{
{
return new AIToolPropertyDescriptor (
return new AIToolPropertyDescriptor (
name ,
name ,
PropertyValueType . Number ,
PropertyValueType . Number ,
displayName ,
displayName ,
description ) ;
description ,
required ) ;
}
}
public static AIToolPropertyDescriptor CreateBoolProperty (
public static AIToolPropertyDescriptor CreateBoolProperty (
string name ,
string name ,
ILocalizableString displayName ,
ILocalizableString displayName ,
ILocalizableString ? description = null )
ILocalizableString ? description = null ,
bool required = false )
{
{
return new AIToolPropertyDescriptor (
return new AIToolPropertyDescriptor (
name ,
name ,
PropertyValueType . Boolean ,
PropertyValueType . Boolean ,
displayName ,
displayName ,
description ) ;
description ,
required ) ;
}
}
public static AIToolPropertyDescriptor CreateDictionaryProperty (
public static AIToolPropertyDescriptor CreateDictionaryProperty (
@ -86,13 +95,15 @@ public class AIToolPropertyDescriptor
string name ,
string name ,
ILocalizableString displayName ,
ILocalizableString displayName ,
List < NameValue < object > > options ,
List < NameValue < object > > options ,
ILocalizableString ? description = null )
ILocalizableString ? description = null ,
bool required = false )
{
{
var propertyDescriptor = new AIToolPropertyDescriptor (
var propertyDescriptor = new AIToolPropertyDescriptor (
name ,
name ,
PropertyValueType . Select ,
PropertyValueType . Select ,
displayName ,
displayName ,
description ) ;
description ,
required ) ;
foreach ( var option in options )
foreach ( var option in options )
{
{