Ejemplo n.º 1
0
        private async Task<string> GetReplyFromLuis(string messageText) {
            string toReturn = string.Empty;
            HomeAdvisorLuis requestDetails = await LuisClient.ParseUserInput(messageText);
            var request = new ServiceRequest(requestDetails);
            toReturn = ConstructReplyFromServiceRequest(request);

            return toReturn;
        }
        public Attachment ToAppointmentDetailsAttachment(ServiceRequest request, string selectedTime)
        {
            List<CardImage> cardImages = new List<CardImage>();
            cardImages.Add(new CardImage(url: this.ImageUrl));

            HeroCard plCard = new HeroCard() {
                Title = this.FullName,
                Subtitle = $"{request.Service}",
                Images = cardImages
            };
            return plCard.ToAttachment();
        }
Ejemplo n.º 3
0
        private string ConstructReplyFromServiceRequest(ServiceRequest request) {
            string toReturn = "You need help with ";

            // TODO: Save states based on data retrieved (e.g. if service == null, but day exists, store the desired day and request the service, etc.)
            if (request.Service != null) {
                if (!request.Service.EndsWith("ing", StringComparison.OrdinalIgnoreCase))
                    request.Service += "ing";
                toReturn += request.Service;
                
                if (request.Target != null) {
                    toReturn += $" your {request.Target}";
                }

                if (request.Day != null) {
                    toReturn += $" on {request.Day}";
                }

                toReturn += "? Here are some pros that can help you:";
            }
            else {
                toReturn = "Sorry, we couldn't find any related service. Try something like 'I need to remodel my kitchen' or 'I need my AC repaired'";
            }
            return toReturn;
        }