Skip to content

Instantly share code, notes, and snippets.

@SharathHebbar
Created September 27, 2024 07:03
Show Gist options
  • Select an option

  • Save SharathHebbar/f05d1a2e02b5bb7ea2c7264ca6ffdb9b to your computer and use it in GitHub Desktop.

Select an option

Save SharathHebbar/f05d1a2e02b5bb7ea2c7264ca6ffdb9b to your computer and use it in GitHub Desktop.
Chat
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat, Summarize & Translate Bot</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
.entity {
font-weight: bold;
color: red;
}
</style>
</head>
<body class="bg-gray-100 text-gray-800">
<div class="container mx-auto p-6">
<h1 class="text-3xl font-bold text-center mb-6">Chat, Summarize & Translate Bot</h1>
<div class="bg-white p-6 rounded-lg shadow-lg max-w-xl mx-auto">
<!-- Chat Box -->
<div class="h-64 overflow-y-scroll border border-gray-300 rounded-md p-4 mb-4 bg-gray-100 space-y-4">
{% for message in conversation %}
<div class="bg-white p-4 border border-gray-200 rounded-md relative">
<p><strong>{{ message.sender }}:</strong> {{ message.message | safe }}</p> <!-- Safe to render HTML -->
</div>
{% endfor %}
</div>
<!-- Message Input Form -->
<form action="/" method="POST">
<textarea name="message" rows="3" placeholder="Type a message..." class="w-full p-4 border border-gray-300 rounded-md mb-4"></textarea>
<div class="flex justify-between items-center">
<input type="submit" value="Send" class="bg-indigo-500 text-white px-4 py-2 rounded-md cursor-pointer hover:bg-indigo-600" />
</div>
</form>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment