santu24 commited on
Commit
ce83386
·
verified ·
1 Parent(s): eb9c16d

Update templates/rag.html

Browse files
Files changed (1) hide show
  1. templates/rag.html +30 -24
templates/rag.html CHANGED
@@ -1,26 +1,32 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>RAG Chat</title>
7
- </head>
8
- <body>
9
- <h1>RAG Chat</h1>
10
- <p>You can ask queries like "show me mobiles under 5000".</p>
11
 
12
- <!-- Chat History -->
13
- <div id="chat-history">
14
- {% for speaker, message in chat_history %}
15
- <p><strong>{{ speaker }}:</strong> {{ message }}</p>
16
- {% endfor %}
17
- </div>
18
 
19
- <!-- Input Form -->
20
- <form action="{{ url_for('rag_query') }}" method="POST">
21
- <label for="rag_input">Ask your RAG-based query:</label><br>
22
- <input type="text" id="rag_input" name="rag_input" required>
23
- <button type="submit">Send</button>
24
- </form>
25
- </body>
26
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends 'base.html' %}
2
+ {% block title %}
3
+ RAG Chat
4
+ {% endblock %}
 
 
 
 
 
 
5
 
6
+ {% block content %}
7
+ <h2>RAG Chat</h2>
8
+ <div class="border p-3 mb-3 bg-light">
9
+ <p>You can ask queries like "show me mobiles under 5000". We do a naive DB filter, then call Gemini 1.5 Flash. Chat history is in your session.</p>
10
+ </div>
 
11
 
12
+ <form method="POST" action="{{ url_for('rag_query') }}" style="max-width:600px;">
13
+ <div class="input-group mb-3">
14
+ <input type="text" class="form-control" name="rag_input" placeholder="Ask your RAG-based query..." />
15
+ <button type="submit" class="btn btn-primary">Send</button>
16
+ </div>
17
+ </form>
18
+
19
+ <div class="chat-history mt-4">
20
+ {% for speaker, msg in chat_history %}
21
+ {% if speaker == "user" %}
22
+ <div class="alert alert-secondary">
23
+ <strong>You:</strong> {{ msg }}
24
+ </div>
25
+ {% else %}
26
+ <div class="alert alert-info">
27
+ <strong>Assistant:</strong> {{ msg }}
28
+ </div>
29
+ {% endif %}
30
+ {% endfor %}
31
+ </div>
32
+ {% endblock %}