Spaces:
Running
Running
| <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> | |