riyamalshe commited on
Commit
f9ec712
·
verified ·
1 Parent(s): f916f41

added a magic 8 ball function with 9 different responses

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -9,5 +9,8 @@ def echo(message, history):
9
  def random_response(message, history):
10
  return random.choice(["Yes", "No"])
11
 
12
- chatbot = gr.ChatInterface(random_response, type = 'messages')
 
 
 
13
  chatbot.launch()
 
9
  def random_response(message, history):
10
  return random.choice(["Yes", "No"])
11
 
12
+ def magic_8_ball(message, history):
13
+ return random.choice(["It is certain", "Most likely", "Yes", "You may rely on it", "Ask again later", "Don't count on it", "My sources say no", "Cannot predict now", "Outlook not so good"])
14
+
15
+ chatbot = gr.ChatInterface(magic_8_ball, type = 'messages')
16
  chatbot.launch()