public string Train([FromRoute] String agentId) { _platform.LoadAgent(agentId); _platform.Train(); return(""); }
public ActionResult <RasaResponse> Parse(RasaRequestModel request) { String clientAccessToken = Request.Headers["ClientAccessToken"]; var config = new AIConfiguration(clientAccessToken, SupportedLanguage.English); config.SessionId = "rasa nlu"; _platform.LoadAgent(clientAccessToken); var aIResponse = _platform.TextRequest(new AIRequest { Query = new String[] { request.Text } }); return(new RasaResponse { Intent = new RasaResponseIntent { Name = aIResponse.Result.Metadata.IntentName, Confidence = aIResponse.Result.Score }, Entities = new List <RasaResponseEntity> { }, Text = request.Text }); }
public ActionResult <AIResponse> Query([FromBody] QueryModel request) { String clientAccessToken = Request.Headers["ClientAccessToken"]; var config = new AIConfiguration(clientAccessToken, SupportedLanguage.English); config.SessionId = request.SessionId; _platform.LoadAgent(clientAccessToken); var aIResponse = _platform.TextRequest(new AIRequest { Timezone = request.Timezone, Contexts = request?.Contexts?.Select(x => new AIContext { Name = x })?.ToList(), Language = request.Lang, Query = new String[] { request.Query } }); return(aIResponse); }
public ActionResult <Agent> Dump([FromRoute] String agentId) { var agent = _platform.LoadAgent(agentId); return(Ok(agent)); }