demetz commited on
Commit
a59bc9c
·
verified ·
1 Parent(s): 76a6bb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,13 +1,16 @@
1
- import gradio as gr
2
  import random
 
3
 
4
  def magicEight(message, history):
5
-
6
  answers = ["The outlook is good!", "No, sorry", "Maybe", "Ask me again"]
7
  message = random.choice(answers)
8
  return message
9
 
 
10
  chatbot = gr.ChatInterface(
11
- magicEight, chatbot="Welcome! Ask the Magic Eight Ball your question! 🎱", type="messages")
 
 
 
12
 
13
  chatbot.launch()
 
 
1
  import random
2
+ import gradio as gr
3
 
4
  def magicEight(message, history):
 
5
  answers = ["The outlook is good!", "No, sorry", "Maybe", "Ask me again"]
6
  message = random.choice(answers)
7
  return message
8
 
9
+ initial_message = [("assistant", "Welcome! Ask the Magic Eight Ball your question!")]
10
  chatbot = gr.ChatInterface(
11
+ magicEight,
12
+ chatbot=gr.Chatbot(value=initial_message),
13
+ type="messages"
14
+ )
15
 
16
  chatbot.launch()