Spaces:
Sleeping
Sleeping
create eight_ball
Browse files
app.py
CHANGED
|
@@ -6,8 +6,13 @@ def echo(message, history):
|
|
| 6 |
print(history)
|
| 7 |
return message
|
| 8 |
|
| 9 |
-
def
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
chatbot.launch()
|
|
|
|
| 6 |
print(history)
|
| 7 |
return message
|
| 8 |
|
| 9 |
+
def eight_ball(message, history):
|
| 10 |
+
affirmative_messages=["it is certain", "it is decidedly so", "without a doubt", "yes definitely", "you may rely on it", "as I see it, yes", "most likely", "outlook good", "yes", "signs point to yes"]
|
| 11 |
+
neutral_messages=["reply hazy", "try again", "ask again later", "better not tell you now", "cannot predict now", "concentrate and ask again"]
|
| 12 |
+
negative_messages=["don't count on it", "my reply is no", "my sources say no", "outlook not so good", "very doubtful"]
|
| 13 |
|
| 14 |
+
all_messages=affirmative_messages+neutral_messages+negative_messages
|
| 15 |
+
return random.choice(all_messages)
|
| 16 |
+
|
| 17 |
+
chatbot = gr.ChatInterface(eight_ball, type='messages')
|
| 18 |
chatbot.launch()
|