Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import random | |
| def echo(message, history): | |
| return echo | |
| def respond(message, history): | |
| return random.choice(["Yes", "No"]) | |
| def magic_8_ball(message, history): | |
| responses = [ | |
| "Without a doubt", | |
| "Outlook not so good", | |
| "Ask again later", | |
| "Definitely yes", | |
| "I wouldn't count on it", | |
| "Signs point to yes", | |
| "Very doubtful", | |
| "It is certain" | |
| ] | |
| return random.choice(responses) | |
| chatbot = gr.ChatInterface( | |
| fn = magic_8_ball, | |
| title = "Magic 8 Ball 🎱", | |
| description = "ask a yes of no question and get a mysterious answer!" | |
| ) | |
| chatbot.launch() |