Spaces:
Sleeping
Sleeping
Coding 8 ball function
Browse files
app.py
CHANGED
|
@@ -2,14 +2,22 @@ import gradio as gr
|
|
| 2 |
import random
|
| 3 |
# import lines go at the top! Any libraries I need to import go up here ^^
|
| 4 |
|
| 5 |
-
def
|
| 6 |
-
return random.choice(['
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# def echo(message, history):
|
| 9 |
# return message
|
| 10 |
|
| 11 |
print("Hello World!")
|
| 12 |
-
chatbot = gr.ChatInterface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# defining my chatbot so that the user can interact, see their conversation history and send new messages
|
| 14 |
|
| 15 |
chatbot.launch()
|
|
|
|
| 2 |
import random
|
| 3 |
# import lines go at the top! Any libraries I need to import go up here ^^
|
| 4 |
|
| 5 |
+
def magic_8_ball(message,history):
|
| 6 |
+
return random.choice(['Maybe', "I don't think so honey", "Yea right", "Absolutely!", "I can see that for you.", "ijbol"])
|
| 7 |
+
|
| 8 |
+
# def yes_or_no(message, history):
|
| 9 |
+
# return random.choice(['Yes', 'No'])
|
| 10 |
|
| 11 |
# def echo(message, history):
|
| 12 |
# return message
|
| 13 |
|
| 14 |
print("Hello World!")
|
| 15 |
+
chatbot = gr.ChatInterface(
|
| 16 |
+
magic_8_ball,
|
| 17 |
+
title="The Psychic Magic 8 Ball!",
|
| 18 |
+
description="Ask any yes or no question to learn your future",
|
| 19 |
+
type="messages"
|
| 20 |
+
)
|
| 21 |
# defining my chatbot so that the user can interact, see their conversation history and send new messages
|
| 22 |
|
| 23 |
chatbot.launch()
|