File size: 441 Bytes
a52133d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d1d6f2a
 
a52133d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

def chatbot(text):
    if text == "Olá":
        return "Olá! Como posso ajudar?"
    elif text == "Como você está?":
        return "Estou bem, obrigado!"
    else:
        return "Não entendi. Pode repetir?"

demo = gradio.Interface(
    fn=chatbot,
    inputs="text",
    outputs="text",
    title="Meu Chatbot",
    description="Um chatbot simples para conversar"
)

if __name__ == "__main__":
    demo.launch()