salomonsky commited on
Commit
56069b3
·
verified ·
1 Parent(s): 2667b21

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +96 -193
index.html CHANGED
@@ -5,153 +5,8 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Chatbot</title>
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
8
- <style>
9
- body {
10
- background-color: #f5f5f5;
11
- font-family: Arial, sans-serif;
12
- }
13
-
14
- .chat-container {
15
- max-width: 800px;
16
- margin: 20px auto;
17
- padding: 20px;
18
- background-color: white;
19
- border-radius: 10px;
20
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
21
- }
22
-
23
- #chatBox {
24
- height: 400px;
25
- overflow-y: auto;
26
- padding: 20px;
27
- border: 1px solid #ddd;
28
- border-radius: 5px;
29
- margin-bottom: 20px;
30
- background-color: #f8f9fa;
31
- }
32
-
33
- .message {
34
- margin: 10px 0;
35
- padding: 12px;
36
- border-radius: 10px;
37
- max-width: 80%;
38
- position: relative;
39
- animation: fadeIn 0.3s ease-in;
40
- display: flex;
41
- align-items: flex-start;
42
- }
43
-
44
- .message-icon {
45
- margin-right: 8px;
46
- font-size: 1.2em;
47
- }
48
-
49
- .message-text {
50
- word-wrap: break-word;
51
- flex: 1;
52
- }
53
-
54
- .user-message {
55
- background-color: #007bff;
56
- color: white;
57
- margin-left: auto;
58
- flex-direction: row-reverse;
59
- }
60
-
61
- .user-message .message-icon {
62
- margin-right: 0;
63
- margin-left: 8px;
64
- }
65
-
66
- .bot-message {
67
- background-color: #e9ecef;
68
- color: black;
69
- margin-right: auto;
70
- }
71
-
72
- .control-panel {
73
- background-color: #f8f9fa;
74
- padding: 15px;
75
- border-radius: 5px;
76
- margin-bottom: 20px;
77
- border: 1px solid #dee2e6;
78
- }
79
-
80
- .status-label {
81
- font-size: 1em;
82
- color: #333;
83
- margin-top: 15px;
84
- text-align: center;
85
- font-style: italic;
86
- padding: 10px;
87
- background-color: #f8f9fa;
88
- border-radius: 5px;
89
- border: 1px solid #dee2e6;
90
- display: block;
91
- }
92
-
93
- .recording-button {
94
- transition: all 0.3s ease;
95
- width: 50px;
96
- height: 38px;
97
- padding: 0;
98
- display: flex;
99
- align-items: center;
100
- justify-content: center;
101
- font-size: 1.2em;
102
- }
103
-
104
- .recording-button.active {
105
- background-color: #dc3545 !important;
106
- animation: pulse 1.5s infinite;
107
- }
108
-
109
- @keyframes pulse {
110
- 0% { transform: scale(1); }
111
- 50% { transform: scale(1.05); }
112
- 100% { transform: scale(1); }
113
- }
114
-
115
- @keyframes fadeIn {
116
- from { opacity: 0; transform: translateY(10px); }
117
- to { opacity: 1; transform: translateY(0); }
118
- }
119
-
120
- .input-group {
121
- margin: 5px 15px;
122
- }
123
-
124
- #textInput {
125
- border-radius: 5px 0 0 5px;
126
- border: 1px solid #ced4da;
127
- padding: 8px 12px;
128
- }
129
-
130
- #sendText {
131
- border-radius: 0;
132
- margin-right: -1px;
133
- }
134
-
135
- #startRecording {
136
- border-radius: 0 5px 5px 0;
137
- }
138
-
139
- .form-select {
140
- cursor: pointer;
141
- }
142
-
143
- .form-label {
144
- font-weight: 500;
145
- margin-bottom: 5px;
146
- }
147
-
148
- #ngrokUrl {
149
- font-size: 0.9em;
150
- background-color: #f8f9fa;
151
- border-color: #dee2e6;
152
- min-width: 250px;
153
- }
154
- </style>
155
  </head>
156
  <body>
157
  <div class="container mt-4">
@@ -159,6 +14,9 @@
159
  <li class="nav-item" role="presentation">
160
  <button class="nav-link active" id="chat-tab" data-bs-toggle="tab" data-bs-target="#chat" type="button" role="tab">💬 Chat</button>
161
  </li>
 
 
 
162
  {% if config.NGROK_URL %}
163
  <li class="nav-item ms-auto d-flex align-items-center">
164
  <div class="input-group">
@@ -173,72 +31,117 @@
173
  <!-- Tab de Chat -->
174
  <div class="tab-pane fade show active" id="chat" role="tabpanel">
175
  <div class="chat-container">
176
- <div class="control-panel">
177
- <div class="row">
178
- <div class="col-md-4">
179
- <label for="modoSelect" class="form-label">📋 Modo:</label>
180
- <select id="modoSelect" class="form-select">
181
- <option value="seguros">🛡️ Seguros</option>
182
- <option value="credito">💰 Créditos</option>
183
- <option value="cobranza">💵 Cobranza</option>
184
- </select>
185
- </div>
186
- <div class="col-md-4">
187
- <label for="modeloSelect" class="form-label">🤖 Modelo:</label>
188
- <select id="modeloSelect" class="form-select">
189
- <option value="gemini">🧠 Gemini 8b</option>
190
- <option value="mixtral">⚡Mixtral 7b</option>
191
- </select>
192
- </div>
193
- <div class="col-md-4">
194
- <label for="vozSelect" class="form-label">🎤 Voz:</label>
195
- <select id="vozSelect" class="form-select">
196
- <option value="EDGE">📢 Edge</option>
197
- <option value="VITS">🔊 VITS</option>
198
- <option value="gTTS">🌐 gTTS</option>
199
- </select>
 
 
 
 
200
  </div>
201
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  </div>
203
 
204
- <div id="chatBox"></div>
205
-
206
- <div class="input-group">
207
- <input type="text" id="textInput" class="form-control" placeholder="Escribe tu mensaje...">
208
- <button id="sendText" class="btn btn-primary">Enviar</button>
209
- <button id="startRecording" class="btn btn-success recording-button">🎤</button>
 
 
 
 
 
 
 
 
 
 
 
 
210
  </div>
211
-
212
- <div class="status-label" id="statusLabel">Iniciando...</div>
213
  </div>
214
  </div>
215
 
216
  <!-- Tab de Configuración -->
217
  <div class="tab-pane fade" id="config" role="tabpanel">
218
- <div class="chat-container">
219
- <form id="configForm">
220
- <div class="mb-3">
221
- <label for="googleApiKey" class="form-label">Google API Key:</label>
222
- <input type="password" class="form-control" id="googleApiKey" value="{{ config.get('GOOGLE_API_KEY', '') }}">
223
- </div>
224
- <div class="mb-3">
225
- <label for="huggingfaceToken" class="form-label">HuggingFace Token:</label>
226
- <input type="password" class="form-control" id="huggingfaceToken" value="{{ config.get('HUGGINGFACE_TOKEN', '') }}">
227
  </div>
228
- <div class="mb-3">
229
- <label for="openaiApiKey" class="form-label">OpenAI API Key:</label>
230
- <input type="password" class="form-control" id="openaiApiKey" value="{{ config.get('OPENAI_API_KEY', '') }}">
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  </div>
232
- <button type="submit" class="btn btn-primary">Guardar</button>
233
- </form>
234
  </div>
235
  </div>
236
  </div>
237
  </div>
238
 
239
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
 
240
  <script src="{{ url_for('static', filename='js/main.js') }}"></script>
241
  <script>
 
 
 
 
 
 
 
 
 
242
  function shareUrl() {
243
  const url = document.getElementById('ngrokUrl').value;
244
  navigator.clipboard.writeText(url).then(() => {
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Chatbot</title>
7
  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
8
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
9
+ <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </head>
11
  <body>
12
  <div class="container mt-4">
 
14
  <li class="nav-item" role="presentation">
15
  <button class="nav-link active" id="chat-tab" data-bs-toggle="tab" data-bs-target="#chat" type="button" role="tab">💬 Chat</button>
16
  </li>
17
+ <li class="nav-item" role="presentation">
18
+ <button class="nav-link" id="config-tab" data-bs-toggle="tab" data-bs-target="#config" type="button" role="tab">⚙️ Configuración</button>
19
+ </li>
20
  {% if config.NGROK_URL %}
21
  <li class="nav-item ms-auto d-flex align-items-center">
22
  <div class="input-group">
 
31
  <!-- Tab de Chat -->
32
  <div class="tab-pane fade show active" id="chat" role="tabpanel">
33
  <div class="chat-container">
34
+ <div class="chat-main">
35
+ <div class="control-panel">
36
+ <div class="row">
37
+ <div class="col-md-4">
38
+ <label for="modoSelect" class="form-label">📋 Modo:</label>
39
+ <select id="modoSelect" class="form-select">
40
+ <option value="soporte" selected>🔧 Soporte Técnico</option>
41
+ <option value="seguros">🛡️ Seguros</option>
42
+ <option value="creditos">💰 Créditos</option>
43
+ <option value="cobranza">💵 Cobranza</option>
44
+ <option value="encuestas">📊 Encuestas</option>
45
+ </select>
46
+ </div>
47
+ <div class="col-md-4">
48
+ <label for="modeloSelect" class="form-label">🤖 Modelo:</label>
49
+ <select id="modeloSelect" class="form-select">
50
+ <option value="gemini" selected>🧠 Gemini</option>
51
+ <option value="mixtral">⚡Mixtral</option>
52
+ </select>
53
+ </div>
54
+ <div class="col-md-4">
55
+ <label for="vozSelect" class="form-label">🎤 Voz:</label>
56
+ <select id="vozSelect" class="form-select">
57
+ <option value="EDGE" selected>🗣️ Jorge (MX)</option>
58
+ <option value="EDGE_ES">👨 Álvaro (ES)</option>
59
+ <option value="VITS">🎙️ VITS (ES)</option>
60
+ </select>
61
+ </div>
62
  </div>
63
  </div>
64
+
65
+ <div id="chatBox"></div>
66
+
67
+ <div class="input-group">
68
+ <input type="text" id="textInput" class="form-control" placeholder="Escribe tu mensaje...">
69
+ <button id="sendText" class="btn btn-primary">
70
+ <i class="fas fa-paper-plane"></i> Enviar
71
+ </button>
72
+ <button id="startRecording" class="btn btn-primary recording-button">
73
+ <i class="fas fa-microphone"></i>
74
+ </button>
75
+ </div>
76
+
77
+ <div class="status-label" id="statusLabel">Iniciando...</div>
78
  </div>
79
 
80
+ <div class="voice-commands">
81
+ <h5>🎤 Comandos de Voz</h5>
82
+ <div class="command-group">
83
+ <span class="command-pill stop">⏹️ Alto</span>
84
+ <span class="command-pill stop">⏹️ Detente</span>
85
+ <span class="command-pill stop">⏹️ Silencio</span>
86
+ <span class="command-pill stop">⏹️ Calla</span>
87
+ </div>
88
+ <div class="command-group">
89
+ <span class="command-pill greet">👋 Hola</span>
90
+ <span class="command-pill greet">👋 Buenos días</span>
91
+ <span class="command-pill greet">👋 Buenas tardes</span>
92
+ </div>
93
+ <div class="command-group">
94
+ <span class="command-pill interest">✨ Me interesa</span>
95
+ <span class="command-pill interest">✨ Dime más</span>
96
+ <span class="command-pill interest">✨ Acepto</span>
97
+ </div>
98
  </div>
 
 
99
  </div>
100
  </div>
101
 
102
  <!-- Tab de Configuración -->
103
  <div class="tab-pane fade" id="config" role="tabpanel">
104
+ <div class="config-container mt-4">
105
+ <div class="card">
106
+ <div class="card-header">
107
+ <h5 class="mb-0">Configuración de APIs</h5>
 
 
 
 
 
108
  </div>
109
+ <div class="card-body">
110
+ <form id="apiConfigForm">
111
+ <div class="mb-3">
112
+ <label for="openaiKey" class="form-label">OpenAI API Key</label>
113
+ <input type="password" class="form-control" id="openaiKey" placeholder="Ingresa tu API key de OpenAI">
114
+ </div>
115
+ <div class="mb-3">
116
+ <label for="huggingfaceKey" class="form-label">Hugging Face API Key</label>
117
+ <input type="password" class="form-control" id="huggingfaceKey" placeholder="Ingresa tu API key de Hugging Face">
118
+ </div>
119
+ <div class="mb-3">
120
+ <label for="elevenLabsKey" class="form-label">ElevenLabs API Key</label>
121
+ <input type="password" class="form-control" id="elevenLabsKey" placeholder="Ingresa tu API key de ElevenLabs">
122
+ </div>
123
+ <button type="submit" class="btn btn-primary">Guardar configuración</button>
124
+ </form>
125
  </div>
126
+ </div>
 
127
  </div>
128
  </div>
129
  </div>
130
  </div>
131
 
132
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
133
+ <script src="{{ url_for('static', filename='js/config.js') }}"></script>
134
  <script src="{{ url_for('static', filename='js/main.js') }}"></script>
135
  <script>
136
+ document.addEventListener('DOMContentLoaded', function() {
137
+ setTimeout(() => {
138
+ const startRecordingBtn = document.getElementById('startRecording');
139
+ if (startRecordingBtn) {
140
+ startRecordingBtn.click();
141
+ }
142
+ }, 2000);
143
+ });
144
+
145
  function shareUrl() {
146
  const url = document.getElementById('ngrokUrl').value;
147
  navigator.clipboard.writeText(url).then(() => {