FirstChatBot / app.py
TeahReichenbaum's picture
MagicEightBall.py
1edb78d verified
raw
history blame
678 Bytes
import gradio as gr
import random
# def echo (message, hisotry)
# return (message)
# def yesNoRandom(message,history):
# repsonse=["yes","no"]
# return random.choice(repsonse)
# chatbot = gr.ChatInterface(yesNoRandom, type = "messages", title = "Yes or No Bot", description = "This chatbot randomly repsonds to questions with yes or no.")
def magicEightBall(message,history):
response=["It's certain", "Try Again", "Chances are low", "Yes", "no", "Unlikley", "likley","Ask later"]
return random.choice(response)
chatbot=gr.ChatInterface(magicEightBall, type="messages", title,"Magic eight Ball",theme='d8ahazard/material_design_rd')
chatbot.launch()