You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Lu file's content altered and wrong error when using unavailable features #1292
What CLI version are you using: 4.14.1
What Nodejs version are you using: 14.17.1
What command-line interpreters are you using: CMD (Windows' command prompt)
What OS are you using: Win10 x64
Describe the bug
TL;DR (details and possible fixes in first comment)
Content of .lu file is altered based on result of this method call during loading of file content, causing wrong error on subsequent passes if Builder class (defined here) is constructed passing a log function
This call passes empty luis_culture to build function (defined here) and the value is never updated down the road (thus, remaining empty).
This may cause unexpected behavior in parseLuAndQnaWithAntlr because culture falls back to en-us
Notice that this bug affects BotFramework Composer that outputs a wrong error in cases like this one
To Reproduce
First one is easily reproducible following the steps below, while to address the second issue you must enter debug mode and go along the path until you'll find the bug
Create a .lu file (e.g.: MyLUISFile.lu)
Notice that I explicitly inserted an error: I used geographyV2 with culture it-it even if it isn't available for Italian (Italy) at the time I'm writing the issue
You will have the following exception logged in console:
Luis build failed: [ERROR] line 20:0 - line 20:1: Invalid child entity definition found. No definition found for "geographyV2" in child entity definition "- @ ml MLSubEntity usesFeature geographyV2". Features must be defined before they can be added to a child.
Expected behavior
It should throw an error saying the feature isn't available and stop the execution, as it does if log function isn't passed in Builder constructor.
Content of .lu file is altered based on result of this method call during loading of file content, i.e.: original file is parsed and an internal representation of the file is used to "recreate" its content.
However, this causes a wrong re-creation of the content if the result of this line is nulland a log function exists (passed during construction of Builder class).
The wrong re-creation is due to the fact that these steps are executed:
it's been outputted a warning message on the console stating that the entity isn't available
the prebuilt entity is not added to the internal representation
the following passes don't know that the entity is specified but unavailable and thus, treat it as missing.
This causes the output of the wrong error specified above.
Important Note: BF Composer passes content without header. The following fix alone is not enough to solve the problem parsedContent.LUISJsonStructure.culture gets filled here with culture defined in .lu file header.
It can be inserted the following code in the next line to update culture:
Activity
MatteoMeil commentedon Sep 15, 2021
Long version
First part: content altered
Content of
.lufile is altered based on result of this method call during loading of file content, i.e.: original file is parsed and an internal representation of the file is used to "recreate" its content.However, this causes a wrong re-creation of the content if the result of this line is
nulland alogfunction exists (passed during construction ofBuilderclass).The wrong re-creation is due to the fact that these steps are executed:
This causes the output of the wrong error specified above.
Possible fix:
Always throw an error as if log function is never specified
Second part: missing culture in function's call
This call passes empty
luis_culturetobuildfunction (defined here) and the value is never updated down the road (thus, remaining empty).This may cause unexpected behavior in
parseLuAndQnaWithAntlrbecause culture falls back toen-us.Possible fixes
luObdefined here can be filled with the following object:{ "content": "Lu file content", "id": "some id", "includeInCollate": false, "language": "it-it", // current locale inferred from previous steps "path": "path/to/lu/file.lu", "name": "filename.lu" }parsedContent.LUISJsonStructure.culturegets filled here with culture defined in.lufile header.It can be inserted the following code in the next line to update culture:
.lufile can be submitted without header informationssrinaath commentedon Sep 17, 2021
Emilio Munoz (@munozemilio) could you take a look at this ticket?
munozemilio commentedon Sep 20, 2021
Shuai Wang (@cosmicshuai) could you please take a look at the lubuilder piece, please?
mrivera-ms commentedon Sep 30, 2021
Emilio Munoz (@munozemilio), Shuai Wang (@cosmicshuai), is there any progress on this?
cosmicshuai commentedon Oct 1, 2021
It still need some time to figure out the root cause. Can we move it to R16. I will do it ASAP.