This is very similar to Bot Libe's language synthesize feature.
To enable this select it from your bot's Learning & Settings page.
You will also need to set, "Learn Grammar"
You can also use the Synth script,
To see an example chat with the Synth bot,