mingbaer commited on
Commit
a00b76e
·
verified ·
1 Parent(s): 5e159a7

Coding 8 ball function

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -2,14 +2,22 @@ import gradio as gr
2
  import random
3
  # import lines go at the top! Any libraries I need to import go up 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
 
11
  print("Hello World!")
12
- chatbot = gr.ChatInterface(yes_or_no, type="messages")
 
 
 
 
 
13
  # defining my chatbot so that the user can interact, see their conversation history and send new messages
14
 
15
  chatbot.launch()
 
2
  import random
3
  # import lines go at the top! Any libraries I need to import go up here ^^
4
 
5
+ def magic_8_ball(message,history):
6
+ return random.choice(['Maybe', "I don't think so honey", "Yea right", "Absolutely!", "I can see that for you.", "ijbol"])
7
+
8
+ # def yes_or_no(message, history):
9
+ # return random.choice(['Yes', 'No'])
10
 
11
  # def echo(message, history):
12
  # return message
13
 
14
  print("Hello World!")
15
+ chatbot = gr.ChatInterface(
16
+ magic_8_ball,
17
+ title="The Psychic Magic 8 Ball!",
18
+ description="Ask any yes or no question to learn your future",
19
+ type="messages"
20
+ )
21
  # defining my chatbot so that the user can interact, see their conversation history and send new messages
22
 
23
  chatbot.launch()