Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
| 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()
|