Azure-Samples / cognitive-services-language-understanding

Samples for the Language Understanding Intelligent Service (LUIS)
MIT License
85 stars 139 forks source link

LuisGen cannot create a C# class when json has sub entities. #43

Closed Manish-MSFT closed 3 years ago

Manish-MSFT commented 3 years ago

Minimal steps to reproduce

  1. Create Sub Entity Under Entity image
  2. Publish the LUIS App, Export the .json file
  3. Use Luis gen to create a C# class using LUISGen {Your export json file} -cs {your C# file name}
  4. You get below error. image

Any log messages given by the failure

Unhandled Exception: System.ArgumentException: Can not convert Object to String. at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at CallSite.Target(Closure , CallSite , Object ) at LUISGen.Utils.EntityApply(JObject entity, Action1 action) in D:\a\1\s\packages\LUISGen\src\Utils.cs:line 94 at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at LUISGen.CSharp.Entities(Object app, Writer w) in D:\a\1\s\packages\LUISGen\src\CSharp.cs:line 161 at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2) at LUISGen.CSharp.Generate(String description, Object app, String className, String space, String outPath) in D:\a\1\s\packages\LUISGen\src\CSharp.cs:line 289 at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid6[T0,T1,T2,T3,T4,T5](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) at LUISGen.Program.Main(String[] args) in D:\a\1\s\packages\LUISGen\src\Program.cs:line 182`

Expected/desired behavior

The command must create a C# LUIS Recognizer class.

Versions

Microsoft.Bot.Builder.AI.Luis 4.11.1 Microsoft.Bot.Builder 4.11.1