From 0a7fe6389f6503966d27acb35c405af4868bd76d Mon Sep 17 00:00:00 2001 From: Maciej Pienczyn Date: Sat, 28 Mar 2026 06:12:49 +0100 Subject: [PATCH] feat(nordagpt): avatars in chat + anti-hallucination rule for companies - NordaGPT icon (nordagpt-icon.svg) as AI avatar instead of "AI" text - User profile photo as avatar (falls back to initial letter) - CRITICAL: added strict rule to never hallucinate company names - Only mention companies that exist in the provided database Co-Authored-By: Claude Opus 4.6 (1M context) --- nordabiz_chat.py | 7 +++++++ templates/chat.html | 33 ++++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/nordabiz_chat.py b/nordabiz_chat.py index ddbbb82..e4f5fe6 100644 --- a/nordabiz_chat.py +++ b/nordabiz_chat.py @@ -1008,6 +1008,13 @@ ZASADY PERSONALIZACJI: - Na pytania "co wiesz o mnie?" / "kim jestem?" — wypisz powyższe dane + powiązania firmowe z bazy - Uwzględniaj kontekst firmy użytkownika w odpowiedziach - NIE ujawniaj danych technicznych (user_id, company_id, rola systemowa) + +KRYTYCZNA ZASADA DOTYCZĄCA FIRM: +- WYMIENIAJ WYŁĄCZNIE firmy, które znajdują się w dostarczonej bazie danych poniżej +- NIGDY nie wymyślaj, nie zgaduj ani nie halucynuj nazw firm +- Jeśli w bazie nie ma firmy pasującej do zapytania, powiedz wprost: "W bazie Izby nie znalazłem firmy o takim profilu" +- Każda wymieniona firma MUSI mieć link do profilu w formacie [Nazwa](/firma/slug) +- Jeśli nie masz pewności czy firma istnieje w bazie — NIE WYMIENIAJ JEJ """ # Inject user memory (facts + conversation summaries) into prompt diff --git a/templates/chat.html b/templates/chat.html index d3fe2c6..bf6a253 100755 --- a/templates/chat.html +++ b/templates/chat.html @@ -433,9 +433,22 @@ color: white; } + .message.assistant .message-avatar img { + width: 24px; + height: 24px; + filter: brightness(0) invert(1); + } + .message.user .message-avatar { background: var(--primary); color: white; + overflow: hidden; + } + + .message.user .message-avatar img { + width: 100%; + height: 100%; + object-fit: cover; } .message-content { @@ -1828,7 +1841,7 @@