public async System.Threading.Tasks.Task <ServiceMessage> InvorkAsync(ServiceMessage message) { TextMessage yaInMsg = new TextMessage() { Id = message.Id, Language = EnumsConvertor.StringToLanguage(message.Language), Text = message.Text }; var yaOutMsg = await _yandexTts.ProcessAsync(yaInMsg); message.Voice = yaOutMsg.Vioce; return(message); }
public async System.Threading.Tasks.Task <ServiceMessage> InvorkAsync(ServiceMessage message) { TextMessage textMessage = new TextMessage { Id = message.Id, Language = EnumsConvertor.StringToLanguage(message.Language), Text = message.Text }; string userApiAiContext = "", userRnnContext = ""; textMessage = _dialogueFlow.Process(textMessage, ref userApiAiContext, out string intentName); if (intentName == "input.unknown") { RnnChiChatMessage chiChatMessage = await _rnnChiChat.ProcessAsync(textMessage, userRnnContext, 0); message.Text = chiChatMessage.TextData; } return(message); }