Member in entity class not created correctly using bf luis:generate:cs #1281
Labels
backlog
The issue is out of scope for the current iteration but it will be evaluated in a future release.
Bot Services
Required for internal Azure reporting. Do not delete. Do not change color.
bug
Indicates an unexpected problem or an unintended behavior.
customer-replied-to
Indicates that the team has replied to the issue reported by the customer. Do not delete.
customer-reported
Issue is created by anyone that is not a collaborator in the repository.
ExemptFromDailyDRIReport
Use this label to exclude the issue from the DRI report.
needs-triage
The issue has just been created and it has not been reviewed by the team.
P1
Painful if we don't fix, won't block releasing
Milestone
Versions
BF-CLI: @microsoft/botframework-cli/4.14.1 win32-x64 node-v14.6.0
NodeJs: v14.6.0
CommandLine: Git Bash
OS: Windows 10
Describe the bug
When creating the c# class of a luis app the botframework-cli does not create entity classes of ML entities containig subentities correctly in some cases.
To Reproduce
Take this exported luis app:
Please notice the entity
Device
with childDeviceName
to which the featureDeviceName
(a list entity) was assigned.Then run
bf luis:generate:cs --in app.json --out ./app.cs --className MyApp.MyLuisModel
. The command creates the file app.cs containing the class "MyLuisModel". In the nested class _Entities there are memberspublic double[] number;
,public string[][] DeviceName;
andpublic DeviceClass[] Device;
.DeviceClass
looks like this:You can see that the member
DeviceName
is of typestring[][]
. If you change the child name of entityDevice
fromDeviceName
toName
(or anything other than DeviceName; just change the value of property "name" in the json file at path entities[0].children[0]), then the classDeviceClass
looks like this:EDIT:
I've updated the Luis model and added another ML entity "ObjectEntity" consisting of sub entity "name" (required feature ObjectName) and "number" (required feature "number"). When I export the app and create the model classes, the new entity class looks like this:
This is as expected! Well, now when I run a request using REST api the result looks like this:
Have a close look at the extracted entity:
You'll see that the sub entity is of type
string[][]
which leads to an JSON exception in the code becausestring[]
is expected.End of edit
Expected behavior
DeviceName
in classDeviceClass
is of typestring[]
.[bug]
The text was updated successfully, but these errors were encountered: