diff --git a/rasa/actions/actions.py b/rasa/actions/actions.py index b5bebba7ff814f816bef5db2898649f40f8f7e86..cb554a7a8941b3da5846cf40c157aae5486d87f3 100644 --- a/rasa/actions/actions.py +++ b/rasa/actions/actions.py @@ -58,6 +58,15 @@ def find_location(timestamp): return smaller_entry +def format_timestamp(location): + parts = location.split(" ") + answer = f"The ISS at time: {parts[0]} will be at:\n \ + x: {parts[1]}\n \ + y: {parts[2]}\n \ + z: {parts[3]}\n" + return answer + + class ActionCurrentIssLocation(Action): def name(self) -> Text: @@ -69,8 +78,8 @@ class ActionCurrentIssLocation(Action): download_file() location = find_location(str(datetime.now())) - - dispatcher.utter_message(text=f"location: {location}") + location = format_timestamp(location) + dispatcher.utter_message(text=f"{location}") return [] @@ -91,7 +100,8 @@ class ActionFutureIssLocation(Action): else: entity = tracker.latest_message['entities'][0]['value'] location = find_location(entity) - dispatcher.utter_message(text=f"location: {location}") + location = format_timestamp(location) + dispatcher.utter_message(text=f"{location}") return []