Spaces:
Sleeping
Sleeping
magic 8 ball
Browse files
app.py
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
responses = random.choices (["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
return random.choice (responses)
|
| 7 |
|
| 8 |
-
chatbot = gr.ChatInterface(
|
| 9 |
chatbot.launch()
|
| 10 |
|
| 11 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import random
|
| 3 |
|
| 4 |
+
def respond_magic_eight_ball(message, history):
|
| 5 |
+
responses = random.choices (["It is certain"
|
| 6 |
+
"It is decidedly so"
|
| 7 |
+
"Without a doubt"
|
| 8 |
+
"Yes, definitely"
|
| 9 |
+
"You may rely on it"
|
| 10 |
+
"As I see it, yes"
|
| 11 |
+
"Most likely"
|
| 12 |
+
"Outlook good"
|
| 13 |
+
"Yes"
|
| 14 |
+
"Signs point to yes"])
|
| 15 |
return random.choice (responses)
|
| 16 |
|
| 17 |
+
chatbot = gr.ChatInterface(respond_magic_eight_ball, type='messages')
|
| 18 |
chatbot.launch()
|
| 19 |
|
| 20 |
|