File size: 1,355 Bytes
a6b265f
e7ae4a2
a6b265f
d71c663
a09c735
4205a70
 
 
 
 
e7ae4a2
74c836a
1dc00ae
69d0ca9
a6b265f
8e4da83
5fd84a6
 
869cd02
 
1089be0
5fd84a6
5c6d59d
2d989a3
5c6d59d
5dbbdca
5c6d59d
08ec799
5c6d59d
08b3622
5cf2418
08b3622
08ec799
5c6d59d
2d989a3
5c6d59d
 
 
698c24e
 
 
 
5fd84a6
8e4da83
5107d43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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_100',
        background_fill_secondary_dark='secondary_200',
        border_color_accent='*secondary_400',
        border_color_accent_dark='*secondary_400',
        color_accent='*secondary_600',
        color_accent_soft='*secondary_200',
        color_accent_soft_dark='*secondary_900',
        button_primary_background_fill='*secondary_100',
        button_primary_background_fill_dark='*secondary_300'
    )
     
) as demo:

    gr.ChatInterface(
        fn=magic_8_ball,
        title="Magic 8 Ball",
        description="Let's play magic 8 ball!",
        type="messages"
    )

demo.launch()