Spaces:
Sleeping
Sleeping
Creating magic 8ball and filling in all responses and parameters
Browse files
app.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
+
def magic_8ball_answers(message, history):
|
| 5 |
+
responses = ['Ummm... try again','Most definitely!', 'All signs point to yes!', 'Don't count on it...', 'Ask again later.']
|
| 6 |
+
return random.choice(responses)
|
| 7 |
+
|
| 8 |
+
chatbot = gr.ChatInterface(magic_8ball_answers, type='messages',examples=["Should I go to work?", "Should I go on a walk?", "Should I ask my crush out?"], title="Magic 8-Ball", description="This chatbot will give you advice on a question, as a Magic 8-Ball does!")
|
| 9 |
+
chatbot.launch()
|