You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the commands are registered and then they're all available to be invoked at any time.
Sometimes, though, it would be nice to be able to specify when the commands can be invoked, by dynamically changing the available commands.
The implementation would contain the state machine determining which commands can be executed by the engine:
classCommandsProvider:ICommandsProvider{privatereadonlyState_state;publicCommandsProvider(Statestate/* custom-defined type, not in Covox */)=>_state=state;publicIReadOnlyList<ICommand>AvailableCommands=>ListAvailableCommands();privateIReadOnlyList<ICommand>ListAvailableCommands(){if(state.IsLightOn)returnnew[]{TurnOffLightsCommand};elsereturnnew[]{TurnOnLightsCommand};}}// ...covox.UseCommandsProvider(newCommandsProvider());
Covox would invoke ICommandsProvider.AvailableCommands after the speech recognition in order to do the understanding on the available commands.
Note: only one source of commands can be used, either RegisterCommands or UseCommandsProvider.
The text was updated successfully, but these errors were encountered:
At the moment, the commands are registered and then they're all available to be invoked at any time.
Sometimes, though, it would be nice to be able to specify when the commands can be invoked, by dynamically changing the available commands.
Proposal:
The implementation would contain the state machine determining which commands can be executed by the engine:
Covox would invoke
ICommandsProvider.AvailableCommands
after the speech recognition in order to do the understanding on the available commands.Note: only one source of commands can be used, either
RegisterCommands
orUseCommandsProvider
.The text was updated successfully, but these errors were encountered: