def generate_output(self, args=None):
        """
        Generate output, used by the Generic Agent.

        :param args:
        :return:
        """
        if not args:
            print('WARNING! nlu.generate_output called without args!')
            return ConversationalFrame([])

        if isinstance(args, ConversationalFrame):
            args = args.content

        if 'args' in args:
            args = {'utterance': args['args']}

        if 'utterance' not in args:
            print('WARNING! nlu.generate_output called without utterance!')
            return ConversationalFrame([])

        dialogue_state = None
        if 'dialogue_state' in args:
            dialogue_state = args['dialogue_state']

        return self.process_input(args['utterance'], dialogue_state)

        Generate output, used by the Generic Agent.

        :param args:
        :return:
        
plato/agent/component/nlu/nlu.py