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")); }
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")); }
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")); }
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)); }