public ChatResponse GetPropertyResponse(AnalyzedChat analyzedChat, UserData userData) { var requestedPropertyName = getRequestedPropertyName(analyzedChat); if (!string.IsNullOrEmpty(requestedPropertyName)) { var requestedProperty = propertyValueService.getPropertyByValue(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 botSelfPropertyRetrievalService.GetPropertyResponse(analyzedChat, userData); }
public ChatResponse GetYourPropertyResponse(AnalyzedChat analyzedChat, UserData userData) { var requestedPropertyName = getSelfRequestedPropertyName(analyzedChat); if (!string.IsNullOrEmpty(requestedPropertyName)) { var requestedProperty = propertyValueService.getPropertyByValue(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(userSelfPropertyRetrievalService.GetYourPropertyResponse(analyzedChat, userData)); }