tanyadhast commited on
Commit
67d4bf6
·
verified ·
1 Parent(s): b9e324f

created magic 8 ball function

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -2,15 +2,18 @@ import gradio as gr
2
  import random
3
  #import lines fo at the top! Any libraries I need to import go here
4
 
5
- def yes_or_no(message, history):
6
- return random.choice(['Yes', "No"])
 
 
 
7
 
8
  #def echo(message, history):
9
  #return message
10
  #a function that the user's message is repeated back to you
11
 
12
  print("Hello World")
13
- chatbot = gr.ChatInterface(yes_or_no, type="messages")
14
  #defining my chatbot so that the user can interact and see their conversation history and send me messages
15
 
16
  chatbot.launch()
 
2
  import random
3
  #import lines fo at the top! Any libraries I need to import go here
4
 
5
+ def magic_8_ball(message, history):
6
+ return random.choice(['Yes', "No","Try again", "Definitely", "Most likely not", "Without a doubt"])
7
+
8
+ #def yes_or_no(message, history):
9
+ #return random.choice(['Yes', "No"])
10
 
11
  #def echo(message, history):
12
  #return message
13
  #a function that the user's message is repeated back to you
14
 
15
  print("Hello World")
16
+ chatbot = gr.ChatInterface(magic_8_ball, type="messages")
17
  #defining my chatbot so that the user can interact and see their conversation history and send me messages
18
 
19
  chatbot.launch()