-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathresults.html
More file actions
111 lines (106 loc) · 3.47 KB
/
results.html
File metadata and controls
111 lines (106 loc) · 3.47 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Responses</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
color: #333;
}
.container {
width: 80%;
margin: 40px auto;
overflow: hidden;
}
header {
background: #50b3a2;
color: #ffffff;
padding: 30px 0;
text-align: center;
border-bottom: #e8491d 3px solid;
border-radius: 10px 10px 0 0;
}
.content {
padding: 20px;
background: #ffffff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 0 0 10px 10px;
}
.response {
background: #e2e2e2;
padding: 20px;
margin: 15px 0;
border-radius: 10px;
font-size: 20px;
line-height: 1.8;
white-space: pre-wrap;
}
h1 {
color: #ffffff;
font-size: 26px;
}
footer {
background: #50b3a2;
color: #ffffff;
text-align: center;
padding: 10px 0;
margin-top: 20px;
border-radius: 0 0 10px 10px;
}
a {
color: #e8491d;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.highlight {
background: #f9f871;
padding: 2px 5px;
border-radius: 5px;
font-weight: bold;
}
</style>
</head>
<body>
<header>
<div class="container">
<h1>LLM Responses</h1>
</div>
</header>
<div class="container">
<div class="content">
<div id="responses" class="response"></div>
</div>
</div>
<footer>
<p>© 2024 LLM Responses. All rights reserved.</p>
</footer>
<script>
async function fetchResponses() {
try {
const response = await fetch('question_final/data/llm_responses.txt');
const text = await response.text();
const responsesDiv = document.getElementById('responses');
const responses = text.split('\n').filter(line => line.trim() !== '');
let formattedResponse = responses.join('<br><br>');
// Making topics bold and highlighted
const topicsRegex = /(\bCGPA\b|\bCourses_Completed\b|\bPreferred_Field\b|\bLearning_Style\b|\bDSA_Marks\b|\bDBMS_Marks\b|\bML_Marks\b|\bMicrocontroller_Marks\b|\bcareer goals\b|\brelevant courses\b)/gi;
formattedResponse = formattedResponse.replace(topicsRegex, '<span class="highlight">$1</span>');
// Making links clickable
const linkRegex = /(https?:\/\/[^\s]+)/gi;
formattedResponse = formattedResponse.replace(linkRegex, '<a href="$1" target="_blank">$1</a>');
responsesDiv.innerHTML = formattedResponse;
} catch (error) {
console.error('Error fetching the responses:', error);
}
}
fetchResponses();
</script>
</body>
</html>