Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

bf luis:generate:cs generates wrong class for "money/currency" prebuilt entity. #1069

Closed

Description

@GitDruid

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.

Activity

  1. Batta32 commented on Nov 26, 2020

    @Batta32

    Hi Alessandro (@GitDruid), thanks for reporting this issue. We will be reviewing this scenario in order to check the root cause of the issue.

    We will back to you as soon as we have any update 😊.

  2. GitDruid commented on Nov 27, 2020

    @GitDruid
    Author

    Just as additional note, If I switch to this definition in .lu file:

    @ ml Hotel
        - @ ml HotelTimeFrame usesFeature MLTimeFrame
        - @ ml TotalAmount usesFeature money
    

    it is working, since TotalAmount is returned as string from LUIS in that case.

  3. tonyanziano commented on Dec 1, 2020

    @tonyanziano
  4. Batta32 commented on Dec 1, 2020

    @Batta32

    Hi Tony Anziano (@tonyanziano), this week we will start working on this issue in order to reproduce the problem.

    This week we will provide the updates here 😊.

  5. Batta32 commented on Dec 3, 2020

    @Batta32

    Hi Alessandro (@GitDruid), sorry for the delay. We successfully reproduced the issue.

    We will investigate the reason of this, we will back to you as soon as we have any update 😊.

    Issue reproduced
    image

  6. Batta32 commented on Dec 4, 2020

    @Batta32

    Hi Alessandro (@GitDruid), as a workaround we used the composite entity and the result was a similar one as the desired. We added an example so you can use it as a guide.

    Emilio Munoz (@munozemilio) & Axel Suárez (@axelsrz) - should we transfer this issue to botframework-cli repository? As this appears to be an issue of bf-cli tool.

    Last but not least, we reviewed the stack of tests that the CLI team added in the repository to have the same desired result with no success.

    We will keep researching another alternatives and we will back here 😊.

    This is the documentation we read:

    Example of .lu file using composite entity

    @ composite Hotel = [money, HotelTimeFrame]
    @ prebuilt money
    @ ml HotelTimeFrame

    Class generated using composite entity
    image

  7. added
    Bot Services
    customer-replied-to
    customer-reported
    on Dec 8, 2020
  8. tonyanziano commented on Dec 8, 2020

    @tonyanziano

    Will this be addressed in R12?

  9. axelsrz commented on Dec 10, 2020

    @axelsrz
    Member

    Alessandro (@GitDruid) thanks for logging this. We're currently evaluating the changes needed to support this, in the case that we take this fix as is we will target our R12 realease date. We will update here if needed.

  10. added this to the R12 milestone on Dec 10, 2020
  11. added
    P1
    on Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Bot ServicesP1customer-replied-tocustomer-reported

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions