FourLabs-UN2 commited on
Commit
2d5b697
·
verified ·
1 Parent(s): 6cacdea

Faça um chatbot completo e profissional com sidebar e essas cores. Adicione um lugar para o usuario escolher o modelo LLM que quer usar:

Browse files

colors: {
primary: '#21223a',
secondary: '#ff580f',
}

Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +298 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Chatoracle Ai
3
- emoji: 💻
4
- colorFrom: red
5
- colorTo: yellow
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: ChatOracle AI 🤖
3
+ colorFrom: gray
4
+ colorTo: gray
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,299 @@
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="pt-BR">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>ChatOracle AI - Assistente Inteligente</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <style>
12
+ :root {
13
+ --primary: #21223a;
14
+ --secondary: #ff580f;
15
+ }
16
+
17
+ body {
18
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
19
+ }
20
+
21
+ .chat-container {
22
+ scroll-behavior: smooth;
23
+ }
24
+
25
+ .message-bubble {
26
+ max-width: 80%;
27
+ animation: fadeIn 0.3s ease-in;
28
+ }
29
+
30
+ .typing-indicator {
31
+ display: inline-flex;
32
+ align-items: center;
33
+ gap: 4px;
34
+ }
35
+
36
+ .typing-dot {
37
+ width: 6px;
38
+ height: 6px;
39
+ background-color: var(--secondary);
40
+ border-radius: 50%;
41
+ animation: typing 1.4s infinite ease-in-out;
42
+ }
43
+
44
+ .typing-dot:nth-child(2) { animation-delay: 0.16s; }
45
+ .typing-dot:nth-child(3) { animation-delay: 0.32s; }
46
+
47
+ @keyframes typing {
48
+ 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
49
+ 30% { transform: translateY(-10px); opacity: 1; }
50
+ }
51
+
52
+ @keyframes fadeIn {
53
+ from { opacity: 0; transform: translateY(10px); }
54
+ to { opacity: 1; transform: translateY(0); }
55
+ }
56
+
57
+ .llm-option:hover {
58
+ transform: translateY(-2px);
59
+ box-shadow: 0 8px 25px rgba(33, 34, 58, 0.15);
60
+ }
61
+ </style>
62
+ </head>
63
+ <body class="bg-gray-100 min-h-screen flex">
64
+ <!-- Sidebar -->
65
+ <div class="w-80 bg-[#21223a] text-white h-screen fixed left-0 top-0 flex flex-col">
66
+ <div class="p-6 border-b border-gray-700">
67
+ <div class="flex items-center space-x-3">
68
+ <div class="w-10 h-10 bg-[#ff580f] rounded-full flex items-center justify-center">
69
+ <i data-feather="cpu"></i>
70
+ </div>
71
+ <h1 class="text-xl font-bold">ChatOracle AI</h1>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="p-6 space-y-4">
76
+ <h2 class="text-sm uppercase tracking-wider text-gray-400 mb-4">Modelos LLM</h2>
77
+
78
+ <div class="space-y-3">
79
+ <div class="llm-option bg-gray-800 p-4 rounded-lg cursor-pointer transition-all duration-200 border-2 border-transparent hover:border-[#ff580f]">
80
+ <div class="flex items-center justify-between">
81
+ <span class="font-medium">GPT-4</span>
82
+ <div class="w-3 h-3 bg-green-400 rounded-full"></div>
83
+ </div>
84
+ <p class="text-sm text-gray-300 mt-1">OpenAI - Mais avançado</p>
85
+ </div>
86
+
87
+ <div class="llm-option bg-gray-800 p-4 rounded-lg cursor-pointer transition-all duration-200">
88
+ <div class="flex items-center justify-between">
89
+ <span class="font-medium">Claude 2</span>
90
+ <div class="w-3 h-3 bg-green-400 rounded-full"></div>
91
+ </div>
92
+ <p class="text-sm text-gray-300 mt-1">Anthropic - Contexto longo</p>
93
+ </div>
94
+
95
+ <div class="llm-option bg-gray-800 p-4 rounded-lg cursor-pointer transition-all duration-200">
96
+ <div class="flex items-center justify-between">
97
+ <span class="font-medium">Llama 2</span>
98
+ <div class="w-3 h-3 bg-green-400 rounded-full"></div>
99
+ </div>
100
+ <p class="text-sm text-gray-300 mt-1">Meta - Open source</p>
101
+ </div>
102
+
103
+ <div class="llm-option bg-gray-800 p-4 rounded-lg cursor-pointer transition-all duration-200">
104
+ <div class="flex items-center justify-between">
105
+ <span class="font-medium">Mistral 7B</span>
106
+ <div class="w-3 h-3 bg-green-400 rounded-full"></div>
107
+ </div>
108
+ <p class="text-sm text-gray-300 mt-1">Mistral AI - Eficiente</p>
109
+ </div>
110
+ </div>
111
+ </div>
112
+
113
+ <div class="p-6 mt-auto space-y-4">
114
+ <div class="bg-gray-800 p-4 rounded-lg">
115
+ <h3 class="text-sm font-medium mb-2">Status do Sistema</h3>
116
+ <div class="flex items-center space-x-2 text-sm text-green-400">
117
+ <div class="w-2 h-2 bg-green-400 rounded-full"></div>
118
+ <span>Online</span>
119
+ </div>
120
+ </div>
121
+
122
+ <button class="w-full bg-[#ff580f] hover:bg-[#e64a0c] text-white py-2 px-4 rounded-lg transition-colors duration-200 flex items-center justify-center space-x-2">
123
+ <i data-feather="plus"></i>
124
+ <span>Nova Conversa</span>
125
+ </button>
126
+ </div>
127
+ </div>
128
+
129
+ <!-- Main Chat Area -->
130
+ <div class="ml-80 flex-1 flex flex-col">
131
+ <!-- Header -->
132
+ <div class="bg-white border-b border-gray-200 p-6">
133
+ <div class="flex items-center justify-between">
134
+ <h2 class="text-2xl font-bold text-gray-800">Conversa Atual</h2>
135
+ <div class="flex items-center space-x-4">
136
+ <button class="p-2 hover:bg-gray-100 rounded-lg transition-colors">
137
+ <i data-feather="settings"></i>
138
+ </button>
139
+ <button class="p-2 hover:bg-gray-100 rounded-lg transition-colors">
140
+ <i data-feather="help-circle"></i>
141
+ </button>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <!-- Chat Messages -->
147
+ <div class="flex-1 overflow-y-auto p-6 space-y-6 chat-container" id="chatMessages">
148
+ <div class="message-bubble bg-white rounded-2xl p-4 shadow-md ml-auto">
149
+ <p class="text-gray-800">Olá! Como posso ajudar você hoje?</p>
150
+ <span class="text-xs text-gray-500 block mt-2">12:30 PM</span>
151
+ </div>
152
+
153
+ <div class="message-bubble bg-[#21223a] text-white rounded-2xl p-4 shadow-md">
154
+ <p>Estou aqui para assistir você! Posso responder perguntas, ajudar com pesquisas, escrever conteúdo e muito mais. O que você gostaria de fazer?</p>
155
+ <span class="text-xs text-gray-300 block mt-2">12:31 PM</span>
156
+ </div>
157
+ </div>
158
+
159
+ <!-- Input Area -->
160
+ <div class="bg-white border-t border-gray-200 p-6">
161
+ <div class="flex items-center space-x-4">
162
+ <div class="flex-1 relative">
163
+ <input
164
+ type="text"
165
+ placeholder="Digite sua mensagem..."
166
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#ff580f] focus:border-transparent"
167
+ id="messageInput"
168
+ >
169
+ <div class="absolute right-3 top-3 flex items-center space-x-2">
170
+ <button class="text-gray-400 hover:text-[#ff580f] transition-colors">
171
+ <i data-feather="paperclip"></i>
172
+ </button>
173
+ <button class="text-gray-400 hover:text-[#ff580f] transition-colors">
174
+ <i data-feather="mic"></i>
175
+ </button>
176
+ </div>
177
+ </div>
178
+ <button
179
+ class="bg-[#ff580f] hover:bg-[#e64a0c] text-white p-3 rounded-lg transition-colors duration-200"
180
+ onclick="sendMessage()"
181
+ >
182
+ <i data-feather="send"></i>
183
+ </button>
184
+ </div>
185
+
186
+ <div class="mt-3 flex items-center justify-between text-sm text-gray-500">
187
+ <span>Modelo selecionado: GPT-4</span>
188
+ <span>⌘K para atalhos</span>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+ <script>
194
+ feather.replace();
195
+
196
+ const chatMessages = document.getElementById('chatMessages');
197
+ const messageInput = document.getElementById('messageInput');
198
+
199
+ function sendMessage() {
200
+ const message = messageInput.value.trim();
201
+ if (!message) return;
202
+
203
+ // Add user message
204
+ addMessage(message, 'user');
205
+ messageInput.value = '';
206
+
207
+ // Simulate AI response
208
+ setTimeout(() => {
209
+ addTypingIndicator();
210
+
211
+ setTimeout(() => {
212
+ removeTypingIndicator();
213
+ addMessage(getAIResponse(message), 'ai');
214
+ }, 2000);
215
+ }, 500);
216
+ }
217
+
218
+ function addMessage(text, sender) {
219
+ const messageDiv = document.createElement('div');
220
+ messageDiv.className = `message-bubble ${sender === 'user' ? 'bg-white rounded-2xl p-4 shadow-md ml-auto' : 'bg-[#21223a] text-white rounded-2xl p-4 shadow-md'}`;
221
+
222
+ const messageContent = document.createElement('p');
223
+ messageContent.className = sender === 'user' ? 'text-gray-800' : 'text-white';
224
+ messageContent.textContent = text;
225
+
226
+ const timestamp = document.createElement('span');
227
+ timestamp.className = `text-xs block mt-2 ${sender === 'user' ? 'text-gray-500' : 'text-gray-300'}`;
228
+ timestamp.textContent = new Date().toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});
229
+
230
+ messageDiv.appendChild(messageContent);
231
+ messageDiv.appendChild(timestamp);
232
+ chatMessages.appendChild(messageDiv);
233
+
234
+ // Scroll to bottom
235
+ chatMessages.scrollTop = chatMessages.scrollHeight;
236
+ }
237
+
238
+ function addTypingIndicator() {
239
+ const typingDiv = document.createElement('div');
240
+ typingDiv.className = 'message-bubble bg-[#21223a] text-white rounded-2xl p-4 shadow-md';
241
+ typingDiv.id = 'typingIndicator';
242
+
243
+ const typingContent = document.createElement('div');
244
+ typingContent.className = 'typing-indicator';
245
+
246
+ for (let i = 0; i < 3; i++) {
247
+ const dot = document.createElement('div');
248
+ dot.className = 'typing-dot';
249
+ typingContent.appendChild(dot);
250
+ }
251
+
252
+ typingDiv.appendChild(typingContent);
253
+ chatMessages.appendChild(typingDiv);
254
+
255
+ // Scroll to bottom
256
+ chatMessages.scrollTop = chatMessages.scrollHeight;
257
+ }
258
+
259
+ function removeTypingIndicator() {
260
+ const typingIndicator = document.getElementById('typingIndicator');
261
+ if (typingIndicator) {
262
+ typingIndicator.remove();
263
+ }
264
+ }
265
+
266
+ function getAIResponse(userMessage) {
267
+ const responses = [
268
+ "Entendi sua pergunta! Deixe-me ajudar com isso...",
269
+ "Excelente pergunta! Aqui está a informação que você precisa:",
270
+ "Com base na sua solicitação, aqui está o que posso compartilhar:",
271
+ "Ótimo ponto! Deixe-me elaborar sobre isso:",
272
+ "Obrigado pela pergunta. Aqui está minha resposta:"
273
+ ];
274
+
275
+ return responses[Math.floor(Math.random() * responses.length)] + " Esta é uma resposta simulada do chatbot. Em uma implementação real, esta seria a resposta do modelo LLM selecionado.";
276
+ }
277
+
278
+ // Enter key to send message
279
+ messageInput.addEventListener('keypress', function(e) {
280
+ if (e.key === 'Enter') {
281
+ sendMessage();
282
+ }
283
+ });
284
+
285
+ // LLM selection
286
+ document.querySelectorAll('.llm-option').forEach(option => {
287
+ option.addEventListener('click', function() {
288
+ document.querySelectorAll('.llm-option').forEach(opt => {
289
+ opt.classList.remove('border-[#ff580f]');
290
+ });
291
+ this.classList.add('border-[#ff580f]');
292
+
293
+ const modelName = this.querySelector('span').textContent;
294
+ document.querySelector('.mt-3 span:first-child').textContent = `Modelo selecionado: ${modelName}`;
295
+ });
296
+ });
297
+ </script>
298
+ </body>
299
  </html>