File size: 421 Bytes
15b6714
b9b3a15
15b6714
b9b3a15
 
 
 
 
 
 
 
 
 
15b6714
b9b3a15
 
 
6766f54
b9b3a15
15b6714
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
import random

responses = [
    "Without a doubt.",
    "Outlook not so good.",
    "Ask again later.",
    "Yes, definitely!",
    "My sources say no.",
    "Cannot predict now.",
    "Signs point to yes.",
    "Very doubtful."
]

def magic_8_ball(message, history):
    answer = random.choice(responses)
    return answer

chatbot = gr.ChatInterface(magic_8_ball, type="messages")

chatbot.launch()