Ejemplo n.º 1
0
    def get_context_callback(self, response, handler: WebSocketHandler, message: dict):
        self.logger.debug("get_context_callback")
        handler.context = self.json_decode(response.body)
        handler.context_rev = handler.context["_rev"]

        self.context_responder.unsupported_entities(handler, handler.context)

        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)
        )
Ejemplo n.º 2
0
    def get_context_callback(self, response, handler: WebSocketHandler,
                             message: dict):
        self.logger.debug("get_context_callback")
        handler.context = self.json_decode(response.body)
        handler.context_rev = handler.context["_rev"]

        self.context_responder.unsupported_entities(handler, handler.context)

        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))
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 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