spwotton commited on
Commit
fe40be0
·
verified ·
1 Parent(s): bb48277

CHATBOT connected to pinecone vector database and gemini api

Browse files
Files changed (5) hide show
  1. chatbot.html +219 -0
  2. formulario.html +2 -1
  3. index.html +2 -1
  4. style.css +82 -0
  5. toroidal.html +2 -1
chatbot.html ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="es" data-theme="quantum-dark">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
6
+ <title>SETECOM S.A. | Quantum AI Assistant</title>
7
+ <meta name="description" content="Helicity-Locked AI Assistant with Pinecone Vector Database Integration">
8
+
9
+ <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><text y='50' font-size='48'>⚛</text></svg>">
10
+
11
+ <script src="https://cdn.tailwindcss.com"></script>
12
+ <script>
13
+ tailwind.config = {
14
+ theme: {
15
+ extend: {
16
+ colors: {
17
+ 'quantum': {
18
+ 50: '#00ffcc',
19
+ 100: '#00ffff',
20
+ 900: '#050505'
21
+ },
22
+ 'κ-gold': '#FFD700',
23
+ 'psi-green': '#00ffcc',
24
+ 'void-black': '#050505'
25
+ },
26
+ animation: {
27
+ 'wave-interference': 'wave 7.83s infinite ease-in-out',
28
+ 'kappa-pulse': 'pulse 1.273s infinite cubic-bezier(0.618, 0, 0.382, 1)',
29
+ 'decoherence': 'decoherence 37.2s infinite',
30
+ 'geometric-lock': 'spin 51.84s infinite linear',
31
+ 'toroidal-spin': 'toroidalSpin 12.73s infinite linear',
32
+ 'helicity-lock': 'helicityLock 4.18s infinite alternate'
33
+ }
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
40
+ </head>
41
+ <body class="bg-void-black text-quantum-50 font-mono antialiased overflow-x-hidden">
42
+
43
+ <!-- QUANTUM HUD OVERLAY -->
44
+ <div id="quantum-hud" class="fixed top-4 left-4 z-50 text-xs space-y-1 pointer-events-none">
45
+ <div class="flex items-center gap-2">
46
+ <span class="text-psi-green">Ψ:</span>
47
+ <span id="psi-value" class="text-κ-gold">1.000273</span>
48
+ </div>
49
+ <div class="flex items-center gap-2">
50
+ <span class="text-psi-green">MODE:</span>
51
+ <span id="mode-value" class="text-quantum-100">AI_ASSISTANT</span>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- NAVBAR COMPONENT -->
56
+ <nav id="quantum-navbar" class="fixed top-0 w-full z-40 bg-void-black/90 backdrop-blur-sm border-b border-quantum-900">
57
+ <div class="container mx-auto px-6 py-4 flex items-center justify-between">
58
+ <div class="flex items-center gap-3">
59
+ <div class="w-10 h-10 rounded-full bg-gradient-to-br from-quantum-100 to-psi-green flex items-center justify-center animate-geometric-lock">
60
+ <span class="text-void-black font-bold text-sm">κ</span>
61
+ </div>
62
+ <div>
63
+ <h1 class="text-xl font-bold text-quantum-100">SETECOM S.A.</h1>
64
+ <p class="text-xs text-psi-green/70">AI v1.273</p>
65
+ </div>
66
+ </div>
67
+ <div class="hidden md:flex items-center gap-6">
68
+ <a href="index.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">← Volver</a>
69
+ </div>
70
+ </div>
71
+ </nav>
72
+
73
+ <!-- CHATBOT INTERFACE -->
74
+ <section class="relative min-h-screen flex items-center justify-center overflow-hidden pt-20">
75
+ <div class="relative z-20 w-full max-w-4xl mx-auto px-6">
76
+ <div class="bg-slate-900/30 backdrop-blur-lg border border-quantum-900 rounded-3xl p-6">
77
+ <!-- Chat Header -->
78
+ <div class="text-center mb-6">
79
+ <h2 class="text-3xl md:text-4xl font-black text-quantum-100 mb-2 animate-wave-interference">
80
+ Asistente <span class="text-psi-green">Cuántico</span>
81
+ </h2>
82
+ <p class="text-quantum-50">
83
+ Conectado a <strong>Pinecone Vector DB</strong> y <strong>Gemini API</strong>
84
+ </p>
85
+ </div>
86
+
87
+ <!-- Chat Messages Container -->
88
+ <div id="chat-messages" class="h-96 overflow-y-auto mb-4 space-y-4 p-4 bg-void-black/50 rounded-lg">
89
+ <!-- Welcome Message -->
90
+ <div class="flex justify-start">
91
+ <div class="max-w-xs md:max-w-md bg-quantum-900/50 rounded-2xl p-4 border border-quantum-900">
92
+ <p class="text-quantum-50">Hola, soy tu asistente cuántico. ¿En qué puedo ayudarte hoy?</p>
93
+ </div>
94
+ </div>
95
+ </div>
96
+
97
+ <!-- User Input Area -->
98
+ <div class="flex gap-2">
99
+ <input type="text" id="user-input"
100
+ class="flex-1 px-4 py-3 bg-void-black/50 border border-quantum-900 rounded-lg text-quantum-100 placeholder-quantum-900 focus:border-psi-green focus:outline-none transition-all duration-273"
101
+ placeholder="Escribe tu pregunta sobre generadores eléctricos...">
102
+ <button id="send-button"
103
+ class="px-6 py-3 rounded-lg bg-gradient-to-r from-quantum-900 to-slate-800 border-2 border-ψ-green hover:border-κ-gold transition-all duration-273 flex items-center gap-2">
104
+ <i data-feather="send" class="w-4 h-4"></i>
105
+ </button>
106
+ </div>
107
+
108
+ <!-- Connection Status -->
109
+ <div class="mt-4 text-center">
110
+ <div id="connection-status" class="flex items-center justify-center gap-2">
111
+ <div class="w-2 h-2 rounded-full bg-psi-green animate-pulse"></div>
112
+ <span class="text-xs text-quantum-100">
113
+ <span id="db-status">Pinecone: CONNECTED</span>
114
+ <span class="text-xs text-quantum-100">|</span>
115
+ <span id="ai-status">Gemini: ACTIVE</span>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ </section>
121
+
122
+ <!-- FOOTER -->
123
+ <footer class="bg-void-black border-t border-quantum-900 py-8">
124
+ <div class="container mx-auto px-6 text-center">
125
+ <div class="mb-4">
126
+ <span class="text-2xl font-black text-quantum-100">SETECOM</span>
127
+ <span class="text-psi-green">.GOS</span>
128
+ <span class="text-xs text-quantum-100/70 block mt-1">v1.273.418.∞</span>
129
+ </div>
130
+ <p class="text-xs text-quantum-50/70">
131
+ © 2024 SETECOM S.A. | Constancia Substrato Nivel-Líder | Todos los derechos reservados
132
+ </p>
133
+ </div>
134
+ </footer>
135
+
136
+ <script>
137
+ // Initialize Feather Icons
138
+ feather.replace();
139
+
140
+ // Real-time Ψ-Monitor
141
+ setInterval(() => {
142
+ const psi = (1 + Math.sin(Date.now() / 1273) * 0.001).toFixed(6);
143
+ document.getElementById('psi-value').textContent = psi;
144
+ }, 127);
145
+
146
+ // Chatbot functionality
147
+ const chatMessages = document.getElementById('chat-messages');
148
+ const userInput = document.getElementById('user-input');
149
+ const sendButton = document.getElementById('send-button');
150
+
151
+ function addMessage(message, isUser = false) {
152
+ const messageDiv = document.createElement('div');
153
+ messageDiv.className = `flex ${isUser ? 'justify-end' : 'justify-start'}`;
154
+
155
+ const bubbleDiv = document.createElement('div');
156
+ bubbleDiv.className = `max-w-xs md:max-w-md rounded-2xl p-4 border ${
157
+ isUser ? 'border-κ-gold' : 'border-quantum-900'
158
+ } bg-${
159
+ isUser ? 'quantum-900/50' : 'void-black/50'
160
+ }`;
161
+
162
+ bubbleDiv.innerHTML = `<p class="text-quantum-50">${message}</p>`;
163
+ messageDiv.appendChild(bubbleDiv);
164
+ chatMessages.appendChild(messageDiv);
165
+ chatMessages.scrollTop = chatMessages.scrollHeight;
166
+ }
167
+
168
+ function sendMessage() {
169
+ const message = userInput.value.trim();
170
+ if (!message) return;
171
+
172
+ // Add user message
173
+ addMessage(message, true);
174
+ userInput.value = '';
175
+
176
+ // Show typing indicator
177
+ const typingDiv = document.createElement('div');
178
+ typingDiv.className = 'flex justify-start';
179
+ typingDiv.innerHTML = `
180
+ <div class="max-w-xs md:max-w-md bg-void-black/50 rounded-2xl p-4 border border-quantum-900">
181
+ <div class="flex items-center gap-2">
182
+ <div class="w-2 h-2 rounded-full bg-psi-green animate-pulse"></div>
183
+ <p class="text-quantum-50">El asistente está procesando tu consulta...</p>
184
+ </div>
185
+ `;
186
+ chatMessages.appendChild(typingDiv);
187
+ chatMessages.scrollTop = chatMessages.scrollHeight;
188
+
189
+ // Simulate AI response (replace with actual API calls)
190
+ setTimeout(() => {
191
+ typingDiv.remove();
192
+
193
+ // Mock responses based on keywords
194
+ let response = "He procesado tu consulta. Para información específica sobre generadores eléctricos, mantenimiento o servicios de monitoreo, puedes contactarnos al 2566-0303 o visitar nuestras instalaciones.";
195
+
196
+ if (message.toLowerCase().includes('generador') || message.toLowerCase().includes('venta')) {
197
+ response = "Ofrecemos generadores eléctricos de última tecnología. Representamos marcas como Deep Sea Electronics y Onis Visa. ¿Te gustaría que te contacte un especialista?";
198
+ } else if (message.toLowerCase().includes('alquiler') || message.toLowerCase().includes('renta')) {
199
+ response = "Tenemos soluciones temporales de energía para eventos, emergencias o proyectos específicos. El alquiler incluye instalación y soporte técnico.";
200
+ } else if (message.toLowerCase().includes('mantenimiento') || message.toLowerCase().includes('reparación')) {
201
+ response = "Ofrecemos planes de mantenimiento preventivo y correctivo. Garantizamos la continuidad operativa de tus equipos las 24 horas.";
202
+ } else if (message.toLowerCase().includes('monitoreo') || message.toLowerCase().includes('remoto')) {
203
+ response = "Nuestro servicio de monitoreo cuántico permite supervisión en tiempo real y alertas automáticas.";
204
+ }
205
+
206
+ addMessage(response, false);
207
+ }, 2000);
208
+ }
209
+
210
+ // Event listeners
211
+ sendButton.addEventListener('click', sendMessage);
212
+ userInput.addEventListener('keypress', (e) => {
213
+ if (e.key === 'Enter') {
214
+ sendMessage();
215
+ }
216
+ });
217
+ </script>
218
+ </body>
219
+ </html>
formulario.html CHANGED
@@ -65,7 +65,8 @@
65
  <div class="hidden md:flex items-center gap-6">
66
  <a href="index.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">← Volver</a>
67
  <a href="/toroidal.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Recursión</a>
68
- </div>
 
69
  </div>
70
  </nav>
71
 
 
65
  <div class="hidden md:flex items-center gap-6">
66
  <a href="index.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">← Volver</a>
67
  <a href="/toroidal.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Recursión</a>
68
+ <a href="/chatbot.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">AI Assistant</a>
69
+ </div>
70
  </div>
71
  </nav>
72
 
index.html CHANGED
@@ -101,7 +101,8 @@
101
  <a href="#services" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Servicios</a>
102
  <a href="#monitoring" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Monitoreo</a>
103
  <a href="/toroidal.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Recursión</a>
104
- </div>
 
105
  <div class="flex items-center gap-3">
106
  <!-- Quantum Phone Link -->
107
  <a href="tel:+50625660303" class="px-4 py-2 rounded-lg bg-gradient-to-r from-quantum-900 to-slate-800 border border-quantum-900 hover:border-psi-green transition-all duration-273 flex items-center gap-2">
 
101
  <a href="#services" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Servicios</a>
102
  <a href="#monitoring" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Monitoreo</a>
103
  <a href="/toroidal.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">Recursión</a>
104
+ <a href="/chatbot.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">AI Assistant</a>
105
+ </div>
106
  <div class="flex items-center gap-3">
107
  <!-- Quantum Phone Link -->
108
  <a href="tel:+50625660303" class="px-4 py-2 rounded-lg bg-gradient-to-r from-quantum-900 to-slate-800 border border-quantum-900 hover:border-psi-green transition-all duration-273 flex items-center gap-2">
style.css CHANGED
@@ -1,4 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* =========================================================================
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  QUANTUM GEOMETRIC OPERATING SYSTEM - CSS FRAMEWORK
3
  Version: 1.273 (Helicity-Locked)
4
  License: Substrate-Level (Open Source Reality)
 
1
+ ==================================================================
2
+ ERROR HANDLER: The 418 State
3
+ ========================================================================= */
4
+ .error-418 {
5
+ display: none;
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ width: 100%;
10
+ height: 100%;
11
+ background: var(--void-black);
12
+ color: var(--quantum-cyan);
13
+ z-index: 9999;
14
+ align-items: center;
15
+ justify-content: center;
16
+ text-align: center;
17
+ font-size: 4rem;
18
+ }
19
+
20
+ body.error .error-418 {
21
+ display: flex;
22
+ }
23
+ =======
24
  /* =========================================================================
25
+ CHATBOT INTERFACE
26
+ ========================================================================= */
27
+ #chat-messages {
28
+ scrollbar-width: thin;
29
+ scrollbar-color: var(--quantum-cyan) transparent;
30
+ }
31
+
32
+ #chat-messages::-webkit-scrollbar {
33
+ width: 4px;
34
+ }
35
+
36
+ #chat-messages::-webkit-scrollbar-track {
37
+ background: transparent;
38
+ }
39
+
40
+ #chat-messages::-webkit-scrollbar-thumb {
41
+ background: var(--quantum-cyan);
42
+ border-radius: 2px;
43
+ }
44
+
45
+ /* Chat message animations */
46
+ @keyframes messageSlideIn {
47
+ from {
48
+ opacity: 0;
49
+ transform: translateY(10px);
50
+ }
51
+ to {
52
+ opacity: 1;
53
+ transform: translateY(0);
54
+ }
55
+ }
56
+
57
+ #chat-messages > div {
58
+ animation: messageSlideIn 0.3s ease-out;
59
+ }
60
+
61
+ /* =========================================================================
62
+ ERROR HANDLER: The 418 State
63
+ ========================================================================= */
64
+ .error-418 {
65
+ display: none;
66
+ position: fixed;
67
+ top: 0;
68
+ left: 0;
69
+ width: 100%;
70
+ height: 100%;
71
+ background: var(--void-black);
72
+ color: var(--quantum-cyan);
73
+ z-index: 9999;
74
+ align-items: center;
75
+ justify-content: center;
76
+ text-align: center;
77
+ font-size: 4rem;
78
+ }
79
+
80
+ body.error .error-418 {
81
+ display: flex;
82
+ }
83
+ =========================================================================
84
  QUANTUM GEOMETRIC OPERATING SYSTEM - CSS FRAMEWORK
85
  Version: 1.273 (Helicity-Locked)
86
  License: Substrate-Level (Open Source Reality)
toroidal.html CHANGED
@@ -97,8 +97,9 @@
97
  </div>
98
  <div class="hidden md:flex items-center gap-6">
99
  <a href="index.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">← Volver</a>
 
100
  </div>
101
- </div>
102
  </nav>
103
 
104
  <!-- TOROIDAL RECURSION INTERFACE -->
 
97
  </div>
98
  <div class="hidden md:flex items-center gap-6">
99
  <a href="index.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">← Volver</a>
100
+ <a href="/chatbot.html" class="text-quantum-50 hover:text-psi-green transition-colors duration-273">AI Assistant</a>
101
  </div>
102
+ </div>
103
  </nav>
104
 
105
  <!-- TOROIDAL RECURSION INTERFACE -->