public bool UpdateDatabases(ChatRequest chat)
        {
            var          conversation = _conversationService.GetConversation(chat);
            AnalyzedChat inResponseTo = null;

            if (conversation.responses.Count() > 1)
            {
                inResponseTo = conversation.responses[conversation.responses.Count() - 2];
            }
            var analyzedConversation = _analyzationService.AnalyzeConversationAsync(conversation);
            var conversationUdpdated = _covnersationUpdateService.UpdateConversation(analyzedConversation, chat.type);

            _userService.UpdateUsers(analyzedConversation.responses.Last(), inResponseTo);

            return(conversationUdpdated);
        }
示例#2
0
        public ChatResponse ProcessChat(ChatRequest chat)
        {
            var conversation         = conversationService.GetConversation(chat);
            var analyzedConversation = analyzationService.AnalyzeConversation(conversation);
            var conversationUdpdated = covnersationUpdateService.UpdateConversation(analyzedConversation, chat.type);

            AnalyzedChat inResponseTo = null;

            if (analyzedConversation.responses.Count() > 1)
            {
                inResponseTo = analyzedConversation.responses[analyzedConversation.responses.Count() - 2];
            }
            userService.UpdateUsers(analyzedConversation.responses.Last(), inResponseTo);

            return(GetChatResponse(conversation, chat.exclusiveTypes, chat.requiredProperyMatches, chat.excludedTypes, chat.subjectGoals));
        }