def run(self, dispatcher, tracker, domain): movie = tracker.get_slot("movie.name") if movie is None: dispatcher.utter_message(didnt_get_title()) else: movie_buff = MovieBuff(URI) result = movie_buff.get_actors(movie) if result is None: dispatcher.utter_message( "Either this is a movie without actors or I got nothing in my database" ) else: if "|" in result: actor = result.split("|")[0] else: actor = result dispatcher.utter_message("Maybe " + actor + " is the actor you are looking for") return [SlotSet("actor.name", actor)]
def run(self, dispatcher, tracker, domain): movie = tracker.get_slot("movie.name") if movie is None: dispatcher.utter_message(didnt_get_title()) else: movie_buff = MovieBuff(URI) result = movie_buff.get_actors(movie) if result is None: dispatcher.utter_message( "Either this is a movie without actors or I got nothing in my database" ) else: results = [] for el in result.split("|"): if el != "": results.append(el) if len(results) > 0: dispatcher.utter_message("I got these actors: ") for el in results: dispatcher.utter_message("- " + el) return []