BotBuilder-Location icon indicating copy to clipboard operation
BotBuilder-Location copied to clipboard

Way to provide an EntityRecommendation?

Open itoledo opened this issue 8 years ago • 3 comments
trafficstars

Can't find a way to provide an already user-submitted entity to the LocationDialog, like you can with a FormDialog. Scenario: intent and entity provided by Luis. Something like this...

        [LuisIntent("donde_esta")]
        public async Task ProcesarDondeEsta(IDialogContext context, IAwaitable<IMessageActivity> activity,
            LuisResult result)
        {
            EntityRecommendation lugar;
            var entities = new List<EntityRecommendation>(result.Entities);
            result.TryFindEntity("lugar", out lugar);
            if (lugar != null)
            {
                Debug.WriteLine($"detectado entity: {lugar.Entity}");
                entities.Add(new EntityRecommendation(type: "Lugar") { Entity = lugar.Entity });
            }

            // how to provide entity???
            var dlg = new LocationDialog(Constants.VIRTUAL_EARTH_API_KEY, context.Activity.ChannelId, "Qué lugar estás buscando?", LocationOptions.None, LocationRequiredFields.None);
            context.Call(dlg, BuscarPlaceComplete);
        }

itoledo avatar Dec 22 '16 03:12 itoledo

Hi @itoledo. Apologies for the late reply. I am not sure what you would pass an entity to the LocationDialog. Can you provide an example of what you are hoping to achieve by doing so?

kgrashad avatar Jan 04 '17 12:01 kgrashad

Hi @kgrashad , thanks for answering! Let's say I have a LuisIntent that searches for a place. This intent has a parameter/entity called "place". So if the user says "find the empire state building" I can receive "empire state building" into my LuisIntent.

I want to feed "empire state building" to the LocationDialog, so it can help me disambiguate the location. Maybe there another empire state building somewhere?

Hope this makes it clear enough :)

itoledo avatar Jan 04 '17 13:01 itoledo

I actually like this scenario and see it as a useful feature to have. I marked it as enhancement and we will spec it for the next release which should be around early Feb.

kgrashad avatar Jan 04 '17 13:01 kgrashad