botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

LUIS fails to initialize properties on FormFlow dialogs when the property type is a string.

Open jockorob opened this issue 10 years ago • 4 comments

Enums work great, I haven't tried ints, but strings don't work. I believe the problem is in FormDialog.cs in the StartAsync() function.

                var matches = MatchAnalyzer.Coalesce(step.Match(context, _state, _formState, input), input);
                if (MatchAnalyzer.IsFullMatch(input, matches, 0.5))
                {
                    // TODO: In the case of clarification I could
                    // 1) Go through them while supporting only quit or back and reset
                    // 2) Drop them
                    // 3) Just pick one (found in form.StepState, but that is opaque here)
                    var result = await step.ProcessAsync(context, _state, _formState, input, matches);
                    feedback = result.Feedback;
                    prompt = result.Prompt;
                }
                else
                {
                    _formState.SetPhase(StepPhase.Ready);
                }

There are never matches when the property is a string like there are when the property is an enum.

jockorob avatar Apr 20 '16 00:04 jockorob

Just found this issue myself. Whilst this is great for enum properties, my evolving bot is definitely going to need strings

IanBoggs avatar Apr 20 '16 10:04 IanBoggs

I believe this was fixed by the pull request I just accepted from @jockorob. The issue was not strings, but that there was a mismatch between the LUIS model and the field name.

chrimc62 avatar Apr 21 '16 03:04 chrimc62

Hi @chrimc62 ,

I do not believe that this was fixed in the pull request you mentioned. That pull request seems to fix an issue with the Luis model not matching the field name, which is not my case.

Although that pull request does fix the mis-matched name, the problem still exists that string fields in a FormFlow dialog are not correctly matched. In the code quoted by @jockorob, if the field is a string it always executes the 'else' part of the 'if' statement.

It appears that the confidence of any string match in the 'matches' is 0, hence it never sets the prompt. It appears that this may be to allow commands (such as quit) to be processed

I've tested this both with my own code and with the PizzaBot from the new pull. The Address field is still not populated when there is a Luis Entity called 'Address', again with a confidence match of zero

Can this issue be re-opened, or should I start a new issue ?

IanBoggs avatar Apr 21 '16 08:04 IanBoggs

Ya my pull request didn't fix this issue. This is still an issue. Please reopen.

jockorob avatar Apr 21 '16 15:04 jockorob