artiso-solutions / CoVoX

MIT License
1 stars 1 forks source link

CustomCommand. Use Text instead of voice to trigger command #28

Closed antonio8101 closed 3 years ago

antonio8101 commented 3 years ago

Is it possible to send text to match command by using the method SendActivityAsync. It accepts text in the form of a serialized object that must contain Text and Type property as follows:

new {
    Text = "turn on the light", 
    Type = "message"
}
antonio8101 commented 3 years ago

I confirm that it's possible to send text as input to a custom commands application.

Creates a Recognizer as new DialogServiceConnector

and then use it a follows:


  var activity = new { Text = sentence, Type = "message" };

  var activitySerialized = JsonSerializer.Serialize(activity);

  await Recognizer.SendActivityAsync(activitySerialized);