Spaces:
Running
Running
Update application/templates/index.html
Browse files- application/templates/index.html +443 -11
application/templates/index.html
CHANGED
@@ -7,10 +7,405 @@
|
|
7 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
8 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet">
|
9 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap" rel="stylesheet">
|
10 |
-
|
11 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
13 |
-
|
14 |
<title>Chat Completion Demo</title>
|
15 |
</head>
|
16 |
<body>
|
@@ -27,25 +422,62 @@
|
|
27 |
<div class="prevChatsCont" id="prevChatsCont">
|
28 |
</div>
|
29 |
</div>
|
30 |
-
|
31 |
</nav>
|
32 |
<div class="container" id="container">
|
33 |
<div class="messages" id="messages">
|
|
|
34 |
</div>
|
35 |
<div class="inputs">
|
36 |
<button id="webSearch" class="webSearch"><i class="fa-solid fa-globe"></i></button>
|
37 |
-
|
38 |
<textarea name="" id="textBox" class="textBox" placeholder="Enter your message..."></textarea>
|
39 |
<button id="sendBtn" class="sendBtn"><i class="fa-solid fa-arrow-up"></i></button>
|
40 |
</div>
|
41 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
</body>
|
51 |
</html>
|
|
|
7 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
8 |
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet">
|
9 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700&display=swap" rel="stylesheet">
|
|
|
10 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/atom-one-dark.min.css">
|
11 |
+
<style>
|
12 |
+
::-webkit-scrollbar {
|
13 |
+
width: 12px;
|
14 |
+
}
|
15 |
+
|
16 |
+
::-webkit-scrollbar-track {
|
17 |
+
background: transparent;
|
18 |
+
}
|
19 |
+
|
20 |
+
::-webkit-scrollbar-thumb {
|
21 |
+
background: rgb(43, 43, 43);
|
22 |
+
border-radius: 6px;
|
23 |
+
}
|
24 |
+
|
25 |
+
::-webkit-scrollbar-thumb:hover {
|
26 |
+
background: rgb(119, 119, 119);
|
27 |
+
}
|
28 |
+
html,body{
|
29 |
+
padding: 0;
|
30 |
+
margin: 0;
|
31 |
+
background-color: rgb(2,2,8);
|
32 |
+
width: 100vw;
|
33 |
+
height: 100vh;
|
34 |
+
overflow: hidden;
|
35 |
+
scrollbar-width: thin;
|
36 |
+
scrollbar-color: rgb(41, 41, 41) transparent;
|
37 |
+
font-family: 'Inter';
|
38 |
+
|
39 |
+
}
|
40 |
+
nav{
|
41 |
+
position: fixed;
|
42 |
+
width: 100vw;
|
43 |
+
height: 8vh;
|
44 |
+
z-index: 100;
|
45 |
+
display: flex;
|
46 |
+
}
|
47 |
+
.hamburger{
|
48 |
+
display: flex;
|
49 |
+
flex-direction: column;
|
50 |
+
gap: 1.5vh;
|
51 |
+
width: 20vh;
|
52 |
+
color: white;
|
53 |
+
margin: 1vw;
|
54 |
+
cursor: pointer;
|
55 |
+
position: absolute;
|
56 |
+
z-index: 101;
|
57 |
+
margin: 10px;
|
58 |
+
}
|
59 |
+
.line1{
|
60 |
+
background-color: rgb(122, 122, 122);
|
61 |
+
width: 6vh;
|
62 |
+
height: 0.5vh;
|
63 |
+
}
|
64 |
+
.line2{
|
65 |
+
background-color: rgb(104, 104, 104);
|
66 |
+
width: 3vh;
|
67 |
+
height: 0.5vh;
|
68 |
+
}
|
69 |
+
|
70 |
+
.hamburger:hover .line1{
|
71 |
+
transform: translateX(-30px);
|
72 |
+
transition: transform 1s ease;
|
73 |
+
}
|
74 |
+
.hamburger:hover .line2{
|
75 |
+
transform: translateX(30px);
|
76 |
+
transition: transform 1s ease;
|
77 |
+
}
|
78 |
+
.menu{
|
79 |
+
height: 100vh;
|
80 |
+
width: 0px;
|
81 |
+
background-color: rgba(20, 20, 20,0.5);
|
82 |
+
border-radius: 10px;
|
83 |
+
position: fixed;
|
84 |
+
top: 0;
|
85 |
+
left: 0;
|
86 |
+
display: flex;
|
87 |
+
flex-direction: column;
|
88 |
+
overflow-y: auto;
|
89 |
+
}
|
90 |
+
.newChat{
|
91 |
+
margin-top: 8vh;
|
92 |
+
margin-left: 1vw;
|
93 |
+
color: gray;
|
94 |
+
font-size: large;
|
95 |
+
cursor: pointer;
|
96 |
+
font-weight: 400;
|
97 |
+
position: relative;
|
98 |
+
font-size: large;
|
99 |
+
}
|
100 |
+
.newChat:hover{
|
101 |
+
transform: scale(0.95);
|
102 |
+
transition: transform 0.7s ease;
|
103 |
+
}
|
104 |
+
.prevChatsCont{
|
105 |
+
color: rgb(172, 171, 171);
|
106 |
+
margin-left: 1vw;
|
107 |
+
font-weight: 300;
|
108 |
+
display: flex;
|
109 |
+
flex-direction: column;
|
110 |
+
gap: 1vh;
|
111 |
+
position: relative;
|
112 |
+
font-size: medium;
|
113 |
+
|
114 |
+
}
|
115 |
+
.prevChat{
|
116 |
+
min-height: 5vh;
|
117 |
+
cursor: pointer;
|
118 |
+
width: 90%;
|
119 |
+
display: flex;
|
120 |
+
align-items: center;
|
121 |
+
padding-left: 5%;
|
122 |
+
border-radius: 10px;
|
123 |
+
overflow: hidden;
|
124 |
+
padding-top: 1%;
|
125 |
+
padding-bottom: 1%;
|
126 |
+
position: relative;
|
127 |
+
}
|
128 |
+
.prevChat:hover{
|
129 |
+
background-color: rgba(70,70, 70,1);
|
130 |
+
transform: translateY(5px);
|
131 |
+
transition: transform 0.8s ease;
|
132 |
+
}
|
133 |
+
.chatsTxt{
|
134 |
+
color: #fdffdf;
|
135 |
+
margin-left: 1vw;
|
136 |
+
font-size: 14px;
|
137 |
+
margin-top: 4vh;
|
138 |
+
margin-bottom: 3vh;
|
139 |
+
z-index: 100;
|
140 |
+
overflow: hidden;
|
141 |
+
min-height: 5vh;
|
142 |
+
display: flex;
|
143 |
+
align-items: center;
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
.container {
|
148 |
+
width: 99.5%;
|
149 |
+
max-width: 99.5%;
|
150 |
+
height: 90%;
|
151 |
+
position: absolute;
|
152 |
+
z-index: 50;
|
153 |
+
top: 8vh;
|
154 |
+
display: flex;
|
155 |
+
flex-direction: column;
|
156 |
+
justify-content: flex-end;
|
157 |
+
z-index: 1;
|
158 |
+
}
|
159 |
+
|
160 |
+
.inputs {
|
161 |
+
width: 70%;
|
162 |
+
display: flex;
|
163 |
+
flex-direction: row;
|
164 |
+
justify-content: space-between;
|
165 |
+
align-items: center;
|
166 |
+
background-color: rgba(51, 51, 51, 0.4);
|
167 |
+
padding: 10px;
|
168 |
+
border-top-right-radius: 50px;
|
169 |
+
border-bottom-left-radius: 20px;
|
170 |
+
border-top-left-radius: 20px;
|
171 |
+
border-bottom-right-radius: 50px;
|
172 |
+
font-size: large;
|
173 |
+
position: relative;
|
174 |
+
margin-top: auto;
|
175 |
+
align-self: center;
|
176 |
+
|
177 |
+
}
|
178 |
+
|
179 |
+
.textBox{
|
180 |
+
width: 90%;
|
181 |
+
background: none;
|
182 |
+
outline: none;
|
183 |
+
border: none;
|
184 |
+
color: rgb(161, 161, 161);
|
185 |
+
padding: 7px;
|
186 |
+
}
|
187 |
+
.sendBtn{
|
188 |
+
background-color: white;
|
189 |
+
border: none;
|
190 |
+
color: black;
|
191 |
+
font-size: x-large;
|
192 |
+
cursor: pointer;
|
193 |
+
border-radius: 50%;
|
194 |
+
width: 6vh;
|
195 |
+
height: 6vh;
|
196 |
+
}
|
197 |
+
.messages {
|
198 |
+
overflow-y: auto;
|
199 |
+
color: white;
|
200 |
+
padding: 10px;
|
201 |
+
display: flex;
|
202 |
+
flex-direction: column;
|
203 |
+
position: relative;
|
204 |
+
}
|
205 |
+
.user{
|
206 |
+
margin-left: auto;
|
207 |
+
max-width: 60%;
|
208 |
+
background-color: rgba(51, 51, 51, 0.4);
|
209 |
+
padding: 0.5vh 1.5vh 0.5vh 1.5vh;
|
210 |
+
text-align: left;
|
211 |
+
font-weight: 300;
|
212 |
+
border-radius: 10px;
|
213 |
+
line-height: 130%;
|
214 |
+
|
215 |
+
}
|
216 |
+
.user p{
|
217 |
+
color: #b4b4b4;
|
218 |
+
padding: 0;
|
219 |
+
opacity: 0.9;
|
220 |
+
}
|
221 |
+
.ai{
|
222 |
+
text-align: left;
|
223 |
+
width: 70%;
|
224 |
+
margin-left: auto;
|
225 |
+
margin-right: auto;
|
226 |
+
margin-top: 2vh;
|
227 |
+
}
|
228 |
+
.ai p {
|
229 |
+
opacity: 0.9;
|
230 |
+
font-weight: 300;
|
231 |
+
font-size: medium;
|
232 |
+
line-height: 1.6;
|
233 |
+
color: #c5c5c5;
|
234 |
+
background-color: rgba(28, 28, 28, 0.5);
|
235 |
+
padding: 20px;
|
236 |
+
border-radius: 10px;
|
237 |
+
border: 2px solid rgba(255,255,255,0.1);
|
238 |
+
font-family: 'Inter';
|
239 |
+
}
|
240 |
+
|
241 |
+
.subHeading,.heading{
|
242 |
+
padding: 1vh;
|
243 |
+
border-radius: 10px;
|
244 |
+
display: inline-block;
|
245 |
+
margin-bottom: 2vh;
|
246 |
+
margin-top: 2vh;
|
247 |
+
}
|
248 |
+
.subHeading{
|
249 |
+
background-color: rgba(59, 59, 59, 0.5);
|
250 |
+
border: 1px solid rgba(255,255,255,0.1)
|
251 |
+
}
|
252 |
+
.heading{
|
253 |
+
background-color: rgba(119, 16, 238, 0.55);
|
254 |
+
box-shadow: 6px 6px rgba(0, 0, 0, 0.5) ;
|
255 |
+
}
|
256 |
+
|
257 |
+
code{
|
258 |
+
border-radius: 15px;
|
259 |
+
}
|
260 |
+
.models{
|
261 |
+
position: relative;
|
262 |
+
margin: auto;
|
263 |
+
padding: 10px ;
|
264 |
+
outline: none;
|
265 |
+
background-color: rgb(43, 43, 43);
|
266 |
+
color: rgb(177, 177, 177);
|
267 |
+
border: none;
|
268 |
+
border-radius: 10px;
|
269 |
+
}
|
270 |
+
.models:hover{
|
271 |
+
background-color: #383838;
|
272 |
+
}
|
273 |
+
.models option{
|
274 |
+
background-color: rgb(34, 34, 34);
|
275 |
+
color: #afafaf;
|
276 |
+
padding: 10px;
|
277 |
+
}
|
278 |
+
.alert{
|
279 |
+
position: absolute;
|
280 |
+
top: 50%;
|
281 |
+
left: 50%;
|
282 |
+
transform: translate(-50%,-50%);
|
283 |
+
width: 320px;
|
284 |
+
height: 320px;
|
285 |
+
display: flex;
|
286 |
+
flex-direction: column;
|
287 |
+
gap: 0px;
|
288 |
+
color: #d8d8d8;
|
289 |
+
background-color: #222222;
|
290 |
+
box-shadow: 6px 6px rgb(41, 41, 41) ;
|
291 |
+
justify-content: center;
|
292 |
+
z-index: 100;
|
293 |
+
}
|
294 |
+
.alert p{
|
295 |
+
float: left;
|
296 |
+
font-family: 'Inter';
|
297 |
+
font-weight: 300;
|
298 |
+
font-size: 15px;
|
299 |
+
color: #cfcfcf;
|
300 |
+
opacity: 0.9;
|
301 |
+
padding-left: 10px;
|
302 |
+
}
|
303 |
+
.closeAlert{
|
304 |
+
margin-left: auto;
|
305 |
+
margin-right: 10px;
|
306 |
+
margin-top: 10px;
|
307 |
+
background-color: rgb(247, 102, 102);
|
308 |
+
padding: 10px;
|
309 |
+
cursor: pointer;
|
310 |
+
border-radius: 10px;
|
311 |
+
color: #ffffff;
|
312 |
+
}
|
313 |
+
.discord {
|
314 |
+
margin: 10px;
|
315 |
+
text-decoration: none;
|
316 |
+
color: rgb(211, 211, 211);
|
317 |
+
padding: 7.5px;
|
318 |
+
border-radius: 10px;
|
319 |
+
background: linear-gradient(to right, #4A148C, #9c18e3);
|
320 |
+
cursor: pointer;
|
321 |
+
display: inline-block;
|
322 |
+
font-size: 13px;
|
323 |
+
max-width: 77px;
|
324 |
+
}
|
325 |
+
.note{
|
326 |
+
text-align: center;
|
327 |
+
background-color: rgba(119, 16, 238, 0.55);
|
328 |
+
box-shadow: 6px 6px rgb(32, 32, 32) ;
|
329 |
+
margin: auto;
|
330 |
+
width: 70px;
|
331 |
+
padding: 10px;
|
332 |
+
}
|
333 |
+
.webSearch{
|
334 |
+
color: rgb(233, 233, 233);
|
335 |
+
background: transparent;
|
336 |
+
cursor: pointer;
|
337 |
+
border: none;
|
338 |
+
font-size: x-large;
|
339 |
+
}
|
340 |
+
|
341 |
+
@media screen and (max-width: 780px){
|
342 |
+
.menu{
|
343 |
+
background-color: rgba(20, 20, 20);
|
344 |
+
}
|
345 |
+
.inputs{
|
346 |
+
width: 85%;
|
347 |
+
}
|
348 |
+
.ai{
|
349 |
+
width: 90%;
|
350 |
+
}
|
351 |
+
.user{
|
352 |
+
max-width: 90%;
|
353 |
+
}
|
354 |
+
}
|
355 |
+
/* New styles for thinking section */
|
356 |
+
.thinking-container {
|
357 |
+
background: rgba(30, 30, 30, 0.7);
|
358 |
+
border-radius: 8px;
|
359 |
+
margin: 10px 0;
|
360 |
+
overflow: hidden;
|
361 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
362 |
+
}
|
363 |
+
|
364 |
+
.thinking-header {
|
365 |
+
display: flex;
|
366 |
+
align-items: center;
|
367 |
+
padding: 10px 15px;
|
368 |
+
cursor: pointer;
|
369 |
+
background: rgba(119, 16, 238, 0.2);
|
370 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
371 |
+
}
|
372 |
+
|
373 |
+
.thinking-header:hover {
|
374 |
+
background: rgba(119, 16, 238, 0.3);
|
375 |
+
}
|
376 |
+
|
377 |
+
.thinking-title {
|
378 |
+
color: #fdffdf;
|
379 |
+
font-size: 14px;
|
380 |
+
margin-right: 10px;
|
381 |
+
}
|
382 |
+
|
383 |
+
.thinking-arrow {
|
384 |
+
margin-left: auto;
|
385 |
+
transition: transform 0.3s ease;
|
386 |
+
}
|
387 |
+
|
388 |
+
.thinking-arrow.open {
|
389 |
+
transform: rotate(180deg);
|
390 |
+
}
|
391 |
+
|
392 |
+
.thinking-content {
|
393 |
+
padding: 15px;
|
394 |
+
color: #c5c5c5;
|
395 |
+
font-size: 14px;
|
396 |
+
line-height: 1.5;
|
397 |
+
max-height: 0;
|
398 |
+
overflow: hidden;
|
399 |
+
transition: max-height 0.3s ease-out;
|
400 |
+
}
|
401 |
+
|
402 |
+
.thinking-content.open {
|
403 |
+
max-height: 500px;
|
404 |
+
transition: max-height 0.5s ease-in;
|
405 |
+
}
|
406 |
+
</style>
|
407 |
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
408 |
+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
409 |
<title>Chat Completion Demo</title>
|
410 |
</head>
|
411 |
<body>
|
|
|
422 |
<div class="prevChatsCont" id="prevChatsCont">
|
423 |
</div>
|
424 |
</div>
|
|
|
425 |
</nav>
|
426 |
<div class="container" id="container">
|
427 |
<div class="messages" id="messages">
|
428 |
+
<!-- Messages will be inserted here -->
|
429 |
</div>
|
430 |
<div class="inputs">
|
431 |
<button id="webSearch" class="webSearch"><i class="fa-solid fa-globe"></i></button>
|
|
|
432 |
<textarea name="" id="textBox" class="textBox" placeholder="Enter your message..."></textarea>
|
433 |
<button id="sendBtn" class="sendBtn"><i class="fa-solid fa-arrow-up"></i></button>
|
434 |
</div>
|
435 |
</div>
|
436 |
+
<script>
|
437 |
+
// Add this to your existing JavaScript or create a new script
|
438 |
+
function createThinkingElement(thinkingContent) {
|
439 |
+
const container = document.createElement('div');
|
440 |
+
container.className = 'thinking-container';
|
441 |
+
|
442 |
+
const header = document.createElement('div');
|
443 |
+
header.className = 'thinking-header';
|
444 |
+
|
445 |
+
const title = document.createElement('span');
|
446 |
+
title.className = 'thinking-title';
|
447 |
+
title.textContent = 'Reasoning about it';
|
448 |
+
|
449 |
+
const arrow = document.createElement('i');
|
450 |
+
arrow.className = 'fa-solid fa-chevron-down thinking-arrow';
|
451 |
+
|
452 |
+
const content = document.createElement('div');
|
453 |
+
content.className = 'thinking-content';
|
454 |
+
content.textContent = thinkingContent;
|
455 |
+
|
456 |
+
header.appendChild(title);
|
457 |
+
header.appendChild(arrow);
|
458 |
+
container.appendChild(header);
|
459 |
+
container.appendChild(content);
|
460 |
+
|
461 |
+
header.addEventListener('click', () => {
|
462 |
+
arrow.classList.toggle('open');
|
463 |
+
content.classList.toggle('open');
|
464 |
+
});
|
465 |
+
|
466 |
+
return container;
|
467 |
+
}
|
468 |
|
469 |
+
// Example usage in your message processing logic:
|
470 |
+
function processMessage(message) {
|
471 |
+
const thinkMatch = message.match(/<think>(.*?)<\/think>/s);
|
472 |
+
if (thinkMatch) {
|
473 |
+
const thinkingContent = thinkMatch[1].trim();
|
474 |
+
const thinkingElement = createThinkingElement(thinkingContent);
|
475 |
+
// Insert the thinking element into your message container
|
476 |
+
document.getElementById('messages').appendChild(thinkingElement);
|
477 |
+
}
|
478 |
+
}
|
479 |
+
</script>
|
480 |
+
<script src="{{ url_for('static', filename='js/script.js') }}" type="module"></script>
|
481 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
|
482 |
</body>
|
483 |
</html>
|