khajavalishaik commited on
Commit
65cc19a
·
verified ·
1 Parent(s): b02f114

Build ai agent - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +354 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Ai Agent
3
- emoji:
4
- colorFrom: gray
5
- colorTo: blue
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: ai-agent
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: yellow
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,354 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>AI Agent Interface</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
+ /* Custom animations */
11
+ @keyframes fadeIn {
12
+ from { opacity: 0; transform: translateY(10px); }
13
+ to { opacity: 1; transform: translateY(0); }
14
+ }
15
+
16
+ @keyframes pulse {
17
+ 0%, 100% { opacity: 1; }
18
+ 50% { opacity: 0.5; }
19
+ }
20
+
21
+ .animate-fade-in {
22
+ animation: fadeIn 0.3s ease-out forwards;
23
+ }
24
+
25
+ .animate-pulse {
26
+ animation: pulse 1.5s infinite;
27
+ }
28
+
29
+ /* Custom scrollbar */
30
+ .custom-scrollbar::-webkit-scrollbar {
31
+ width: 6px;
32
+ }
33
+
34
+ .custom-scrollbar::-webkit-scrollbar-track {
35
+ background: #f1f1f1;
36
+ border-radius: 10px;
37
+ }
38
+
39
+ .custom-scrollbar::-webkit-scrollbar-thumb {
40
+ background: #888;
41
+ border-radius: 10px;
42
+ }
43
+
44
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover {
45
+ background: #555;
46
+ }
47
+
48
+ /* Height adjustment for mobile */
49
+ @media (max-width: 640px) {
50
+ .chat-container {
51
+ height: calc(100vh - 180px);
52
+ }
53
+ }
54
+ </style>
55
+ </head>
56
+ <body class="bg-gray-100 font-sans">
57
+ <div class="min-h-screen flex flex-col">
58
+ <!-- Header -->
59
+ <header class="bg-indigo-600 text-white shadow-lg">
60
+ <div class="container mx-auto px-4 py-3 flex justify-between items-center">
61
+ <div class="flex items-center space-x-2">
62
+ <div class="w-10 h-10 rounded-full bg-indigo-500 flex items-center justify-center">
63
+ <i class="fas fa-robot text-xl"></i>
64
+ </div>
65
+ <h1 class="text-xl font-bold">AI Agent Assistant</h1>
66
+ </div>
67
+ <div class="flex items-center space-x-4">
68
+ <button class="p-2 rounded-full hover:bg-indigo-500 transition">
69
+ <i class="fas fa-cog"></i>
70
+ </button>
71
+ <button class="p-2 rounded-full hover:bg-indigo-500 transition">
72
+ <i class="fas fa-user"></i>
73
+ </button>
74
+ </div>
75
+ </div>
76
+ </header>
77
+
78
+ <!-- Main Content -->
79
+ <main class="flex-grow container mx-auto px-4 py-6 flex flex-col">
80
+ <!-- Agent Status -->
81
+ <div class="bg-white rounded-lg shadow-md p-4 mb-6 flex items-center justify-between">
82
+ <div class="flex items-center space-x-3">
83
+ <div class="relative">
84
+ <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center">
85
+ <i class="fas fa-robot text-purple-600 text-xl"></i>
86
+ </div>
87
+ <span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
88
+ </div>
89
+ <div>
90
+ <h2 class="font-semibold">AI Agent v2.4.1</h2>
91
+ <p class="text-sm text-gray-500">Active <span class="ml-2"><i class="fas fa-circle text-green-500 text-xs"></i></span></p>
92
+ </div>
93
+ </div>
94
+ <div class="flex items-center space-x-3">
95
+ <span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">Analyzing</span>
96
+ <span class="px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm font-medium">Learning</span>
97
+ </div>
98
+ </div>
99
+
100
+ <!-- Chat Interface -->
101
+ <div class="flex-grow flex flex-col bg-white rounded-lg shadow-md overflow-hidden">
102
+ <!-- Chat Header -->
103
+ <div class="bg-gray-800 text-white px-4 py-3 flex justify-between items-center">
104
+ <h3 class="font-medium">Conversation with AI Agent</h3>
105
+ <div class="flex space-x-2">
106
+ <button class="p-1 rounded hover:bg-gray-700 transition">
107
+ <i class="fas fa-sync-alt"></i>
108
+ </button>
109
+ <button class="p-1 rounded hover:bg-gray-700 transition">
110
+ <i class="fas fa-ellipsis-v"></i>
111
+ </button>
112
+ </div>
113
+ </div>
114
+
115
+ <!-- Messages Container -->
116
+ <div class="flex-grow p-4 overflow-y-auto custom-scrollbar chat-container">
117
+ <div class="space-y-4" id="messages-container">
118
+ <!-- AI Welcome Message -->
119
+ <div class="flex animate-fade-in">
120
+ <div class="flex-shrink-0 mr-3">
121
+ <div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
122
+ <i class="fas fa-robot text-purple-600"></i>
123
+ </div>
124
+ </div>
125
+ <div>
126
+ <div class="bg-gray-100 rounded-lg p-3 text-sm max-w-xs md:max-w-md lg:max-w-lg">
127
+ <p>Hello! I'm your AI assistant. I can help answer questions, analyze data, and assist with various tasks. How can I help you today?</p>
128
+ </div>
129
+ <div class="mt-1 text-xs text-gray-500">
130
+ <span>Today at 10:42 AM</span>
131
+ </div>
132
+ </div>
133
+ </div>
134
+
135
+ <!-- Sample User Message -->
136
+ <div class="flex justify-end animate-fade-in">
137
+ <div class="flex flex-col items-end">
138
+ <div class="bg-indigo-600 text-white rounded-lg p-3 text-sm max-w-xs md:max-w-md lg:max-w-lg">
139
+ <p>Can you help me analyze some sales data?</p>
140
+ </div>
141
+ <div class="mt-1 text-xs text-gray-500">
142
+ <span>Today at 10:43 AM</span>
143
+ </div>
144
+ </div>
145
+ </div>
146
+
147
+ <!-- AI Response -->
148
+ <div class="flex animate-fade-in">
149
+ <div class="flex-shrink-0 mr-3">
150
+ <div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
151
+ <i class="fas fa-robot text-purple-600"></i>
152
+ </div>
153
+ </div>
154
+ <div>
155
+ <div class="bg-gray-100 rounded-lg p-3 text-sm max-w-xs md:max-w-md lg:max-w-lg">
156
+ <p>Absolutely! I can analyze sales data to identify trends, patterns, and key metrics. You can either:</p>
157
+ <ol class="list-decimal pl-5 mt-2 space-y-1">
158
+ <li>Upload a CSV/Excel file</li>
159
+ <li>Connect to your database</li>
160
+ <li>Or describe the data you'd like analyzed</li>
161
+ </ol>
162
+ </div>
163
+ <div class="mt-1 text-xs text-gray-500">
164
+ <span>Today at 10:43 AM</span>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ </div>
169
+ </div>
170
+
171
+ <!-- Input Area -->
172
+ <div class="border-t border-gray-200 p-4">
173
+ <div class="flex space-x-2 mb-2">
174
+ <button class="p-2 rounded-full hover:bg-gray-100 transition text-gray-500">
175
+ <i class="fas fa-paperclip"></i>
176
+ </button>
177
+ <button class="p-2 rounded-full hover:bg-gray-100 transition text-gray-500">
178
+ <i class="fas fa-image"></i>
179
+ </button>
180
+ <button class="p-2 rounded-full hover:bg-gray-100 transition text-gray-500">
181
+ <i class="fas fa-chart-line"></i>
182
+ </button>
183
+ </div>
184
+ <div class="relative">
185
+ <textarea id="message-input" class="w-full border border-gray-300 rounded-lg pl-4 pr-12 py-3 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent resize-none" rows="1" placeholder="Type your message to the AI agent..."></textarea>
186
+ <button id="send-button" class="absolute right-3 bottom-3 text-indigo-600 hover:text-indigo-800 transition">
187
+ <i class="fas fa-paper-plane text-xl"></i>
188
+ </button>
189
+ </div>
190
+ <div class="mt-2 text-xs text-gray-500 text-center">
191
+ <p>AI Agent may produce inaccurate information. Consider verifying critical information.</p>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <!-- Quick Actions -->
197
+ <div class="mt-6 grid grid-cols-2 md:grid-cols-4 gap-4">
198
+ <button class="quick-action-btn bg-blue-50 text-blue-800 hover:bg-blue-100">
199
+ <i class="fas fa-file-alt text-blue-600"></i>
200
+ <span>Generate Report</span>
201
+ </button>
202
+ <button class="quick-action-btn bg-purple-50 text-purple-800 hover:bg-purple-100">
203
+ <i class="fas fa-chart-pie text-purple-600"></i>
204
+ <span>Analyze Data</span>
205
+ </button>
206
+ <button class="quick-action-btn bg-green-50 text-green-800 hover:bg-green-100">
207
+ <i class="fas fa-lightbulb text-green-600"></i>
208
+ <span>Get Ideas</span>
209
+ </button>
210
+ <button class="quick-action-btn bg-orange-50 text-orange-800 hover:bg-orange-100">
211
+ <i class="fas fa-code text-orange-600"></i>
212
+ <span>Write Code</span>
213
+ </button>
214
+ </div>
215
+ </main>
216
+ </div>
217
+
218
+ <script>
219
+ document.addEventListener('DOMContentLoaded', function() {
220
+ const messageInput = document.getElementById('message-input');
221
+ const sendButton = document.getElementById('send-button');
222
+ const messagesContainer = document.getElementById('messages-container');
223
+
224
+ // Auto-resize textarea
225
+ messageInput.addEventListener('input', function() {
226
+ this.style.height = 'auto';
227
+ this.style.height = (this.scrollHeight) + 'px';
228
+ });
229
+
230
+ // Send message function
231
+ function sendMessage() {
232
+ const messageText = messageInput.value.trim();
233
+ if (messageText === '') return;
234
+
235
+ // Add user message to chat
236
+ addMessageToChat('user', messageText);
237
+ messageInput.value = '';
238
+ messageInput.style.height = 'auto';
239
+
240
+ // Show typing indicator
241
+ const typingIndicator = document.createElement('div');
242
+ typingIndicator.className = 'flex';
243
+ typingIndicator.innerHTML = `
244
+ <div class="flex-shrink-0 mr-3">
245
+ <div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
246
+ <i class="fas fa-robot text-purple-600"></i>
247
+ </div>
248
+ </div>
249
+ <div>
250
+ <div class="bg-gray-100 rounded-lg p-3 text-sm w-24 flex space-x-1 animate-pulse">
251
+ <div class="w-2 h-2 rounded-full bg-gray-400"></div>
252
+ <div class="w-2 h-2 rounded-full bg-gray-400"></div>
253
+ <div class="w-2 h-2 rounded-full bg-gray-400"></div>
254
+ </div>
255
+ </div>
256
+ `;
257
+ messagesContainer.appendChild(typingIndicator);
258
+
259
+ // Scroll to bottom
260
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
261
+
262
+ // Simulate AI response after a delay
263
+ setTimeout(() => {
264
+ // Remove typing indicator
265
+ messagesContainer.removeChild(typingIndicator);
266
+
267
+ // Add AI response
268
+ const aiResponses = [
269
+ "I've analyzed your request. Here's what I found...",
270
+ "Interesting question! Based on my knowledge...",
271
+ "I can certainly help with that. Let me explain...",
272
+ "Great question! Here's the information you requested...",
273
+ "Based on the data available, here are my insights..."
274
+ ];
275
+ const randomResponse = aiResponses[Math.floor(Math.random() * aiResponses.length)];
276
+
277
+ addMessageToChat('ai', randomResponse);
278
+
279
+ // Scroll to bottom again after response
280
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
281
+ }, 1500);
282
+ }
283
+
284
+ // Add message to chat function
285
+ function addMessageToChat(sender, message) {
286
+ const now = new Date();
287
+ const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
288
+
289
+ const messageElement = document.createElement('div');
290
+ messageElement.className = 'flex animate-fade-in';
291
+
292
+ if (sender === 'user') {
293
+ messageElement.className += ' justify-end';
294
+ messageElement.innerHTML = `
295
+ <div class="flex flex-col items-end">
296
+ <div class="bg-indigo-600 text-white rounded-lg p-3 text-sm max-w-xs md:max-w-md lg:max-w-lg">
297
+ <p>${message}</p>
298
+ </div>
299
+ <div class="mt-1 text-xs text-gray-500">
300
+ <span>Today at ${timeString}</span>
301
+ </div>
302
+ </div>
303
+ `;
304
+ } else {
305
+ messageElement.innerHTML = `
306
+ <div class="flex-shrink-0 mr-3">
307
+ <div class="w-8 h-8 rounded-full bg-purple-100 flex items-center justify-center">
308
+ <i class="fas fa-robot text-purple-600"></i>
309
+ </div>
310
+ </div>
311
+ <div>
312
+ <div class="bg-gray-100 rounded-lg p-3 text-sm max-w-xs md:max-w-md lg:max-w-lg">
313
+ <p>${message}</p>
314
+ </div>
315
+ <div class="mt-1 text-xs text-gray-500">
316
+ <span>Today at ${timeString}</span>
317
+ </div>
318
+ </div>
319
+ `;
320
+ }
321
+
322
+ messagesContainer.appendChild(messageElement);
323
+ }
324
+
325
+ // Event listeners
326
+ sendButton.addEventListener('click', sendMessage);
327
+
328
+ messageInput.addEventListener('keypress', function(e) {
329
+ if (e.key === 'Enter' && !e.shiftKey) {
330
+ e.preventDefault();
331
+ sendMessage();
332
+ }
333
+ });
334
+
335
+ // Quick action buttons
336
+ document.querySelectorAll('.quick-action-btn').forEach(button => {
337
+ button.addEventListener('click', function() {
338
+ const actionText = this.querySelector('span').textContent;
339
+ addMessageToChat('user', actionText);
340
+
341
+ // Scroll to bottom
342
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
343
+
344
+ // Show typing indicator
345
+ setTimeout(() => {
346
+ addMessageToChat('ai', `I'll help you with ${actionText.toLowerCase()}. Could you provide more details about what you're looking for?`);
347
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
348
+ }, 1500);
349
+ });
350
+ });
351
+ });
352
+ </script>
353
+ <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=khajavalishaik/ai-agent" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
354
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Build ai agent