Exemplo n.º 1
0
 async def intent_help(self,minfo):
     LOGGER.info('INTENT HELP chat_id=%s confidence=%s\n',minfo.chat_id,minfo.confidence)
     response = await self._query_validator(
         Message.CLIENT_HEADS_GET_REQUEST,
         client_heads_pb2.ClientHeadsGetResponse,
         client_heads_pb2.ClientHeadsGetRequest(head_id=''))
     self.send_message(minfo.chat_id, 'Посмотри: {}'.format(response))
     LOGGER.info('response HELP=%s\n',response)
Exemplo n.º 2
0
    async def list_dag(self, request):
        """Fetches active heads from the validator.
        Request: batch_id = request.match_info.get('batch_id', '')

        Response:
            data: JSON array of peer endpoints
            link: The link to this exact query
        """
        LOGGER.debug('Request list_heads')
        response = await self._query_validator(
            Message.CLIENT_HEADS_GET_REQUEST,
            client_heads_pb2.ClientHeadsGetResponse,
            client_heads_pb2.ClientHeadsGetRequest(head_id=''))

        return self._wrap_response(
            request,
            data=response['heads'],
            metadata=self._get_metadata(request, response))