public ChatResponse GetYourPropertyResponse(AnalyzedChat analyzedChat, UserData userData)
        {
            var requestedPropertyName = getRequestedProperty(analyzedChat);

            if (!string.IsNullOrEmpty(requestedPropertyName))
            {
                var requestedProperty = _propertyValueService.getSelfPropertyByValue(requestedPropertyName, userData);
                if (!string.IsNullOrEmpty(requestedProperty.value))
                {
                    var confidence = 1.0;
                    if (requestedProperty.source != userData.userName) //TODO: determine confidence based on source/user relationship, trustworthiness, etc.
                    {
                        confidence = .75;
                    }
                    var response = new List <string>();
                    response.Add(getYourPropertySentence(requestedProperty));
                    return(new ChatResponse {
                        confidence = confidence, response = response
                    });
                }
            }
            return(new ChatResponse {
                confidence = 0, response = new List <string>()
            });
        }
Example #2
0
        public ChatResponse GetPropertyResponse(AnalyzedChat analyzedChat, UserData userData)
        {
            var requestedPropertyName = getRequestedProperty(analyzedChat);

            if (!string.IsNullOrEmpty(requestedPropertyName))
            {
                var requestedProperty = _propertyValueService.getSelfPropertyByValue(requestedPropertyName, userData);
                if (!string.IsNullOrEmpty(requestedProperty.value))
                {
                    var confidence = 1.0;
                    if (requestedProperty.source != analyzedChat.botName)
                    {
                        confidence = .75;
                    }
                    var response = new List <string>();
                    response.Add(getYourPropertySentence(requestedProperty));
                    return(new ChatResponse {
                        confidence = confidence, response = response
                    });
                }
            }
            return(new ChatResponse {
                confidence = 0, response = new List <string>()
            });
        }