web 4 huggingface agewnt - Initial Deployment
Browse files- README.md +7 -5
- index.html +421 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: agent
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,421 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Web 4 HuggingFace Agent</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@keyframes pulse {
|
| 11 |
+
0%, 100% { opacity: 1; }
|
| 12 |
+
50% { opacity: 0.5; }
|
| 13 |
+
}
|
| 14 |
+
.typing-indicator {
|
| 15 |
+
display: inline-flex;
|
| 16 |
+
}
|
| 17 |
+
.typing-dot {
|
| 18 |
+
width: 8px;
|
| 19 |
+
height: 8px;
|
| 20 |
+
margin: 0 2px;
|
| 21 |
+
background-color: #6b7280;
|
| 22 |
+
border-radius: 50%;
|
| 23 |
+
animation: pulse 1.5s infinite ease-in-out;
|
| 24 |
+
}
|
| 25 |
+
.typing-dot:nth-child(1) { animation-delay: 0s; }
|
| 26 |
+
.typing-dot:nth-child(2) { animation-delay: 0.3s; }
|
| 27 |
+
.typing-dot:nth-child(3) { animation-delay: 0.6s; }
|
| 28 |
+
.message-enter {
|
| 29 |
+
animation: messageEnter 0.3s ease-out;
|
| 30 |
+
}
|
| 31 |
+
@keyframes messageEnter {
|
| 32 |
+
from { transform: translateY(10px); opacity: 0; }
|
| 33 |
+
to { transform: translateY(0); opacity: 1; }
|
| 34 |
+
}
|
| 35 |
+
.gradient-bg {
|
| 36 |
+
background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
|
| 37 |
+
}
|
| 38 |
+
.model-card:hover {
|
| 39 |
+
transform: translateY(-5px);
|
| 40 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 41 |
+
}
|
| 42 |
+
</style>
|
| 43 |
+
</head>
|
| 44 |
+
<body class="bg-gray-100 font-sans">
|
| 45 |
+
<div class="flex flex-col h-screen">
|
| 46 |
+
<!-- Header -->
|
| 47 |
+
<header class="gradient-bg text-white p-4 shadow-lg">
|
| 48 |
+
<div class="container mx-auto flex justify-between items-center">
|
| 49 |
+
<div class="flex items-center space-x-2">
|
| 50 |
+
<i class="fas fa-robot text-2xl"></i>
|
| 51 |
+
<h1 class="text-xl md:text-2xl font-bold">Web 4 HuggingFace Agent</h1>
|
| 52 |
+
</div>
|
| 53 |
+
<div class="flex items-center space-x-4">
|
| 54 |
+
<button id="settings-btn" class="p-2 rounded-full hover:bg-white hover:bg-opacity-20 transition">
|
| 55 |
+
<i class="fas fa-cog"></i>
|
| 56 |
+
</button>
|
| 57 |
+
<button id="models-btn" class="p-2 rounded-full hover:bg-white hover:bg-opacity-20 transition">
|
| 58 |
+
<i class="fas fa-brain"></i>
|
| 59 |
+
</button>
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
</header>
|
| 63 |
+
|
| 64 |
+
<!-- Main Content -->
|
| 65 |
+
<main class="flex-1 overflow-hidden flex flex-col md:flex-row">
|
| 66 |
+
<!-- Sidebar (hidden on mobile) -->
|
| 67 |
+
<aside class="hidden md:block w-64 bg-white border-r border-gray-200 p-4 overflow-y-auto">
|
| 68 |
+
<div class="mb-6">
|
| 69 |
+
<h2 class="font-semibold text-gray-700 mb-2">Recent Conversations</h2>
|
| 70 |
+
<ul class="space-y-1">
|
| 71 |
+
<li class="p-2 rounded hover:bg-gray-100 cursor-pointer">Getting Started</li>
|
| 72 |
+
<li class="p-2 rounded hover:bg-gray-100 cursor-pointer">Code Assistance</li>
|
| 73 |
+
<li class="p-2 rounded hover:bg-gray-100 cursor-pointer">Research Help</li>
|
| 74 |
+
</ul>
|
| 75 |
+
</div>
|
| 76 |
+
<div>
|
| 77 |
+
<h2 class="font-semibold text-gray-700 mb-2">Quick Actions</h2>
|
| 78 |
+
<button class="w-full mb-2 p-2 bg-blue-100 text-blue-700 rounded hover:bg-blue-200 transition flex items-center">
|
| 79 |
+
<i class="fas fa-plus mr-2"></i> New Chat
|
| 80 |
+
</button>
|
| 81 |
+
<button class="w-full p-2 bg-purple-100 text-purple-700 rounded hover:bg-purple-200 transition flex items-center">
|
| 82 |
+
<i class="fas fa-upload mr-2"></i> Upload Document
|
| 83 |
+
</button>
|
| 84 |
+
</div>
|
| 85 |
+
</aside>
|
| 86 |
+
|
| 87 |
+
<!-- Chat Area -->
|
| 88 |
+
<section class="flex-1 flex flex-col bg-white">
|
| 89 |
+
<!-- Messages Container -->
|
| 90 |
+
<div id="messages" class="flex-1 overflow-y-auto p-4 space-y-4">
|
| 91 |
+
<div class="message-enter flex">
|
| 92 |
+
<div class="flex-shrink-0 mr-3">
|
| 93 |
+
<div class="h-8 w-8 rounded-full bg-purple-500 flex items-center justify-center text-white">
|
| 94 |
+
<i class="fas fa-robot"></i>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="bg-gray-100 rounded-lg p-3 max-w-3xl">
|
| 98 |
+
<p>Hello! I'm your Web 4 HuggingFace Agent. How can I assist you today?</p>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<!-- Input Area -->
|
| 104 |
+
<div class="border-t border-gray-200 p-4">
|
| 105 |
+
<div class="flex items-center space-x-2">
|
| 106 |
+
<button class="p-2 text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100">
|
| 107 |
+
<i class="fas fa-paperclip"></i>
|
| 108 |
+
</button>
|
| 109 |
+
<div class="flex-1 relative">
|
| 110 |
+
<textarea id="user-input" rows="1" class="w-full border border-gray-300 rounded-full py-2 px-4 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent resize-none" placeholder="Type your message..."></textarea>
|
| 111 |
+
<button id="send-btn" class="absolute right-2 top-1/2 transform -translate-y-1/2 p-1 text-gray-500 hover:text-purple-600">
|
| 112 |
+
<i class="fas fa-paper-plane"></i>
|
| 113 |
+
</button>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
<p class="text-xs text-gray-500 mt-2 text-center">Web 4 HuggingFace Agent may produce inaccurate information about people, places, or facts.</p>
|
| 117 |
+
</div>
|
| 118 |
+
</section>
|
| 119 |
+
|
| 120 |
+
<!-- Models Panel (hidden by default) -->
|
| 121 |
+
<aside id="models-panel" class="hidden md:block w-72 bg-white border-l border-gray-200 p-4 overflow-y-auto">
|
| 122 |
+
<div class="flex justify-between items-center mb-4">
|
| 123 |
+
<h2 class="font-semibold text-lg">Available Models</h2>
|
| 124 |
+
<button id="close-models" class="p-1 rounded-full hover:bg-gray-100">
|
| 125 |
+
<i class="fas fa-times"></i>
|
| 126 |
+
</button>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<div class="space-y-4">
|
| 130 |
+
<div class="model-card bg-white border border-gray-200 rounded-lg p-4 shadow-sm transition cursor-pointer hover:border-purple-300">
|
| 131 |
+
<div class="flex items-center mb-2">
|
| 132 |
+
<div class="h-10 w-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 mr-3">
|
| 133 |
+
<i class="fas fa-language"></i>
|
| 134 |
+
</div>
|
| 135 |
+
<h3 class="font-medium">GPT-4</h3>
|
| 136 |
+
</div>
|
| 137 |
+
<p class="text-sm text-gray-600">Most capable model for complex tasks with better reasoning and instruction following.</p>
|
| 138 |
+
<div class="mt-3 flex justify-between items-center">
|
| 139 |
+
<span class="text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded-full">Default</span>
|
| 140 |
+
<span class="text-xs text-gray-500">Updated Jan 2024</span>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
<div class="model-card bg-white border border-gray-200 rounded-lg p-4 shadow-sm transition cursor-pointer hover:border-purple-300">
|
| 145 |
+
<div class="flex items-center mb-2">
|
| 146 |
+
<div class="h-10 w-10 rounded-full bg-green-100 flex items-center justify-center text-green-600 mr-3">
|
| 147 |
+
<i class="fas fa-bolt"></i>
|
| 148 |
+
</div>
|
| 149 |
+
<h3 class="font-medium">Claude 2</h3>
|
| 150 |
+
</div>
|
| 151 |
+
<p class="text-sm text-gray-600">Balanced between speed and capability, great for most everyday tasks.</p>
|
| 152 |
+
<div class="mt-3 flex justify-between items-center">
|
| 153 |
+
<span class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded-full">Available</span>
|
| 154 |
+
<span class="text-xs text-gray-500">Updated Dec 2023</span>
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<div class="model-card bg-white border border-gray-200 rounded-lg p-4 shadow-sm transition cursor-pointer hover:border-purple-300">
|
| 159 |
+
<div class="flex items-center mb-2">
|
| 160 |
+
<div class="h-10 w-10 rounded-full bg-purple-100 flex items-center justify-center text-purple-600 mr-3">
|
| 161 |
+
<i class="fas fa-code"></i>
|
| 162 |
+
</div>
|
| 163 |
+
<h3 class="font-medium">Llama 2</h3>
|
| 164 |
+
</div>
|
| 165 |
+
<p class="text-sm text-gray-600">Open weights model optimized for coding and technical tasks.</p>
|
| 166 |
+
<div class="mt-3 flex justify-between items-center">
|
| 167 |
+
<span class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded-full">Available</span>
|
| 168 |
+
<span class="text-xs text-gray-500">Updated Nov 2023</span>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<div class="model-card bg-white border border-gray-200 rounded-lg p-4 shadow-sm transition cursor-pointer hover:border-purple-300">
|
| 173 |
+
<div class="flex items-center mb-2">
|
| 174 |
+
<div class="h-10 w-10 rounded-full bg-yellow-100 flex items-center justify-center text-yellow-600 mr-3">
|
| 175 |
+
<i class="fas fa-image"></i>
|
| 176 |
+
</div>
|
| 177 |
+
<h3 class="font-medium">Stable Diffusion</h3>
|
| 178 |
+
</div>
|
| 179 |
+
<p class="text-sm text-gray-600">Image generation model for creating visuals from text prompts.</p>
|
| 180 |
+
<div class="mt-3 flex justify-between items-center">
|
| 181 |
+
<span class="text-xs px-2 py-1 bg-gray-100 text-gray-800 rounded-full">Available</span>
|
| 182 |
+
<span class="text-xs text-gray-500">Updated Oct 2023</span>
|
| 183 |
+
</div>
|
| 184 |
+
</div>
|
| 185 |
+
</div>
|
| 186 |
+
</aside>
|
| 187 |
+
|
| 188 |
+
<!-- Settings Panel (hidden by default) -->
|
| 189 |
+
<aside id="settings-panel" class="hidden md:block w-72 bg-white border-l border-gray-200 p-4 overflow-y-auto">
|
| 190 |
+
<div class="flex justify-between items-center mb-4">
|
| 191 |
+
<h2 class="font-semibold text-lg">Settings</h2>
|
| 192 |
+
<button id="close-settings" class="p-1 rounded-full hover:bg-gray-100">
|
| 193 |
+
<i class="fas fa-times"></i>
|
| 194 |
+
</button>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
+
<div class="space-y-6">
|
| 198 |
+
<div>
|
| 199 |
+
<h3 class="font-medium text-gray-700 mb-2">Appearance</h3>
|
| 200 |
+
<div class="flex space-x-2">
|
| 201 |
+
<button class="p-2 border border-gray-300 rounded-lg flex-1 hover:bg-gray-50">
|
| 202 |
+
<i class="fas fa-sun text-yellow-500 mb-1"></i>
|
| 203 |
+
<span class="block text-sm">Light</span>
|
| 204 |
+
</button>
|
| 205 |
+
<button class="p-2 border border-gray-300 rounded-lg flex-1 hover:bg-gray-50">
|
| 206 |
+
<i class="fas fa-moon text-indigo-500 mb-1"></i>
|
| 207 |
+
<span class="block text-sm">Dark</span>
|
| 208 |
+
</button>
|
| 209 |
+
<button class="p-2 border border-gray-300 rounded-lg flex-1 hover:bg-gray-50">
|
| 210 |
+
<i class="fas fa-adjust text-gray-500 mb-1"></i>
|
| 211 |
+
<span class="block text-sm">System</span>
|
| 212 |
+
</button>
|
| 213 |
+
</div>
|
| 214 |
+
</div>
|
| 215 |
+
|
| 216 |
+
<div>
|
| 217 |
+
<h3 class="font-medium text-gray-700 mb-2">Response Length</h3>
|
| 218 |
+
<select class="w-full border border-gray-300 rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 219 |
+
<option>Short</option>
|
| 220 |
+
<option selected>Medium</option>
|
| 221 |
+
<option>Long</option>
|
| 222 |
+
</select>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<div>
|
| 226 |
+
<h3 class="font-medium text-gray-700 mb-2">Model Behavior</h3>
|
| 227 |
+
<div class="space-y-2">
|
| 228 |
+
<label class="flex items-center space-x-2">
|
| 229 |
+
<input type="checkbox" class="rounded text-purple-600 focus:ring-purple-500">
|
| 230 |
+
<span>Creative responses</span>
|
| 231 |
+
</label>
|
| 232 |
+
<label class="flex items-center space-x-2">
|
| 233 |
+
<input type="checkbox" class="rounded text-purple-600 focus:ring-purple-500" checked>
|
| 234 |
+
<span>Provide sources</span>
|
| 235 |
+
</label>
|
| 236 |
+
<label class="flex items-center space-x-2">
|
| 237 |
+
<input type="checkbox" class="rounded text-purple-600 focus:ring-purple-500">
|
| 238 |
+
<span>Strict factual accuracy</span>
|
| 239 |
+
</label>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
|
| 243 |
+
<div>
|
| 244 |
+
<h3 class="font-medium text-gray-700 mb-2">Data & Privacy</h3>
|
| 245 |
+
<p class="text-sm text-gray-600 mb-3">We prioritize your privacy. Your conversations are not stored permanently.</p>
|
| 246 |
+
<button class="w-full p-2 bg-red-50 text-red-600 rounded-lg hover:bg-red-100 transition flex items-center justify-center">
|
| 247 |
+
<i class="fas fa-trash mr-2"></i> Clear Conversation History
|
| 248 |
+
</button>
|
| 249 |
+
</div>
|
| 250 |
+
</div>
|
| 251 |
+
</aside>
|
| 252 |
+
</main>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<!-- Mobile Bottom Navigation -->
|
| 256 |
+
<div class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 flex justify-around py-2">
|
| 257 |
+
<button class="p-2 text-gray-700 hover:text-purple-600 flex flex-col items-center">
|
| 258 |
+
<i class="fas fa-home"></i>
|
| 259 |
+
<span class="text-xs">Home</span>
|
| 260 |
+
</button>
|
| 261 |
+
<button id="mobile-models-btn" class="p-2 text-gray-700 hover:text-purple-600 flex flex-col items-center">
|
| 262 |
+
<i class="fas fa-brain"></i>
|
| 263 |
+
<span class="text-xs">Models</span>
|
| 264 |
+
</button>
|
| 265 |
+
<button class="p-2 text-gray-700 hover:text-purple-600 flex flex-col items-center">
|
| 266 |
+
<i class="fas fa-history"></i>
|
| 267 |
+
<span class="text-xs">History</span>
|
| 268 |
+
</button>
|
| 269 |
+
<button id="mobile-settings-btn" class="p-2 text-gray-700 hover:text-purple-600 flex flex-col items-center">
|
| 270 |
+
<i class="fas fa-cog"></i>
|
| 271 |
+
<span class="text-xs">Settings</span>
|
| 272 |
+
</button>
|
| 273 |
+
</div>
|
| 274 |
+
|
| 275 |
+
<script>
|
| 276 |
+
// DOM Elements
|
| 277 |
+
const messagesContainer = document.getElementById('messages');
|
| 278 |
+
const userInput = document.getElementById('user-input');
|
| 279 |
+
const sendBtn = document.getElementById('send-btn');
|
| 280 |
+
const settingsBtn = document.getElementById('settings-btn');
|
| 281 |
+
const modelsBtn = document.getElementById('models-btn');
|
| 282 |
+
const mobileSettingsBtn = document.getElementById('mobile-settings-btn');
|
| 283 |
+
const mobileModelsBtn = document.getElementById('mobile-models-btn');
|
| 284 |
+
const settingsPanel = document.getElementById('settings-panel');
|
| 285 |
+
const modelsPanel = document.getElementById('models-panel');
|
| 286 |
+
const closeSettings = document.getElementById('close-settings');
|
| 287 |
+
const closeModels = document.getElementById('close-models');
|
| 288 |
+
|
| 289 |
+
// Auto-resize textarea
|
| 290 |
+
userInput.addEventListener('input', function() {
|
| 291 |
+
this.style.height = 'auto';
|
| 292 |
+
this.style.height = (this.scrollHeight) + 'px';
|
| 293 |
+
});
|
| 294 |
+
|
| 295 |
+
// Send message function
|
| 296 |
+
function sendMessage() {
|
| 297 |
+
const message = userInput.value.trim();
|
| 298 |
+
if (message === '') return;
|
| 299 |
+
|
| 300 |
+
// Add user message
|
| 301 |
+
addMessage(message, 'user');
|
| 302 |
+
userInput.value = '';
|
| 303 |
+
userInput.style.height = 'auto';
|
| 304 |
+
|
| 305 |
+
// Show typing indicator
|
| 306 |
+
showTypingIndicator();
|
| 307 |
+
|
| 308 |
+
// Simulate AI response after a delay
|
| 309 |
+
setTimeout(() => {
|
| 310 |
+
removeTypingIndicator();
|
| 311 |
+
const responses = [
|
| 312 |
+
"I've analyzed your query and here's what I found...",
|
| 313 |
+
"That's an interesting question! Based on my knowledge...",
|
| 314 |
+
"I can help with that. Here's the information you requested...",
|
| 315 |
+
"Great question! The answer involves several considerations...",
|
| 316 |
+
"I understand what you're asking. Here's my response..."
|
| 317 |
+
];
|
| 318 |
+
const randomResponse = responses[Math.floor(Math.random() * responses.length)];
|
| 319 |
+
addMessage(randomResponse, 'ai');
|
| 320 |
+
}, 1500 + Math.random() * 2000);
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
// Add message to chat
|
| 324 |
+
function addMessage(text, sender) {
|
| 325 |
+
const messageDiv = document.createElement('div');
|
| 326 |
+
messageDiv.className = 'message-enter flex';
|
| 327 |
+
|
| 328 |
+
if (sender === 'user') {
|
| 329 |
+
messageDiv.innerHTML = `
|
| 330 |
+
<div class="flex-shrink-0 ml-3 order-last">
|
| 331 |
+
<div class="h-8 w-8 rounded-full bg-blue-500 flex items-center justify-center text-white">
|
| 332 |
+
<i class="fas fa-user"></i>
|
| 333 |
+
</div>
|
| 334 |
+
</div>
|
| 335 |
+
<div class="bg-blue-100 rounded-lg p-3 max-w-3xl ml-auto">
|
| 336 |
+
<p>${text}</p>
|
| 337 |
+
</div>
|
| 338 |
+
`;
|
| 339 |
+
} else {
|
| 340 |
+
messageDiv.innerHTML = `
|
| 341 |
+
<div class="flex-shrink-0 mr-3">
|
| 342 |
+
<div class="h-8 w-8 rounded-full bg-purple-500 flex items-center justify-center text-white">
|
| 343 |
+
<i class="fas fa-robot"></i>
|
| 344 |
+
</div>
|
| 345 |
+
</div>
|
| 346 |
+
<div class="bg-gray-100 rounded-lg p-3 max-w-3xl">
|
| 347 |
+
<p>${text}</p>
|
| 348 |
+
</div>
|
| 349 |
+
`;
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
messagesContainer.appendChild(messageDiv);
|
| 353 |
+
messagesContainer.scrollTop = messagesContainer.scrollHeight;
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
// Show typing indicator
|
| 357 |
+
function showTypingIndicator() {
|
| 358 |
+
const typingDiv = document.createElement('div');
|
| 359 |
+
typingDiv.className = 'flex';
|
| 360 |
+
typingDiv.innerHTML = `
|
| 361 |
+
<div class="flex-shrink-0 mr-3">
|
| 362 |
+
<div class="h-8 w-8 rounded-full bg-purple-500 flex items-center justify-center text-white">
|
| 363 |
+
<i class="fas fa-robot"></i>
|
| 364 |
+
</div>
|
| 365 |
+
</div>
|
| 366 |
+
<div class="bg-gray-100 rounded-lg p-3 w-16 flex items-center justify-center">
|
| 367 |
+
<div class="typing-indicator">
|
| 368 |
+
<div class="typing-dot"></div>
|
| 369 |
+
<div class="typing-dot"></div>
|
| 370 |
+
<div class="typing-dot"></div>
|
| 371 |
+
</div>
|
| 372 |
+
</div>
|
| 373 |
+
`;
|
| 374 |
+
typingDiv.id = 'typing-indicator';
|
| 375 |
+
messagesContainer.appendChild(typingDiv);
|
| 376 |
+
messagesContainer.scrollTop = messagesContainer.scrollHeight;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
// Remove typing indicator
|
| 380 |
+
function removeTypingIndicator() {
|
| 381 |
+
const typingIndicator = document.getElementById('typing-indicator');
|
| 382 |
+
if (typingIndicator) {
|
| 383 |
+
typingIndicator.remove();
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
// Event listeners
|
| 388 |
+
sendBtn.addEventListener('click', sendMessage);
|
| 389 |
+
userInput.addEventListener('keypress', function(e) {
|
| 390 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
| 391 |
+
e.preventDefault();
|
| 392 |
+
sendMessage();
|
| 393 |
+
}
|
| 394 |
+
});
|
| 395 |
+
|
| 396 |
+
// Toggle panels
|
| 397 |
+
function togglePanel(panel, otherPanel) {
|
| 398 |
+
if (panel.classList.contains('hidden')) {
|
| 399 |
+
panel.classList.remove('hidden');
|
| 400 |
+
if (!otherPanel.classList.contains('hidden')) {
|
| 401 |
+
otherPanel.classList.add('hidden');
|
| 402 |
+
}
|
| 403 |
+
} else {
|
| 404 |
+
panel.classList.add('hidden');
|
| 405 |
+
}
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
settingsBtn.addEventListener('click', () => togglePanel(settingsPanel, modelsPanel));
|
| 409 |
+
modelsBtn.addEventListener('click', () => togglePanel(modelsPanel, settingsPanel));
|
| 410 |
+
mobileSettingsBtn.addEventListener('click', () => togglePanel(settingsPanel, modelsPanel));
|
| 411 |
+
mobileModelsBtn.addEventListener('click', () => togglePanel(modelsPanel, settingsPanel));
|
| 412 |
+
closeSettings.addEventListener('click', () => settingsPanel.classList.add('hidden'));
|
| 413 |
+
closeModels.addEventListener('click', () => modelsPanel.classList.add('hidden'));
|
| 414 |
+
|
| 415 |
+
// Sample welcome message
|
| 416 |
+
setTimeout(() => {
|
| 417 |
+
addMessage("I can help with text generation, code explanation, research summarization, and more. What would you like to explore today?", 'ai');
|
| 418 |
+
}, 1000);
|
| 419 |
+
</script>
|
| 420 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=kaidjuric/agent" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 421 |
+
</html>
|