Skip to content

Commit

Permalink
Merge pull request #127 from RasaHQ/knowledge-base-1.5
Browse files Browse the repository at this point in the history
use utter_message as recommended
  • Loading branch information
Nikolai authored Nov 28, 2019
2 parents 1eb11cb + d4f2257 commit 17eb701
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rasa_sdk/knowledge_base/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def utter_attribute_value(
"""
if attribute_value:
dispatcher.utter_message(
f"'{object_name}' has the value '{attribute_value}' for attribute '{attribute_name}'."
text=f"'{object_name}' has the value '{attribute_value}' for attribute '{attribute_name}'."
)
else:
dispatcher.utter_message(
f"Did not find a valid value for attribute '{attribute_name}' for object '{object_name}'."
text=f"Did not find a valid value for attribute '{attribute_name}' for object '{object_name}'."
)

def utter_objects(
Expand All @@ -80,17 +80,17 @@ def utter_objects(
"""
if objects:
dispatcher.utter_message(
f"Found the following objects of type '{object_type}':"
text=f"Found the following objects of type '{object_type}':"
)

repr_function = self.knowledge_base.get_representation_function_of_object(
object_type
)
for i, obj in enumerate(objects, 1):
dispatcher.utter_message(f"{i}: {repr_function(obj)}")
dispatcher.utter_message(text=f"{i}: {repr_function(obj)}")
else:
dispatcher.utter_message(
f"I could not find any objects of type '{object_type}'."
text=f"I could not find any objects of type '{object_type}'."
)

def run(
Expand Down

0 comments on commit 17eb701

Please sign in to comment.