from speaker.speaker import Speaker
from listener.listener import Listener
from agent.agent import Agent
from colorama import init
from termcolor import colored
from agent.kb import *
import re
speaker = Speaker()
listener = Listener()
agent = Agent(speaker, listener)
botName=colored('Sara','yellow')
endCheck = False
speaker.speak('Ciao sono Sara, come posso aiutarla?')
print('Ciao sono '+botName+', come posso aiutarla?')
a=False

while a==False:
    command,taken=listener.listen()
    command = command.capitalize()
    match=''
    
    for k in End:
        for i, interaction in enumerate(End[k]):
            match = re.search(interaction.upper(),command.upper())

    if (match) and endCheck==True:
        frase=botName+": Grazie, a presto"
        print(frase)
        speaker.speak("Grazie, a presto")
        break

    if taken == False:
        frase=botName+": Non ho capito, puoi ripetere?"
        print(frase)
        speaker.speak("Non ho capito, puoi ripetere?")
        a=False
    if taken == True:
        agent.think_man(command)
        endCheck=True

62821d06cf1b6e5dd2cbece692978ba93596a820
<mask token>

<mask token>
speaker.speak('Ciao sono Sara, come posso aiutarla?')
print('Ciao sono ' + botName + ', come posso aiutarla?')
<mask token>
while a == False:
    command, taken = listener.listen()
    command = command.capitalize()
    match = ''
    for k in End:
        for i, interaction in enumerate(End[k]):
            match = re.search(interaction.upper(), command.upper())
    if match and endCheck == True:
        frase = botName + ': Grazie, a presto'
        print(frase)
        speaker.speak('Grazie, a presto')
        break
    if taken == False:
        frase = botName + ': Non ho capito, puoi ripetere?'
        print(frase)
        speaker.speak('Non ho capito, puoi ripetere?')
        a = False
    if taken == True:
        agent.think_man(command)
        endCheck = True

<mask token>
speaker = Speaker()
listener = Listener()
agent = Agent(speaker, listener)
botName = colored('Sara', 'yellow')
endCheck = False
speaker.speak('Ciao sono Sara, come posso aiutarla?')
print('Ciao sono ' + botName + ', come posso aiutarla?')
a = False
while a == False:
    command, taken = listener.listen()
    command = command.capitalize()
    match = ''
    for k in End:
        for i, interaction in enumerate(End[k]):
            match = re.search(interaction.upper(), command.upper())
    if match and endCheck == True:
        frase = botName + ': Grazie, a presto'
        print(frase)
        speaker.speak('Grazie, a presto')
        break
    if taken == False:
        frase = botName + ': Non ho capito, puoi ripetere?'
        print(frase)
        speaker.speak('Non ho capito, puoi ripetere?')
        a = False
    if taken == True:
        agent.think_man(command)
        endCheck = True

from speaker.speaker import Speaker
from listener.listener import Listener
from agent.agent import Agent
from colorama import init
from termcolor import colored
from agent.kb import *
import re
speaker = Speaker()
listener = Listener()
agent = Agent(speaker, listener)
botName = colored('Sara', 'yellow')
endCheck = False
speaker.speak('Ciao sono Sara, come posso aiutarla?')
print('Ciao sono ' + botName + ', come posso aiutarla?')
a = False
while a == False:
    command, taken = listener.listen()
    command = command.capitalize()
    match = ''
    for k in End:
        for i, interaction in enumerate(End[k]):
            match = re.search(interaction.upper(), command.upper())
    if match and endCheck == True:
        frase = botName + ': Grazie, a presto'
        print(frase)
        speaker.speak('Grazie, a presto')
        break
    if taken == False:
        frase = botName + ': Non ho capito, puoi ripetere?'
        print(frase)
        speaker.speak('Non ho capito, puoi ripetere?')
        a = False
    if taken == True:
        agent.think_man(command)
        endCheck = True

from speaker.speaker import Speaker
from listener.listener import Listener
from agent.agent import Agent
from colorama import init
from termcolor import colored
from agent.kb import *
import re
speaker = Speaker()
listener = Listener()
agent = Agent(speaker, listener)
botName=colored('Sara','yellow')
endCheck = False
speaker.speak('Ciao sono Sara, come posso aiutarla?')
print('Ciao sono '+botName+', come posso aiutarla?')
a=False

while a==False:
    command,taken=listener.listen()
    command = command.capitalize()
    match=''
    
    for k in End:
        for i, interaction in enumerate(End[k]):
            match = re.search(interaction.upper(),command.upper())

    if (match) and endCheck==True:
        frase=botName+": Grazie, a presto"
        print(frase)
        speaker.speak("Grazie, a presto")
        break

    if taken == False:
        frase=botName+": Non ho capito, puoi ripetere?"
        print(frase)
        speaker.speak("Non ho capito, puoi ripetere?")
        a=False
    if taken == True:
        agent.think_man(command)
        endCheck=True
