Skier8402 commited on
Commit
dbc0454
·
verified ·
1 Parent(s): 9802dad

Upload htmlTemplates.py

Browse files
Files changed (1) hide show
  1. htmlTemplates.py +52 -0
htmlTemplates.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """HTML/CSS templates used by the Streamlit UI.
2
+
3
+ Module constants are intentionally simple strings used in templates; disable
4
+ some naming/style checks for this module.
5
+ """
6
+
7
+ # pylint: disable=invalid-name,missing-module-docstring,line-too-long
8
+
9
+ css = """
10
+ <style>
11
+ .chat-message {
12
+ padding: 1.5rem; border-radius: 0.5rem; margin-bottom: 1rem; display: flex
13
+ }
14
+ .chat-message.user {
15
+ background-color: #2b313e
16
+ }
17
+ .chat-message.bot {
18
+ background-color: #475063
19
+ }
20
+ .chat-message .avatar {
21
+ width: 20%;
22
+ }
23
+ .chat-message .avatar img {
24
+ max-width: 78px;
25
+ max-height: 78px;
26
+ border-radius: 50%;
27
+ object-fit: cover;
28
+ }
29
+ .chat-message .message {
30
+ width: 80%;
31
+ padding: 0 1.5rem;
32
+ color: #fff;
33
+ }
34
+ """
35
+
36
+ bot_template = """
37
+ <div class="chat-message bot">
38
+ <div class="avatar">
39
+ <img src="/home/stormbird/Downloads/search_engine_tool/ask-multiple-pdfs/images/4352328-4402077159-Megas.png" style="max-height: 78px; max-width: 78px; border-radius: 50%; object-fit: cover;">
40
+ </div>
41
+ <div class="message">{{MSG}}</div>
42
+ </div>
43
+ """
44
+
45
+ user_template = """
46
+ <div class="chat-message user">
47
+ <div class="avatar">
48
+ <img src="/home/stormbird/Downloads/search_engine_tool/ask-multiple-pdfs/images/IMG_1476.png" style="max-height: 78px; max-width: 78px; border-radius: 50%; object-fit: cover;">
49
+ </div>
50
+ <div class="message">{{MSG}}</div>
51
+ </div>
52
+ """