Spaces:
Runtime error
Runtime error
Commit History
-
fix: Bypass exhausted Gemini API key from env var
CNESST Deployc9b9092 -
chore: Update Gemini API key (fresh quota)
CNESST Deploy3b92d5d -
chore: Update Gemini API key
CNESST Deploy71c6cda -
feat: Auto-fallback LLM (Gemini → Groq) + sanitized error messages
CNESST Deploy +1: Claude Opus 4.6- Initialize both Gemini (primary) and Groq (fallback) clients at startup - Add _call_llm_with_fallback(): tries Gemini first; on 429 rate-limit, automatically switches to Groq transparently (doubles free daily capacity) - Add _is_rate_limit_error(): detects 429/quota errors from both providers - Update /health endpoint to expose both backends and their models - Sanitize all LLM error messages: no raw API errors exposed to users - Rate-limit → "⏳ Service temporairement surchargé. Réessayez dans quelques minutes." - Other errors → "❌ Erreur temporaire du service. Réessayez." - Update deflection retry path to also use the new fallback function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>5b2653f -
Switch default LLM backend from Groq to Gemini 2.0 Flash (1M tokens/day free)
CNESST Deploy- Change LLM_BACKEND default from 'groq' to 'gemini' - Update header comment: Gemini is now recommended default - Update system prompt: 7519 articles (was 7173), 22 sources unchanged8739e37 -
Ajouter 7 nouvelles réglementations québécoises + rebuild ChromaDB
CNESST Deploy +1: Claude Opus 4.6Nouvelles sources ajoutées (7): - Comités-SST: Règlement sur les comités de santé et de sécurité (S-2.1, r. 5) - Représentant-Prévention: Règlement sur le représentant à la prévention (S-2.1, r. 12) - Premiers-Secours: Règlement sur les normes minimales de premiers secours (A-3.001, r. 10) - Programme-Prévention: Règlement sur le programme de prévention (S-2.1, r. 10) - Qualité-Milieu-Travail: Règlement sur la qualité du milieu de travail (S-2.1, r. 11) - Travaux-Fonderie: Règlement sur la sécurité et l'hygiène dans les travaux de fonderie (S-2.1, r. 15) - Signalisation-Routière: Règlement sur la signalisation routière (C-24.2, r. 41) ChromaDB rebuildi avec chromadb 1.x (format compatible): - Avant: 6 790 documents, 14-15 sources (chromadb 0.4.x) - Après: 7 173 documents, 22 sources (chromadb 1.x) app.py: Mise à jour du prompt système (22 sources, 7 173 articles) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>61c34ed -
feat: Add 👍👎 feedback buttons to bot responses
CNESST Deploy +1: Claude Opus 4.6- Backend (app.py): - Add `message_id: str` field to ChatResponse (short UUID, 8 chars) - Add FeedbackRequest Pydantic model (message_id, question, rating) - Add POST /api/feedback endpoint — stores entries in feedback.json - Add GET /api/feedback/stats endpoint — returns up/down/total counts - Import json, uuid, datetime for new functionality - Frontend (static/index.html): - Add .feedback-row, .feedback-btn, .selected-up/down CSS classes - Add .toast CSS for brief confirmation notification - Add buildFeedbackHtml() — renders 👍/👎 buttons per message_id - Add submitFeedback() — highlights selected button, disables both, POSTs to /api/feedback, shows "Merci pour votre évaluation!" toast - Add showToast() helper with auto-dismiss after 2.5s - Update appendBotMessage() to accept messageId+question params - Pass data.message_id and user question from sendMessage() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>6f62ade -
v3: Improved response quality, anti-deflection system, BM25+hybrid retrieval, 6790 docs
CNESST Deploy +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>51a1743 -
v2: Enhanced metadata, re-ranker, 4646 docs
CNESST Deploy8dc4e6e
-
Update system prompt to direct foreman-style tone
CNESST Deploy +1: Claude Opus 4.6Replace the formal expert/disclaimer-heavy prompt with a direct, practical "vieux charpentier-foreman" voice. Removes the 'no legal advice' restriction, cuts unnecessary hedging, and focuses on confident answers grounded in the article sources. Safety warnings reserved for genuinely dangerous situations only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>9dac02c -
Initial deployment of CNESST RAG chatbot
CNESST Deployad4ac0d