Exemplo n.º 1
0
    def __init__(self, newVerbose):
        self.verbose = newVerbose
        self.rHandler = ResponseHandler(self.verbose)
        self.decoder = UserDecoder(self.verbose)

        # Initialize and begin logging
        Logger.ensureLogDir()
        Logger.writeLog("===== Begin Conversation =====\n\n")
Exemplo n.º 2
0
class Jarmis:
    verbose = False

    def __init__(self, newVerbose):
        self.verbose = newVerbose
        self.rHandler = ResponseHandler(self.verbose)
        self.decoder = UserDecoder(self.verbose)

        # Initialize and begin logging
        Logger.ensureLogDir()
        Logger.writeLog("===== Begin Conversation =====\n\n")

    def getTextResponse(self, input):
        # Send user text input to APIAI for processing,
        # then send the response to the response handler class
        self.rHandler.process(self.decoder.handleTextInput(input))

    def getVoiceResponse(self):
        # Begin voice recognition and pass the APIAI response
        # into the response handler class.
        self.rHandler.process(self.decoder.startVoiceRecognition())