Spaces:
Sleeping
Sleeping
File size: 6,067 Bytes
1f2ba2d |
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Query Answering System</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Poppins', sans-serif;
margin: 0;
padding: 0;
background-color: #121212;
color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
.container {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 1400px;
height: 100%;
}
.left-pane {
width: 45%;
background-color: #1f1f1f;
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
padding: 30px;
margin: 20px;
max-height: 90vh;
overflow-y: auto;
}
.right-pane {
width: 45%;
background-color: #1f1f1f;
border-radius: 10px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
padding: 30px;
margin: 20px;
max-height: 90vh;
overflow-y: auto;
position: sticky;
top: 0;
}
.header {
margin-bottom: 20px;
}
.header h1 {
font-size: 32px;
font-weight: 600;
margin-bottom: 10px;
color: #f5f5f5;
}
.header p {
font-size: 14px;
color: #bbb;
}
.form-group {
margin-bottom: 20px;
}
.form-group input[type="text"] {
width: 100%;
padding: 12px;
border: 2px solid #444;
background-color: #333;
color: #fff;
border-radius: 8px;
font-size: 16px;
transition: all 0.3s ease;
}
.form-group input[type="text"]:focus {
border-color: #007bff;
outline: none;
}
.form-group button {
padding: 12px 25px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 8px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease;
}
.form-group button:hover {
background-color: #0056b3;
}
.answer-section {
margin-top: 30px;
background-color: #333;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.answer-section h3 {
font-size: 22px;
font-weight: 600;
color: #f5f5f5;
}
.answer {
padding: 15px;
background-color: #444;
border-radius: 8px;
font-size: 16px;
white-space: pre-wrap;
color: #ddd;
}
.sources {
margin-top: 15px;
font-size: 14px;
color: #888;
}
.history-section {
margin-top: 30px;
background-color: #333;
padding: 20px;
border-radius: 8px;
}
.history-item {
margin-bottom: 15px;
background-color: #444;
padding: 15px;
border-radius: 8px;
}
.history-item .question {
font-weight: bold;
color: #f5f5f5;
}
.history-item .answer {
color: #ddd;
}
/* Responsive adjustments */
@media screen and (max-width: 768px) {
.container {
flex-direction: column;
width: 90%;
max-width: 600px;
}
.left-pane, .right-pane {
width: 100%;
margin: 10px 0;
}
.header h1 {
font-size: 28px;
}
.form-group input[type="text"],
.form-group button {
font-size: 14px;
}
.answer-section h3 {
font-size: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="left-pane">
<div class="header">
<h1>Document AI</h1>
<p>Enter a query and get an answer based on the stored context.</p>
</div>
<form method="POST" action="{{ url_for('chat') }}">
<div class="form-group">
<input type="text" name="query_text" placeholder="Enter your query" value="{{ query_text }}" required>
</div>
<div class="form-group">
<button type="submit">Submit</button>
</div>
</form>
{% if answer %}
<div class="answer-section">
<h3>Answer:</h3>
<div class="answer">{{ answer }}</div>
</div>
{% endif %}
</div>
<div class="right-pane">
<div class="header">
<h1>Previous Queries</h1>
</div>
<div class="history-section">
{% for question, answer in history %}
<div class="history-item">
<div class="question">{{ question }}</div>
<div class="answer">{{ answer }}</div>
</div>
{% endfor %}
</div>
</div>
</div>
</body>
</html>
|