apascucci25 commited on
Commit
82215eb
·
verified ·
1 Parent(s): 6e6f8fa

convert to magic 8-ball

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,10 +1,16 @@
1
  import gradio as gr #need to import the libraries
2
  import random
3
 
4
- def respond_yes_no_randomly (message,history): #creating a variable so you need to define it
5
- responses = ["yes","no"]
6
- return random.choice(responses)
7
 
8
- chatbot = gr.ChatInterface(respond_yes_no_randomly, type = "messages",title = "yes or no bot", description = "this bot will answer your yes or no questions")
 
 
 
 
 
 
 
9
 
10
  chatbot.launch()
 
1
  import gradio as gr #need to import the libraries
2
  import random
3
 
4
+ #def echo(message,history):
5
+ # return message
 
6
 
7
+ #def respond_yes_no_randomly (message,history): #creating a variable so you need to define it
8
+ # responses = ["yes","no"]
9
+ # return random.choice(responses)
10
+
11
+ def magic_8_responses (message,history):
12
+ responses = ["yes, definitely", "it is certain", "most likely", "signs point towards yes", "outlook good", "don't count on it", "the streets say no", "very doubtful", "ask again later", "reply hazy, try again"]
13
+
14
+ chatbot = gr.ChatInterface(respond_yes_no_randomly, type = "messages",title = "magic 8-ball: online edition", description = "this bot will answer all of your questions")
15
 
16
  chatbot.launch()