Bencolliss commited on
Commit
1dd00b9
·
verified ·
1 Parent(s): 86b8344

https://huggingface.co/spaces/charanKompala/business-analyst-gpt - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +316 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Testrun1
3
- emoji: 🌍
4
  colorFrom: purple
5
- colorTo: indigo
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: testrun1
3
+ emoji: 🐳
4
  colorFrom: purple
5
+ colorTo: red
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,316 @@
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>Business Analyst GPT</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 scrollbar */
11
+ .custom-scrollbar::-webkit-scrollbar {
12
+ width: 6px;
13
+ }
14
+ .custom-scrollbar::-webkit-scrollbar-track {
15
+ background: #f1f1f1;
16
+ }
17
+ .custom-scrollbar::-webkit-scrollbar-thumb {
18
+ background: #888;
19
+ border-radius: 3px;
20
+ }
21
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover {
22
+ background: #555;
23
+ }
24
+
25
+ /* Chat bubble animation */
26
+ @keyframes fadeIn {
27
+ from { opacity: 0; transform: translateY(10px); }
28
+ to { opacity: 1; transform: translateY(0); }
29
+ }
30
+ .chat-message {
31
+ animation: fadeIn 0.3s ease-out;
32
+ }
33
+
34
+ /* Pulse animation for loading */
35
+ @keyframes pulse {
36
+ 0%, 100% { opacity: 1; }
37
+ 50% { opacity: 0.5; }
38
+ }
39
+ .animate-pulse {
40
+ animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
41
+ }
42
+ </style>
43
+ </head>
44
+ <body class="bg-gray-50 min-h-screen flex flex-col">
45
+ <!-- Header -->
46
+ <header class="bg-indigo-700 text-white shadow-md">
47
+ <div class="container mx-auto px-4 py-4 flex justify-between items-center">
48
+ <div class="flex items-center space-x-3">
49
+ <i class="fas fa-chart-line text-2xl"></i>
50
+ <h1 class="text-xl md:text-2xl font-bold">Business Analyst GPT</h1>
51
+ </div>
52
+ <div class="flex items-center space-x-4">
53
+ <button class="hidden md:block bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded-lg transition">
54
+ <i class="fas fa-history mr-2"></i>History
55
+ </button>
56
+ <button class="hidden md:block bg-indigo-600 hover:bg-indigo-500 px-4 py-2 rounded-lg transition">
57
+ <i class="fas fa-cog mr-2"></i>Settings
58
+ </button>
59
+ <div class="w-10 h-10 rounded-full bg-indigo-600 flex items-center justify-center cursor-pointer">
60
+ <i class="fas fa-user"></i>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </header>
65
+
66
+ <!-- Main Content -->
67
+ <main class="flex-1 container mx-auto px-4 py-6 flex flex-col md:flex-row gap-6">
68
+ <!-- Sidebar (hidden on mobile) -->
69
+ <aside class="hidden md:block w-64 bg-white rounded-lg shadow-md p-4 h-fit">
70
+ <h2 class="font-bold text-lg mb-4 text-gray-700">Quick Actions</h2>
71
+ <ul class="space-y-2">
72
+ <li>
73
+ <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center">
74
+ <i class="fas fa-file-invoice-dollar mr-3"></i> Financial Analysis
75
+ </button>
76
+ </li>
77
+ <li>
78
+ <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center">
79
+ <i class="fas fa-chart-pie mr-3"></i> Market Research
80
+ </button>
81
+ </li>
82
+ <li>
83
+ <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center">
84
+ <i class="fas fa-project-diagram mr-3"></i> SWOT Analysis
85
+ </button>
86
+ </li>
87
+ <li>
88
+ <button class="w-full text-left px-4 py-2 bg-indigo-100 text-indigo-700 rounded-lg hover:bg-indigo-200 transition flex items-center">
89
+ <i class="fas fa-lightbulb mr-3"></i> Business Ideas
90
+ </button>
91
+ </li>
92
+ </ul>
93
+
94
+ <div class="mt-6">
95
+ <h2 class="font-bold text-lg mb-4 text-gray-700">Recent Chats</h2>
96
+ <ul class="space-y-2">
97
+ <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate">
98
+ <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Q2 Revenue forecast
99
+ </li>
100
+ <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate">
101
+ <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Competitor analysis
102
+ </li>
103
+ <li class="px-3 py-2 rounded-lg hover:bg-gray-100 cursor-pointer transition truncate">
104
+ <i class="fas fa-comment-dots mr-2 text-gray-500"></i> Pricing strategy
105
+ </li>
106
+ </ul>
107
+ </div>
108
+ </aside>
109
+
110
+ <!-- Chat Area -->
111
+ <div class="flex-1 flex flex-col bg-white rounded-lg shadow-md overflow-hidden">
112
+ <!-- Chat Header -->
113
+ <div class="border-b p-4 bg-gray-50">
114
+ <div class="flex justify-between items-center">
115
+ <h2 class="font-bold text-gray-700">New Conversation</h2>
116
+ <div class="flex space-x-2">
117
+ <button class="p-2 text-gray-500 hover:text-indigo-600 hover:bg-gray-100 rounded-full transition">
118
+ <i class="fas fa-ellipsis-v"></i>
119
+ </button>
120
+ </div>
121
+ </div>
122
+ </div>
123
+
124
+ <!-- Messages Container -->
125
+ <div id="messages" class="flex-1 p-4 overflow-y-auto custom-scrollbar space-y-4">
126
+ <!-- Welcome Message -->
127
+ <div class="chat-message">
128
+ <div class="flex items-start">
129
+ <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center">
130
+ <i class="fas fa-robot"></i>
131
+ </div>
132
+ <div class="ml-3">
133
+ <div class="bg-gray-100 rounded-lg p-4 max-w-3xl">
134
+ <h3 class="font-bold text-indigo-700 mb-1">Business Analyst GPT</h3>
135
+ <p class="text-gray-700">Hello! I'm your AI Business Analyst assistant. How can I help you today? Here are some things I can do:</p>
136
+ <ul class="list-disc pl-5 mt-2 space-y-1 text-gray-700">
137
+ <li>Analyze financial data and create reports</li>
138
+ <li>Generate market research insights</li>
139
+ <li>Help with business strategy and planning</li>
140
+ <li>Create visualizations from your data</li>
141
+ </ul>
142
+ </div>
143
+ <div class="text-xs text-gray-500 mt-1">Today at <span id="current-time"></span></div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+
149
+ <!-- Input Area -->
150
+ <div class="border-t p-4 bg-gray-50">
151
+ <form id="chat-form" class="flex items-center space-x-2">
152
+ <div class="flex-1 relative">
153
+ <textarea id="message-input" rows="1" class="w-full border rounded-lg pl-4 pr-12 py-3 focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-none" placeholder="Ask me anything about business analysis..."></textarea>
154
+ <div class="absolute right-2 bottom-2 flex space-x-1">
155
+ <button type="button" class="p-1 text-gray-500 hover:text-indigo-600 rounded-full transition">
156
+ <i class="fas fa-paperclip"></i>
157
+ </button>
158
+ <button type="button" class="p-1 text-gray-500 hover:text-indigo-600 rounded-full transition">
159
+ <i class="fas fa-microphone"></i>
160
+ </button>
161
+ </div>
162
+ </div>
163
+ <button type="submit" class="bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg p-3 transition">
164
+ <i class="fas fa-paper-plane"></i>
165
+ </button>
166
+ </form>
167
+ <p class="text-xs text-gray-500 mt-2 text-center">Business Analyst GPT may produce inaccurate information. Verify critical information.</p>
168
+ </div>
169
+ </div>
170
+ </main>
171
+
172
+ <!-- Mobile Bottom Navigation -->
173
+ <nav class="md:hidden fixed bottom-0 left-0 right-0 bg-white border-t shadow-lg">
174
+ <div class="flex justify-around">
175
+ <button class="p-4 text-indigo-600">
176
+ <i class="fas fa-comment-dots text-xl"></i>
177
+ </button>
178
+ <button class="p-4 text-gray-500">
179
+ <i class="fas fa-history text-xl"></i>
180
+ </button>
181
+ <button class="p-4 text-gray-500">
182
+ <i class="fas fa-chart-line text-xl"></i>
183
+ </button>
184
+ <button class="p-4 text-gray-500">
185
+ <i class="fas fa-cog text-xl"></i>
186
+ </button>
187
+ </div>
188
+ </nav>
189
+
190
+ <script>
191
+ // Set current time in welcome message
192
+ const now = new Date();
193
+ const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
194
+ document.getElementById('current-time').textContent = timeString;
195
+
196
+ // Auto-resize textarea
197
+ const textarea = document.getElementById('message-input');
198
+ textarea.addEventListener('input', function() {
199
+ this.style.height = 'auto';
200
+ this.style.height = (this.scrollHeight) + 'px';
201
+ });
202
+
203
+ // Chat functionality
204
+ const chatForm = document.getElementById('chat-form');
205
+ const messagesContainer = document.getElementById('messages');
206
+
207
+ chatForm.addEventListener('submit', function(e) {
208
+ e.preventDefault();
209
+ const message = textarea.value.trim();
210
+ if (message) {
211
+ // Add user message
212
+ addMessage(message, 'user');
213
+ textarea.value = '';
214
+ textarea.style.height = 'auto';
215
+
216
+ // Show loading indicator
217
+ const loadingId = 'loading-' + Date.now();
218
+ addLoadingIndicator(loadingId);
219
+
220
+ // Simulate AI response after a delay
221
+ setTimeout(() => {
222
+ // Remove loading indicator
223
+ const loadingElement = document.getElementById(loadingId);
224
+ if (loadingElement) loadingElement.remove();
225
+
226
+ // Add AI response
227
+ const response = getAIResponse(message);
228
+ addMessage(response, 'ai');
229
+
230
+ // Scroll to bottom
231
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
232
+ }, 1500);
233
+ }
234
+ });
235
+
236
+ function addMessage(content, sender) {
237
+ const now = new Date();
238
+ const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
239
+
240
+ const messageDiv = document.createElement('div');
241
+ messageDiv.className = 'chat-message';
242
+
243
+ if (sender === 'user') {
244
+ messageDiv.innerHTML = `
245
+ <div class="flex items-start justify-end">
246
+ <div class="ml-3">
247
+ <div class="bg-indigo-100 rounded-lg p-4 max-w-3xl">
248
+ <p class="text-gray-800">${content}</p>
249
+ </div>
250
+ <div class="text-xs text-gray-500 mt-1 text-right">${timeString}</div>
251
+ </div>
252
+ <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-600 text-white flex items-center justify-center">
253
+ <i class="fas fa-user"></i>
254
+ </div>
255
+ </div>
256
+ `;
257
+ } else {
258
+ messageDiv.innerHTML = `
259
+ <div class="flex items-start">
260
+ <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center">
261
+ <i class="fas fa-robot"></i>
262
+ </div>
263
+ <div class="ml-3">
264
+ <div class="bg-gray-100 rounded-lg p-4 max-w-3xl">
265
+ <h3 class="font-bold text-indigo-700 mb-1">Business Analyst GPT</h3>
266
+ <p class="text-gray-700">${content}</p>
267
+ </div>
268
+ <div class="text-xs text-gray-500 mt-1">${timeString}</div>
269
+ </div>
270
+ </div>
271
+ `;
272
+ }
273
+
274
+ messagesContainer.appendChild(messageDiv);
275
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
276
+ }
277
+
278
+ function addLoadingIndicator(id) {
279
+ const loadingDiv = document.createElement('div');
280
+ loadingDiv.id = id;
281
+ loadingDiv.className = 'chat-message';
282
+ loadingDiv.innerHTML = `
283
+ <div class="flex items-start">
284
+ <div class="flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 flex items-center justify-center">
285
+ <i class="fas fa-robot"></i>
286
+ </div>
287
+ <div class="ml-3">
288
+ <div class="bg-gray-100 rounded-lg p-4 max-w-3xl">
289
+ <div class="flex space-x-2">
290
+ <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse"></div>
291
+ <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.2s"></div>
292
+ <div class="w-2 h-2 rounded-full bg-gray-400 animate-pulse" style="animation-delay: 0.4s"></div>
293
+ </div>
294
+ </div>
295
+ </div>
296
+ </div>
297
+ `;
298
+ messagesContainer.appendChild(loadingDiv);
299
+ messagesContainer.scrollTop = messagesContainer.scrollHeight;
300
+ }
301
+
302
+ function getAIResponse(message) {
303
+ // This is a simplified version - in a real app, you'd call an API
304
+ const responses = [
305
+ `Based on your question about "${message}", I would recommend analyzing the key metrics first. Would you like me to generate a report template for this analysis?`,
306
+ `That's an interesting business question. To properly assess "${message}", we should consider both quantitative and qualitative factors. I can help structure this analysis.`,
307
+ `For "${message}", the standard approach would involve: 1) Market sizing 2) Competitive landscape 3) Financial projections. Would you like me to elaborate on any of these aspects?`,
308
+ `I can provide insights about "${message}". First, let me ask: do you have any specific data you'd like me to analyze, or should I provide general industry benchmarks?`,
309
+ `Regarding "${message}", the answer depends on several business factors. I can walk you through a framework to evaluate this properly. Would that be helpful?`
310
+ ];
311
+
312
+ return responses[Math.floor(Math.random() * responses.length)];
313
+ }
314
+ </script>
315
+ <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=Bencolliss/testrun1" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
316
+ </html>