feat: asistente IA Gemini Flash en dashboard turnero + config token
- ai_chat.php: contexto completo (tiempos, facturación, franjas, turnos detallados) - Preguntas soportadas: demoras por recepcionista, total facturado, horas pico, tiempo total por paciente, exámenes, búsqueda por cédula - Panel flotante de chat en dashboard (botón robot azul) - Búsqueda de tabla ahora filtra por cédula/documento - Ícono de fila gira al expandir detalle (flecha → rotada) - lab_configuracion.php: nueva sección IA con campo token Gemini - save_config.php: permite guardar gemini_api_key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f738607738
commit
d0152e37ce
@@ -165,6 +165,30 @@ require_once __DIR__ . '/shared/components/sidebar.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── Inteligencia Artificial ────────────────────────── -->
|
||||
<div class="section-card">
|
||||
<h6><i class="fas fa-robot me-1"></i>Inteligencia Artificial — Google Gemini</h6>
|
||||
<p class="text-muted small mb-3">
|
||||
El asistente IA del turnero usa Google Gemini Flash para responder preguntas
|
||||
sobre el estado del día. Genera tu clave en
|
||||
<a href="https://aistudio.google.com/app/apikey" target="_blank" rel="noopener">Google AI Studio</a>.
|
||||
</p>
|
||||
<div class="mb-2">
|
||||
<label class="form-label fw-semibold small">Token de API (Gemini Flash)</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" id="c-gemini-key"
|
||||
value="<?= htmlspecialchars($cfg['gemini_api_key'] ?? '') ?>"
|
||||
placeholder="AIza…"
|
||||
autocomplete="off">
|
||||
<button class="btn btn-outline-secondary" type="button"
|
||||
onclick="this.previousElementSibling.type = this.previousElementSibling.type === 'password' ? 'text' : 'password'">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="form-text">El token se guarda cifrado y nunca se expone al navegador.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary btn-lg w-100" onclick="guardar()">
|
||||
<i class="fas fa-save me-2"></i>Guardar configuración
|
||||
</button>
|
||||
@@ -286,6 +310,7 @@ async function guardar() {
|
||||
doc_color: $('c-doc-color').value,
|
||||
doc_logo_base64: $('c-logo-base64').value,
|
||||
doc_pie_pagina: $('c-doc-pie').value.trim(),
|
||||
gemini_api_key: $('c-gemini-key').value.trim(),
|
||||
};
|
||||
|
||||
if (!payload.empresa_nombre) {
|
||||
|
||||
Reference in New Issue
Block a user