File size: 419 Bytes
367dde4
a59bc9c
ffd4434
367dde4
b4c9a83
367dde4
ecc358c
834791f
a59bc9c
3e35d25
a59bc9c
 
 
 
834791f
ffd4434
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import random
import gradio as gr

def magicEight(message, history):
    answers = ["The outlook is good!", "No, sorry", "Maybe", "Ask me again"]
    message = random.choice(answers)
    return message

initial_message = [("assistant", "Welcome! Ask the Magic Eight Ball your question!")]
chatbot = gr.ChatInterface(
    magicEight,
    chatbot=gr.Chatbot(value=initial_message),
    type="messages"
)

chatbot.launch()