Spaces:
Runtime error
Runtime error
Update templates/rag.html
Browse files- templates/rag.html +30 -24
templates/rag.html
CHANGED
|
@@ -1,26 +1,32 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 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 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
</div>
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 %}
|