Example #1
0
        public ActionResult Publish()
        {
            //var qnaService = new QnASyncService(ConfigurationManager.AppSettings["QnaMakerKnowledgebaseId"], ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnASyncTesting");
            var qnaService = new QnASyncService("07fbe223-9502-44d9-b762-d0164cd678e2", ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnAManual");

            qnaService.PublishKnowledgeBase();
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult Sync()
        {
            string baseUrl = HttpRuntime.AppDomainAppPath;
            string jsonUrl = baseUrl + jsonName;
            var    qnaList = RequestHandler.ParseDocumentForQnAPairs(jsonUrl);
            //var qnaService = new QnASyncService(ConfigurationManager.AppSettings["QnaMakerKnowledgebaseId"], ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnASyncTesting");
            var qnaService = new QnASyncService("07fbe223-9502-44d9-b762-d0164cd678e2", ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnAManual");

            qnaService.UpdateKnowlegdeBase(qnaList);
            return(RedirectToAction("Index"));
        }
Example #3
0
        public ActionResult SyncItem(int itemid, bool ResetQuestions)
        {
            string baseUrl = HttpRuntime.AppDomainAppPath;
            string jsonUrl = baseUrl + jsonName;
            var    qnaList = new List <QnAItem>();
            var    qnaItem = RequestHandler.FetchQnaItem(itemid, jsonUrl);

            qnaList.Add(qnaItem);
            //var qnaService = new QnASyncService(ConfigurationManager.AppSettings["QnaMakerKnowledgebaseId"], ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnASyncTesting");
            var qnaService = new QnASyncService("07fbe223-9502-44d9-b762-d0164cd678e2", ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnAManual");

            qnaService.UpdateKnowlegdeBaseSingleItem(qnaList, ResetQuestions);
            return(RedirectToAction("Index"));
        }
Example #4
0
        public JsonResult CheckIfUpdatedQuestion(int itemid) //change signature to string and then convert to int
        {
            string baseUrl = HttpRuntime.AppDomainAppPath;
            string jsonUrl = baseUrl + jsonName;
            var    qnaList = new List <QnAItem>();
            var    qnaItem = RequestHandler.FetchQnaItem(itemid, jsonUrl);

            qnaList.Add(qnaItem);

            //var qnaService = new QnASyncService(ConfigurationManager.AppSettings["QnaMakerKnowledgebaseId"], ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnASyncTesting");
            var  qnaService       = new QnASyncService("07fbe223-9502-44d9-b762-d0164cd678e2", ConfigurationManager.AppSettings["QnAMakerSubscriptionKey"], "QnAManual");
            bool changedQuestions = qnaService.CheckIfUpdatedQuestion(qnaItem);

            if (!changedQuestions)
            {
                SyncItem(itemid, false);
            }

            return(Json(new { result = changedQuestions }, JsonRequestBehavior.AllowGet));
        }