ChatbotLab_Aug7 / app.py
Janec09's picture
Update app.py
abde855 verified
raw
history blame
1.3 kB
import gradio as gr
import random
def magic_8_ball(message, history):
return random.choice(['yes', 'no', 'maybe'])
#def yes_or_no(message, history):
# return random.choice(['Yes', 'No'])
#def echo(message, history):
# return message
print("Hello World!")
chatbot = gr.ChatInterface(magic_8_ball, title = "Magic 8 Ball", description = "Let's play magic 8 ball!", type = "messages")
#defining my chatbot so users can interact and see their conversation history and send new messages!
with gr.Blocks(theme = gr.themes.Soft(
primary_hue="purple",
secondary_hue="fuchsia",
neutral_hue = "gray",
text_size = "lg"
).set(
background_fill_primary='*neutral_200',
background_fill_secondary='*neutral_400',
background_fill_secondary_dark='*secondary_500',
border_color_accent='*secondary_400',
border_color_accent_dark='*secondary_800',
color_accent='*secondary_300',
color_accent_soft='*secondary_500',
color_accent_soft_dark='*secondary_400',
button_primary_background_fill='*secondary_500',
button_primary_background_fill_dark='*secondary_600'
)as demo:
chatbot = gr.ChatInterface(
fn=magic_8_ball,
title="Magic 8 Ball",
description="Let's play magic 8 ball!",
type="messages"
))
chatbot.launch()