Spaces:
Sleeping
Sleeping
created magic 8 ball function
Browse files
app.py
CHANGED
|
@@ -2,15 +2,18 @@ import gradio as gr
|
|
| 2 |
import random
|
| 3 |
#import lines fo at the top! Any libraries I need to import go here
|
| 4 |
|
| 5 |
-
def
|
| 6 |
-
return random.choice(['Yes', "No"])
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
#def echo(message, history):
|
| 9 |
#return message
|
| 10 |
#a function that the user's message is repeated back to you
|
| 11 |
|
| 12 |
print("Hello World")
|
| 13 |
-
chatbot = gr.ChatInterface(
|
| 14 |
#defining my chatbot so that the user can interact and see their conversation history and send me messages
|
| 15 |
|
| 16 |
chatbot.launch()
|
|
|
|
| 2 |
import random
|
| 3 |
#import lines fo at the top! Any libraries I need to import go here
|
| 4 |
|
| 5 |
+
def magic_8_ball(message, history):
|
| 6 |
+
return random.choice(['Yes', "No","Try again", "Definitely", "Most likely not", "Without a doubt"])
|
| 7 |
+
|
| 8 |
+
#def yes_or_no(message, history):
|
| 9 |
+
#return random.choice(['Yes', "No"])
|
| 10 |
|
| 11 |
#def echo(message, history):
|
| 12 |
#return message
|
| 13 |
#a function that the user's message is repeated back to you
|
| 14 |
|
| 15 |
print("Hello World")
|
| 16 |
+
chatbot = gr.ChatInterface(magic_8_ball, type="messages")
|
| 17 |
#defining my chatbot so that the user can interact and see their conversation history and send me messages
|
| 18 |
|
| 19 |
chatbot.launch()
|