def observe(self, msg): print( display_messages( [msg], ignore_fields=self.opt.get('display_ignore_fields', ''), prettify=self.opt.get('display_prettify', False), ))
def observe(self, msg): current_message = TelegramAgent.message_queue.pop() msg_text = display_messages([msg], prettify=True, ignore_fields='text_candidates') self.bot.send_message(chat_id=current_message.chat_id, text=msg_text.replace("[Seq2Seq]:", ""))
def act(self): reply = { 'id': self.getID(), 'text': self.text, 'episode_done': self.episode_done } print('\t' + display_messages([reply])) return reply
def display(self): """Returns a string describing the current state of the world. Useful for monitoring and debugging. By default, display the messages between the agents.""" if not hasattr(self, 'acts'): return '' return display_messages(self.acts, prettify=self.opt.get('display_prettify', False))
def observe(self, observation): print('\t' + display_messages([observation])) self.observation = observation self.episode_done = observation['episode_done'] if self.episode_done: self.text = '/end' else: self.text = random.choice([ 'I love you!', 'Wow!', 'Really?', 'Nice!', 'Hi', 'Hello', 'This is not very interesting. Let\'s change the subject of the ' 'conversation and talk about cats.', '/end' ])
def display(self): """ Return a string describing the current state of the world. Useful for monitoring and debugging. By default, display the messages between the agents. """ if not hasattr(self, 'acts'): return '' return display_messages( self.acts, ignore_fields=self.opt.get('display_ignore_fields', ''), prettify=self.opt.get('display_prettify', False), max_len=self.opt.get('max_display_len', 1000), )
def display(self): if self.curr_chatID in self.chats.keys(): return display_messages(self.last_exchanges[self.curr_chatID]) else: return ''
def observe(self, msg): print( display_messages([msg], prettify=self.opt.get('display_prettify', False)))