File size: 1,436 Bytes
7013b8d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import gradio as gr

# KEEP your respond() function and any other AI logic above this

theme = gr.themes.Soft(
    primary_hue="blue",
    secondary_hue="gray"
).set(
    button_primary_background_fill="linear-gradient(to right, #4285f4, #34a853)",
    border_radius="12px",
    font="Roboto",
    input_background_fill="#fff",
    background_fill_primary="#f1f3f4"
)

css = """
.gradio-container {
    font-family: 'Roboto', sans-serif;
    background-color: #f1f3f4;
    padding-top: 30px;
}

.gr-chatbot {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    padding: 20px;
    max-width: 700px;
    margin: auto;
}

.message.user {
    background-color: #d2e3fc;
    border-radius: 16px;
    padding: 12px;
    margin: 8px 0;
    align-self: flex-end;
    max-width: 80%;
}

.message.bot {
    background-color: #f1f3f4;
    border-radius: 16px;
    padding: 12px;
    margin: 8px 0;
    max-width: 80%;
}

.gr-text-input input {
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #ccc;
    font-size: 16px;
}
"""

# This is the new styled interface
chat = gr.ChatInterface(
    fn=respond,
    chatbot=gr.Chatbot(label="ONE AI").style(height=500, bubble_full_width=False),
    title="Chat with ONE",
    description="Your Gemini-styled AI chatbot.",
    theme=theme,
    css=css,
    submit_btn="Send",
    retry_btn="Try Again",
    stop_btn="Stop"
)

chat.launch()