Using the github of Rasa
(aquired with pip install rasa
)
after running rasa run
and using the code (in c#)
async Task<T> ParseMessage<T>(string message)
{
var url = "http://<address>:<port>/model/parse";
var data = new ChatBody
{
text=message
};
var client = new HttpClient();
string json = System.Text.Json.JsonSerializer.Serialize(data);
var httpContent = new StringContent(json, Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(url, httpContent);
httpResponse.EnsureSuccessStatusCode();
var responseBody = await httpResponse.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(responseBody);
}
no matter what i supply to the Message variable… the response is always the exact same as the message variable… it is able to detemine the intent however is unable to respond with a new response. Just clones the message.
(aka the response has the intents correct but the text
variable is the same as the supplied message)