Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Commit

Permalink
chore: disable support for templates with multiple channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Cote-Boucher committed Dec 11, 2019
1 parent 891837b commit f7dd8fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rasa_addons/core/nlg/bftemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _templates_for_utter_action(self, utter_action, output_channel, **kwargs):
for template in self.templates[utter_action]:
if template.get("language") != kwargs.get("language"):
continue
if output_channel in template.get("channel", []):
if template.get("channel") == output_channel:
channel_templates.append(template)
elif not template.get("channel"):
default_templates.append(template)
Expand Down Expand Up @@ -53,8 +53,6 @@ def _random_template_for(

if suitable_templates:
template = np.random.choice(suitable_templates)
# fill in metadata
template["metadata"] = self.templates[utter_action].get("metadata")
return template
else:
return None
Expand Down

0 comments on commit f7dd8fa

Please sign in to comment.