Exemplo n.º 1
0
        private async Task <string> ParseLuisResponse(LuisResponse luisResponse)
        {
            Intent winner = luisResponse.Winner();

            if (winner == null || winner.IsNone())
            {
                return(Sad);
            }

            return(luisResponse.Winner().Name);
        }
Exemplo n.º 2
0
        private async Task <string> ParseLuisResponse(LuisResponse luisResponse)
        {
            Intent winner = luisResponse.Winner();

            if (winner == null || winner.IsNone())
            {
                return(Sad);
            }

            if (winner.Name.Equals(WeatherInTownIntent))
            {
                Entity townEntity = luisResponse.Entities
                                    .First(e => e.Type.Equals(TownEntity, StringComparison.InvariantCultureIgnoreCase));

                OpenWeatherMapClient client = OpenWeatherMapClient.Create();
                return(await client.CurrentWeatherDescription(townEntity.Value));
            }

            return(Sad);
        }