feat(whatsapp): QWEN primary AI backend, Hermes fallback, conversation history, vehicle persistence, demo prompts

- Add QWEN (qwen3.6) as primary AI backend with short system prompt
- Hermes remains as fallback with 45s timeout
- Increase QWEN timeout to 35s, max_tokens to 4000
- Add conversation history loading from whatsapp_messages (last 4 msgs)
- Persist detected vehicle in whatsapp_sessions table
- Add 'limpiar chat' / 'nuevo chat' / 'reset' commands to clear history
- Fix CSS conflict: rename whatsapp chat-panel classes to wa-chat-panel
- Fix JS ID conflicts with chat.js widget (waChatPanel, waChatMessages, etc.)
- Improve no-stock response: conversational with alternatives
- Split search_query by | for multi-part lookups
- Add DEMO_PROMPTS.md and DEMO_PROMPTS_V2.md
This commit is contained in:
2026-05-06 20:27:14 +00:00
parent 371d72887e
commit ff45905b49
33 changed files with 3040 additions and 445 deletions

View File

@@ -217,14 +217,14 @@
/* ─── Right panel: chat view ─────────────────────────────────────── */
.chat-panel {
.wa-chat-panel {
flex: 1;
display: flex;
flex-direction: column;
background: var(--color-bg-base);
}
.chat-panel__header {
.wa-chat-panel__header {
display: flex;
align-items: center;
justify-content: space-between;
@@ -234,18 +234,18 @@
flex-shrink: 0;
}
.chat-panel__phone {
.wa-chat-panel__phone {
font-weight: var(--font-weight-semibold);
font-size: var(--text-body);
color: var(--color-text-primary);
}
.chat-panel__actions {
.wa-chat-panel__actions {
display: flex;
gap: var(--space-2);
}
.chat-panel__messages {
.wa-chat-panel__messages {
flex: 1;
overflow-y: auto;
padding: var(--space-4);
@@ -500,7 +500,7 @@
@media (max-width: 768px) {
.conv-panel { width: 100%; min-width: 0; }
.chat-panel { display: none; }
.wa-chat-panel { display: none; width: 100%; }
.messenger.has-active-chat .conv-panel { display: none; }
.messenger.has-active-chat .chat-panel { display: flex; }
.messenger.has-active-chat .wa-chat-panel { display: flex !important; width: 100%; }
}