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

def magic_8_ball(message, history):
    responses = [
        "Without a doubt.",
        "Yes, definitely.",
        "Ask again later.",
        "My sources say no.",
        "Outlook not so good.",
        "Signs point to yes.",
        "Cannot predict now.",
        "Very doubtful."
    ]
    
    return random.choice(responses)

chatbot = gr.ChatInterface(magic_8_ball)

chatbot.launch()