What project is affected?
Virtual Assistant and Skill Template
What language is this in?
C#
What happens?
bf luis:generate:cs when called by update_cognitive_models.ps1 does not manage correctly the "money/currency" prebuilt entity.
I have an Hotel entity with two subentities HotelTimeFrame and TotalAmount. TotalAmount being modeled as a prebuilt money entity:
@ ml Hotel
- @ ml HotelTimeFrame usesFeature MLTimeFrame
- @ money TotalAmount
With this definition bf luis:generate:cs is generating the MySkillLuis.cs as following, with TotalAmount as string[]:
public class HotelClass
{
public string[] HotelTimeFrame;
public string[] TotalAmount;
[JsonProperty("$instance")]
public _InstanceHotel _instance;
}
public HotelClass[] Hotel;
This way, I get an exception in the Convert method of the generated class:
public void Convert(dynamic result)
{
var app = JsonConvert.DeserializeObject<MySkillLuis>(
JsonConvert.SerializeObject(
result,
new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, Error = OnError }
)
[...]
I manually changed the class definition as follows, with TotalAmount as Money[], and it worked:
public class HotelClass
{
public string[] HotelTimeFrame;
public Money[] TotalAmount;
[JsonProperty("$instance")]
public _InstanceHotel _instance;
}
public HotelClass[] Hotel;
But that's quite never a viable solution, since in many environment the update_cognitive_models.ps1 is executed by the ci/cd pipeline.
What project is affected?
Virtual Assistant and Skill Template
What language is this in?
C#
What happens?
bf luis:generate:cswhen called byupdate_cognitive_models.ps1does not manage correctly the "money/currency" prebuilt entity.I have an
Hotelentity with two subentitiesHotelTimeFrameandTotalAmount.TotalAmountbeing modeled as a prebuiltmoneyentity:With this definition
bf luis:generate:csis generating theMySkillLuis.csas following, withTotalAmountasstring[]:This way, I get an exception in the
Convertmethod of the generated class:I manually changed the class definition as follows, with
TotalAmountasMoney[], and it worked:But that's quite never a viable solution, since in many environment the
update_cognitive_models.ps1is executed by the ci/cd pipeline.