def get_context_callback(self, response, handler: WebSocketHandler, message: dict): handler.context = self.json_decode(response.body) handler.context_rev = handler.context["_rev"] if not any(x for x in handler.context["entities"] if x["source"] == "detection"): handler.suggest_id = self.suggest.post_suggest( handler.user_id, handler.application_id, handler.session_id, handler.locale, handler.context, callback=lambda res: self.post_suggest_callback(res, handler, message) ) else: # TODO No idea what to do here pass
def get_context_callback(self, response, handler: WebSocketHandler, message: dict): handler.context = self.json_decode(response.body) handler.context_rev = handler.context["_rev"] if not any(x for x in handler.context["entities"] if x["source"] == "detection"): handler.suggest_id = self.suggest.post_suggest( handler.user_id, handler.application_id, handler.session_id, handler.locale, handler.context, callback=lambda res: self.post_suggest_callback( res, handler, message)) else: # TODO No idea what to do here pass
def post_suggest_callback(self, response, handler: WebSocketHandler, message: dict): self.logger.debug("post_suggest_callback") handler.suggest_id = response.headers["_id"] self.suggest.write_new_suggestion(handler)
def post_suggest_callback(self, response, handler: WebSocketHandler, message: dict): handler.suggest_id = response.headers["_id"] self.suggest.write_new_suggestion(handler)