Spaces:
Sleeping
Sleeping
MagicEightBall.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,15 @@ import random
|
|
| 4 |
# def echo (message, hisotry)
|
| 5 |
# return (message)
|
| 6 |
|
| 7 |
-
def yesNoRandom(message,history):
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
-
chatbot = gr.ChatInterface(yesNoRandom, type = "messages", title = "Yes or No Bot", description = "This chatbot randomly repsonds to questions with yes or no.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
chatbot.launch()
|
|
|
|
| 4 |
# def echo (message, hisotry)
|
| 5 |
# return (message)
|
| 6 |
|
| 7 |
+
# def yesNoRandom(message,history):
|
| 8 |
+
# repsonse=["yes","no"]
|
| 9 |
+
# return random.choice(repsonse)
|
| 10 |
|
| 11 |
+
# chatbot = gr.ChatInterface(yesNoRandom, type = "messages", title = "Yes or No Bot", description = "This chatbot randomly repsonds to questions with yes or no.")
|
| 12 |
+
|
| 13 |
+
def magicEightBall(message,history)
|
| 14 |
+
response=["It's certain", "Try Again", "Chances are low", "Yes", "no", "Unlikley", "likley","Ask later"]
|
| 15 |
+
return random.choice(response)
|
| 16 |
+
chatbot=gr.ChatInterface(magicEightBall, type="messages", title,"Magic eight Ball",theme='d8ahazard/material_design_rd')
|
| 17 |
|
| 18 |
chatbot.launch()
|