Test the embeddable AI chatbot widget on this page
Agrega esta línea en cualquier sitio web para integrar el chatbot:
El widget se cargará automáticamente y se posicionará en la esquina inferior derecha.
Personaliza el widget mediante la API /api/config:
{
"theme": {
"primaryColor": "#4f46e5",
"backgroundColor": "#ffffff"
},
"chat": {
"title": "Asistente IA",
"welcomeMessage": "¡Hola! ¿Cómo puedo ayudarte hoy?",
"welcomingQuestion1": "¿Cómo comprar?",
"welcomingQuestion2": "¿Cuáles son los horarios?"
},
"context": {
"enablePersistence": true,
"maxHistoryLength": 20
}
}Los usuarios pueden solicitar ayuda de un operador humano en cualquier momento.
Los operadores pueden gestionar conversaciones desde el panel admin.
Acceso al Panel:
https://yoursite.com/admin.htmlPOST/api/chatEnvía mensajes al bot
POST/api/chat/escalateEscala a modo humano
POST/api/chat/handover/takeTomar control de sesión
POST/api/chat/handover/releaseLiberar sesión
GET/api/chat/admin/conversations/activeLista sesiones activas
POST/api/chat/admin/sendEnvía mensaje de operador
WS/api/chat/wsConexión tiempo real para clientes y operadores
Crea un archivo .env.local con:
LANGFLOW_API_URL=http://localhost:7860 LANGFLOW_API_KEY=tu-api-key LANGFLOW_FLOW_ID=tu-flow-id HUMAN_TIMEOUT_MS=1800000 PORT=3000
¡Prueba el widget ahora!
Busca el botón de chat en la esquina inferior derecha para probar el chatbot