santu24's picture
Update templates/rag.html
ce83386 verified
raw
history blame contribute delete
970 Bytes
{% extends 'base.html' %}
{% block title %}
RAG Chat
{% endblock %}
{% block content %}
<h2>RAG Chat</h2>
<div class="border p-3 mb-3 bg-light">
<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>
</div>
<form method="POST" action="{{ url_for('rag_query') }}" style="max-width:600px;">
<div class="input-group mb-3">
<input type="text" class="form-control" name="rag_input" placeholder="Ask your RAG-based query..." />
<button type="submit" class="btn btn-primary">Send</button>
</div>
</form>
<div class="chat-history mt-4">
{% for speaker, msg in chat_history %}
{% if speaker == "user" %}
<div class="alert alert-secondary">
<strong>You:</strong> {{ msg }}
</div>
{% else %}
<div class="alert alert-info">
<strong>Assistant:</strong> {{ msg }}
</div>
{% endif %}
{% endfor %}
</div>
{% endblock %}