File size: 918 Bytes
79ad375
1745ba2
79ad375
 
1745ba2
324df93
1745ba2
 
 
79ad375
c9fe50f
0aeecbe
79ad375
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
import random #enables access to random library on python
# import lines go at the top! Any libraries I need to import go  up here ^^

def yes_or_no(message, history):
    return random.choice(['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'As I see it, yes', 'Most likely', 'Yes', 'Signs point to yes', 'Reply hazy, try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'My reply is no', 'My sources say no', 'Very doubtful'])

# def echo(message, history):
#     return message

print("Hello World!")
chatbot = gr.ChatInterface(yes_or_no, type="messages", title="Magic 8 Ball", description="This Magic 8-Ball is a novelty toy that provides answers to yes/no questions.", theme="soft")
# defining mt chatbot so that the user can interact and see their conversation history and send new messages

chatbot.launch()