forked from architkaila/Chat-With-Documents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml_chatbot_template.py
83 lines (68 loc) · 1.72 KB
/
html_chatbot_template.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
css = '''
<style>
.chat-message {
display: flex;
align-items: center;
padding: 1.5rem; border-radius: 0.5rem; margin-bottom: 1rem; display: flex
}
.chat-message.user {
background-color: #2b313e;
display: flex;
align-items: center;
justify-content: flex-end;
}
.chat-message.bot {
background-color: #475063
}
.chat-message .avatar {
width: 20%;
}
.chat-message .avatar img {
max-width: 78px;
max-height: 78px;
border-radius: 50%;
object-fit: cover;
}
.chat-message .message {
width: 80%;
padding: 0 1.5rem;
color: #fff;
order: 1;
}
.chat-message.user .avatar {
order: 2;
margin-left: 10px;
}
.avatar img {
max-height: 78px;
max-width: 78px;
border-radius: 50%;
object-fit: cover;
}
.bot .avatar {
margin-right: 10px;
}
.user .avatar {
margin-left: 10px;
order: 2;
}
.user .message {
order: 1;
}
'''
bot_template = '''
<div class="chat-message bot" style="display: flex; align-items: center;">
<div class="avatar" style="margin-right: 10px;">
<img src="https://raw.githubusercontent.com/architkaila/Chat-With-Documents/main/assets/chatbot.png" style="max-height: 78px; max-width: 78px; border-radius: 50%; object-fit: cover;">
</div>
<div class="message">{{MSG}}</div>
</div>
'''
user_template = '''
<div class="chat-message user" style="display: flex; align-items: center; justify-content: flex-end;">
<div class="message" style="order: 1;">{{MSG}}</div>
<div class="avatar" style="order: 2; margin-left: 10px;">
<img src="https://raw.githubusercontent.com/architkaila/Chat-With-Documents/main/assets/user.jpg" style="max-height: 78px; max-width: 78px; border-radius: 50%; object-fit: cover;">
</div>
</div>
'''